Back

[SOLVED] Could not resolve host on Python Function

  • 0
  • Functions
ianmont
6 Apr, 2023, 02:15

Im trying to create an execution of a python function that only returns a string, and it gives me a "Could not resolve host". I attach a photo of the code and the error.

Why is that happening?

TL;DR
User is experiencing a "Could not resolve host" error when trying to run a Python function on Appwrite. The issue was resolved by checking and updating the open runtimes network in the .env file. The user also discovered that the docker-compose file was in a different location than expected, but it is unclear if this was the root cause of the problem. The user is unsure of how Appwrite was installed and is trying to locate the original docker-compose file used during installation.
Drake
6 Apr, 2023, 02:20

Are you on self-hosted? If so, how did you install Appwrite?

ianmont
6 Apr, 2023, 02:24

Yes im in selfhosted

ianmont
6 Apr, 2023, 02:24

i opened the appwrite-executor and this logs out in the docker image

ianmont
6 Apr, 2023, 02:25
Drake
6 Apr, 2023, 02:26

How did you install Appwrite? Are your docker files in a folder named appwrite?

ianmont
6 Apr, 2023, 02:29

To be honest I don't remember how I installed appwrite, I opened my docker desktop and found a running instance so I decided to use it, I'm trying to find the docker-compose file that I used at that time

Drake
6 Apr, 2023, 02:30

Does docker compose ls give any insight?

ianmont
6 Apr, 2023, 02:33

Oh with that I found it, only apparently the docker-compose file is not in the same path, I moved it from the folder. The docker compose ls points me to my directory

X:\DataYProgramas\ReactJS\stripetest2\backend\database\docker-compose.yaml

But the file is in

X:\DataYProgramas\ReactJS\stripetest2\STRIPE CONNECT TESTING\backend\database

Do you think that is the problem?

ianmont
6 Apr, 2023, 02:34

I don't know if this information about the location of the file is relevant, but I am commenting it in case it can help in something

Drake
6 Apr, 2023, 02:42

So the problem is the open runtimes network isn't right. Run docker network ls to see the networks. Then, in the .env file, look for the runtimes network environment variable. Put the name of the network into the variable

ianmont
6 Apr, 2023, 03:02

done

ianmont
6 Apr, 2023, 03:03

but still shows the error

Drake
6 Apr, 2023, 03:03

Did you run docker compose up -d to apply the change to the .env file?

ianmont
6 Apr, 2023, 03:08

forgot to do that

i do it and then create a new execution but still throws me the error 🤔

Drake
6 Apr, 2023, 03:22

Can you share the output of docker inspect appwrite-executor?

ianmont
6 Apr, 2023, 03:30
Drake
6 Apr, 2023, 03:32

OPEN_RUNTIMES_NETWORK is still appwrite_runtimes

ianmont
6 Apr, 2023, 03:37

thanks! its fixed now <:appwriterocket:823996226894692403>

Drake
6 Apr, 2023, 03:38

[SOLVED] Could not resolve host on Python Function

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