Back

Appwrite functions deploy error - Cannot access offset of type string on string

  • 1
  • Tools
  • Functions
squallsama
14 Sep, 2023, 18:45

that means it can reach host now

TL;DR
Issue: Cannot access offset of type string on string Solution: 1. Perform a complete setup from scratch. 2. Execute the example function to check for any internal curl errors. 3. If there is an error, run `docker prune` and `docker compose -d` to reinitialize everything. 4. Restart the Docker compose. 5. Reverse the changes made to `docker-compose.yml` by changing the network name from `appwrite-runtimes` to `runtimes`. 6. Run `docker compose up -d` and check the value of `_APP_EXECUTOR_RUNTIME_NETWORK` using `docker exec appwrite vars
Binyamin
14 Sep, 2023, 18:46

Try to deploy now

squallsama
14 Sep, 2023, 18:46

% docker exec appwrite vars | grep _APP_EXECUTOR_RUNTIME_NETWORK

  • _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes
Binyamin
14 Sep, 2023, 18:47

Something is not quite right

squallsama
14 Sep, 2023, 18:47

Cannot access offset of type string on string

squallsama
14 Sep, 2023, 18:47

what should in _APP_EXECUTOR_RUNTIME_NETWORK ?

Binyamin
14 Sep, 2023, 18:47

Run

TypeScript
docker compose down

Then

TypeScript
docker ps -a

What you get

squallsama
14 Sep, 2023, 18:47

empty list

Binyamin
14 Sep, 2023, 18:47

Just runtimes

squallsama
14 Sep, 2023, 18:49

yeah, that's strange

squallsama
14 Sep, 2023, 18:49

% docker exec appwrite vars | grep _APP_EXECUTOR_RUNTIME_NETWORK

  • _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes
squallsama
14 Sep, 2023, 18:50

even if .env contains only runtimes for network

Binyamin
14 Sep, 2023, 18:50

Have you try running these?

squallsama
14 Sep, 2023, 18:51

% docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Binyamin
14 Sep, 2023, 18:52

Good

Binyamin
14 Sep, 2023, 18:52

No check these again

TypeScript
docker compose up -d
docker exec appwrite vars | grep _APP_EXECUTOR_RUNTIME_NETWORK
Binyamin
14 Sep, 2023, 19:28

Is it working now?

squallsama
14 Sep, 2023, 19:32

% docker exec appwrite vars | grep _APP_EXECUTOR_RUNTIME_NETWORK

  • _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes
squallsama
14 Sep, 2023, 19:32

😦

Binyamin
14 Sep, 2023, 19:45

So try reverse it at the end of docker-compose.yml

TypeScript
networks:
  gateway:
    name: gateway
  appwrite:
    name: appwrite
  runtimes:
-    name: runtimes
+    name: appwrite-runtimes
Binyamin
14 Sep, 2023, 19:45

And restart the docker compose

squallsama
14 Sep, 2023, 19:55

I just did docker prune and docker compose -d and reinit everything and now it looks like works...

Binyamin
14 Sep, 2023, 19:56

Good

squallsama
14 Sep, 2023, 19:57

But when I executed example function - An internal curl error has occurred within the executor! Error Msg: Operation timed out\nError Code: 500

squallsama
14 Sep, 2023, 20:08

well...one more complete setup from scratch did the trick...still have no idea what was root cause

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more