Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Functions not being executed #2940

Closed
2 tasks done
onceuponacode opened this issue Mar 12, 2022 · 56 comments
Closed
2 tasks done

🐛 Bug Report: Functions not being executed #2940

onceuponacode opened this issue Mar 12, 2022 · 56 comments
Assignees
Labels
bug Something isn't working

Comments

@onceuponacode
Copy link

👟 Reproduction steps

Using Appwrite v:0.13.2.302 in docker
And running Appwrite cli v0.15.0

  1. Create function with (node-16.0 runtime):
appwrite init function
  1. Deploy function without editing it
appwrite deploy function  
  1. Open the created function in the function tab of the Appwrite UI
  2. Click on Execute Now without any custom data
  3. Go to Logs tab
  4. Click on the Errors button at the right of the execution's list item

Then you get the below described error.

👍 Expected behavior

The function should run

👎 Actual Behavior

I get this error : "
An internal curl error has occurred within the executor! Error Msg: Could not resolve host: 622bb6f3725e4422610e-622d226c1a20e10fc330
"

When taking a closer look the host is comprised of 2 parts :

  • 622bb6f3725e4422610e: The project id
  • 622d226c1a20e10fc330: The function deployment id

Both of the parameters seemed to coincide with the ones, visible on the UI.

🎲 Appwrite version

Version 0.13.x

💻 Operating system

MacOS

🧱 Your Environment

I use Docker

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@onceuponacode onceuponacode added the bug Something isn't working label Mar 12, 2022
@rdmchr
Copy link
Contributor

rdmchr commented Mar 13, 2022

Hey,
can you check your appwrite-executor logs? (docker logs appwrite-executor)
If you have an error similar to this: Failed to Warmup Node.js 17.0! your issue is related to #2913
Also, let me guess: You are running Ubuntu 20.04?

@onceuponacode
Copy link
Author

onceuponacode commented Mar 13, 2022

Hi,
You were right for the logs but not the OS version.
I am using OSX 12.2.1, and here are my logs:

Warming up Node.js 16.0 environment...

Warming up PHP 8.0 environment...

Warming up Ruby 3.0 environment...

Warming up Python 3.9 environment...

Removing orphan runtimes...

Successfully removed 622bb6f3725e4422610e-622d226c22f4c1a3eb56

Failed to Warmup Ruby 3.0!

Failed to Warmup Node.js 16.0!

Successfully Warmed up Python 3.9!

Failed to Warmup PHP 8.0!

[Error] Type: Exception

[Error] Message: Runtime not found. Please create the runtime.

[Error] File: /usr/src/code/app/executor.php

[Error] Line: 407

Building container : 622bb6f3725e4422610e-622d226c22f4c1a3eb56

Build Stage completed in 1 seconds

Executing Runtime: 622bb6f3725e4422610e-622d226c22f4c1a3eb56

[Error] Type: Exception

[Error] Message: An internal curl error has occurred within the executor! Error Msg: Could not resolve host: 622bb6f3725e4422610e-622d226c22f4c1a3eb56

[Error] File: /usr/src/code/app/executor.php

[Error] Line: 465

Then it loops the last 5 lines several times, and presents the error in the UI.

@yngwi
Copy link

yngwi commented Mar 14, 2022

Hi, I'm having the same problem. I have copied the code of the function and the executor log here but in essence it looks the same as the one by @onceuponacode. My server runs on Ubuntu 21.04, the Appwrite version is 0.13.2.

@kazkis
Copy link

kazkis commented Mar 14, 2022

We are having this issue too , but we are using Docker Desktop running on Windows 10 (on WSL).
We were testing AppWrite 0.12.x and everything was working fine. The problem started after updating to 0.13.x (and it's there even with a fresh install).
Due to this, AppWrite Functions aren't working anymore.

@stnguyen90
Copy link
Contributor

@onceuponacode, you might be executing the function before the runtime is ready. If you wait, do you eventually see logs about the runtime being created? You can also run docker ps to see if the 622bb6f3725e4422610e-622d226c22f4c1a3eb56 container is running.

@yngwi
Copy link

yngwi commented Mar 15, 2022

@stnguyen90 Hi, I'm not @onceuponacode but I just had another look at "my version" of the problem and after several hours of the containers being up I tried to launch the request that triggers my function and this is the resulting executor log (starting from the beginning):

Warming up Node.js 16.0 environment...
Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup PHP 8.0!
Failed to Warmup Ruby 3.0!
Failed to Warmup Node.js 16.0!
Failed to Warmup Python 3.9!
Running maintenance task ...
Running maintenance task ...
Running maintenance task ...
Running maintenance task ...
Running maintenance task ...
Running maintenance task ...
Running maintenance task ...
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 622db85c73275eca55b2-622eebe9020b8443d8b9
Build failed: File Not Found
[Error] Type: Exception
[Error] Message: File Not Found
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 307

@christyjacob4
Copy link
Member

@yngwi Can you create a new deployment and try again ?
It seems we are unable to reproduce this issue.

@kazkis
Copy link

kazkis commented Mar 15, 2022

I created a new project on a freshly installed Ubuntu 21.10 using Docker Engine 20.10.13 and got similar results:

Warming up Node.js 16.0 environment...
Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup Ruby 3.0! 
Failed to Warmup Node.js 16.0!
Failed to Warmup PHP 8.0!
Failed to Warmup Python 3.9!
Building container : 6230f33c007f7f269715-6230f4eaa85017f532ef
Build Stage completed in 7 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 6230f33c007f7f269715-6230f4eaa85017f532ef
Build Stage completed in 0 seconds
Executing Runtime: 6230f33c007f7f269715-6230f4eaa85017f532ef
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 465
Executing Runtime: 6230f33c007f7f269715-6230f4eaa85017f532ef

The only thing I added to the project is the python function taken from the AppWrite docs (with manual deployment).

@kazkis
Copy link

kazkis commented Mar 15, 2022

I tried using the CLI to deploy the same function instead of choosing the manual deployment (without changing anything else) and everything seems to work.
There is probably something wrong with the manual deployment.

@yngwi
Copy link

yngwi commented Mar 16, 2022

@yngwi Can you create a new deployment and try again ? It seems we are unable to reproduce this issue.

I tried just now, same results. Maybe the container wiring is not correct? Following the installation procedure I'm using the networks appwrite and runtimes in the docker-compose.yml, but instead of the preconfigured traefik network, I'm using my own. Apart from that everything is the same. Now, the autogenerated env contains the following line: _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes Is this correct?

@nickduncan7
Copy link

nickduncan7 commented Mar 17, 2022

Fresh installation of Appwrite v0.13.3.303 on Ubuntu 20.04 with Docker 20.10.7 here. Trying the base Python 3.9 runtime. I've stripped my function code down to the barest of bones and I cannot get functions to execute.

https://gist.github.com/nickduncan7/d79d8ca04adb2a12391f089d12c84fba

My Python says it's able to warm up, so no issues there. I believe this function should follow the new format of function to export. I've tried with sample code from the Appwrite CLI as well and same thing.

Also using the autogenerated env. Not much changed aside from https enabled by default. Any assistance is appreciated!

@stnguyen90
Copy link
Contributor

stnguyen90 commented Mar 17, 2022

Fresh installation of Appwrite v0.13.3.303 on Ubuntu 20.04 with Docker 20.10.7 here. Trying the base Python 3.9 runtime. I've stripped my function code down to the barest of bones and I cannot get functions to execute.

https://gist.github.com/nickduncan7/d79d8ca04adb2a12391f089d12c84fba

My Python says it's able to warm up, so no issues there. I believe this function should follow the new format of function to export. I've tried with sample code from the Appwrite CLI as well and same thing.

Also using the autogenerated env. Not much changed aside from https enabled by default. Any assistance is appreciated!

Anything in the build or runtime logs? How did you deploy your code? Feel free to join us on discord as it would be easier to troubleshoot there rather than go back and forth on GitHub.

@nickduncan7
Copy link

nickduncan7 commented Mar 17, 2022

How do I check those logs? I deployed with the CLI via a Windows client, a Ubuntu client, and by uploading the code to the web interface directly. I followed the existing example generated from appwrite init function and in fact that example code does not run successfully either.

With all due respect I've seen similar issues discussed on Discord with no apparent resolution to the problem, I'd prefer to keep the conversation here if that's possible.

Edit: Figured out the runtime logs. That's given me enough info to go on, now I've got the sample function code working.

@yngwi
Copy link

yngwi commented Mar 17, 2022

Hi again, I just tried a completely new local appwrite setup using the docker command from the installation instructions, then I created a simple collection and a function that tries to list the available documents by just copy&pasting code from the documentation. I then created a deployment using the appwrite cli that I also freshly installed in my WSL installation. I then executed the function several times using the CLI and the browser based admin interface, with the same result again:

me@WSL:~/tmp/appwrite$ docker logs appwrite-executor -f
Warming up Node.js 16.0 environment...
Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup Ruby 3.0!
Failed to Warmup Node.js 16.0!
Failed to Warmup PHP 8.0!
Failed to Warmup Python 3.9!
Building container : 62336741a47377184a9e-62336809c339a4f8a231
Build Stage completed in 9 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 62336741a47377184a9e-62336809c339a4f8a231
Build Stage completed in 1 seconds
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 465
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
Function executed in 0.090941905975342 seconds, status: completed
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
Function executed in 0.0027098655700684 seconds, status: completed
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
Function executed in 0.0022468566894531 seconds, status: completed
Building container : 62336741a47377184a9e-62336957e316b4a0b944
Build Stage completed in 7 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 62336741a47377184a9e-62336957e316b4a0b944
Build Stage completed in 1 seconds
Executing Runtime: 62336741a47377184a9e-62336957e316b4a0b944
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 465
Executing Runtime: 62336741a47377184a9e-62336957e316b4a0b944
Function executed in 15.015694856644 seconds, status: failed
Executing Runtime: 62336741a47377184a9e-62336957e316b4a0b944
Function executed in 15.012204885483 seconds, status: failed

I'm not sure what else I can try to fix function execution for me, this is as vanilla as I can get, I guess. I'm grateful for all pointers.

@stnguyen90
Copy link
Contributor

Hi again, I just tried a completely new local appwrite setup using the docker command from the installation instructions, then I created a simple collection and a function that tries to list the available documents by just copy&pasting code from the documentation. I then created a deployment using the appwrite cli that I also freshly installed in my WSL installation. I then executed the function several times using the CLI and the browser based admin interface, with the same result again:

me@WSL:~/tmp/appwrite$ docker logs appwrite-executor -f
Warming up Node.js 16.0 environment...
Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup Ruby 3.0!
Failed to Warmup Node.js 16.0!
Failed to Warmup PHP 8.0!
Failed to Warmup Python 3.9!
Building container : 62336741a47377184a9e-62336809c339a4f8a231
Build Stage completed in 9 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 62336741a47377184a9e-62336809c339a4f8a231
Build Stage completed in 1 seconds
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 465
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
Function executed in 0.090941905975342 seconds, status: completed
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
Function executed in 0.0027098655700684 seconds, status: completed
Executing Runtime: 62336741a47377184a9e-62336809c339a4f8a231
Function executed in 0.0022468566894531 seconds, status: completed
Building container : 62336741a47377184a9e-62336957e316b4a0b944
Build Stage completed in 7 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 62336741a47377184a9e-62336957e316b4a0b944
Build Stage completed in 1 seconds
Executing Runtime: 62336741a47377184a9e-62336957e316b4a0b944
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 465
Executing Runtime: 62336741a47377184a9e-62336957e316b4a0b944
Function executed in 15.015694856644 seconds, status: failed
Executing Runtime: 62336741a47377184a9e-62336957e316b4a0b944
Function executed in 15.012204885483 seconds, status: failed

I'm not sure what else I can try to fix function execution for me, this is as vanilla as I can get, I guess. I'm grateful for all pointers.

62336741a47377184a9e-62336809c339a4f8a231 seems like it works. What's the difference between that and 62336741a47377184a9e-62336957e316b4a0b944?

Also, it would be easier to troubleshoot this over Discord rather than Github.

@yngwi
Copy link

yngwi commented Mar 17, 2022

Ok I will do so tomorrow. Thank you for your help!

@nickduncan7
Copy link

nickduncan7 commented Mar 18, 2022

I spoke too soon... Started getting this as well after having some successful functions running for most of the day.

Warming up Node.js 16.0 environment...
Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup Node.js 16.0!
Failed to Warmup PHP 8.0!
Failed to Warmup Ruby 3.0!
Failed to Warmup Python 3.9!
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 623229204a6c68daecc8-62337f387f0f51749c64
Build failed: File Not Found
[Error] Type: Exception
[Error] Message: File Not Found
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 307

As previously shown, my Python was warming up fine. One too many docker restarts I guess and it stopped working. No changes to the appwrite instance or function or anything. Any ideas here with where to start looking would be appreciated.

@stnguyen90
Copy link
Contributor

stnguyen90 commented Mar 18, 2022

I spoke too soon... Started getting this as well after having some successful functions running for most of the day.

Warming up Node.js 16.0 environment...
Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup Node.js 16.0!
Failed to Warmup PHP 8.0!
Failed to Warmup Ruby 3.0!
Failed to Warmup Python 3.9!
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 407
Building container : 623229204a6c68daecc8-62337f387f0f51749c64
Build failed: File Not Found
[Error] Type: Exception
[Error] Message: File Not Found
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 307

As previously shown, my Python was warming up fine. One too many docker restarts I guess and it stopped working. No changes to the appwrite instance or function or anything. Any ideas here with where to start looking would be appreciated.

What version of Appwrite are you on?

Please join us on discord as it would be easier to troubleshoot there rather than go back and forth on GitHub.

@nickduncan7
Copy link

Frankly, going back and forth on Discord is not easier for me by any means. As I said before I’m on the latest Appwrite v0.13.3.303.

Thank you, but I’ll be exploring other options for my project going forward. Cheers.

@lohanidamodar
Copy link
Member

Thank you everyone, we are looking into the issue and trying to reproduce it. We will have update soon.

@yngwi
Copy link

yngwi commented Mar 22, 2022

Hi, I just wanted to tell you that with the help of Discord I could finally get my functions that use the SDK client to be executed correctly. My problem was that I didn't set the necessary environment variables APPWRITE_FUNCTION_ENDPOINT and APPWRITE_FUNCTION_API_KEY and that localhost (no domain) doesn't necessarily work for functions in this way. On my actual server the functions now run fine.

@Meldiron
Copy link
Contributor

I just saw a case when Could not resolve host was cause because of appwrite folder has been renamed. Can any of you please confirm if that is the case? If you do pwd inside your folder where you have appwrite installed (where there is docker-compose.yml if you do ls), does the path end with appwrite, or is it something else? If so, does it help the problem if you stop appwrite, rename the folder back to appwrite, and start it again?

@Meldiron
Copy link
Contributor

File Not Found issue should be now fixed with Appwrite 0.13.4. Please upgrade, redeploy your functions, and the error should be gone.

@talshimoni
Copy link

talshimoni commented Mar 29, 2022

@yngwi, yes appwrite_runtimes is correct (the network name is [Prefix]_[name])
@Meldiron, the bug File Not Found not fixed on 0.13.4 without update compose to save builds volume

Bugs Solutions

  • File Not Found: required set volume on docker-compose for /storage/builds:rw and redeploy the functions
  • Message: An internal curl error has occurred within the executor! Error Msg: Connection refused: is it looks like a bug, env _APP_EXECUTOR_RUNTIME_NETWORK don't work and always executor use the default name appwrite_runtimes, just use the same name for this network and the function will run
  • Failed to Warmup ... - on executor startup, it always shows also when executor functions are working well
  • Could not resolve host: appwrite-executor with status code: look like a bug, if someone is change the name of the container, build failed with this error

@matigumma
Copy link
Contributor

@yngwi Can you create a new deployment and try again ? It seems we are unable to reproduce this issue.

I tried just now, same results. Maybe the container wiring is not correct? Following the installation procedure I'm using the networks appwrite and runtimes in the docker-compose.yml, but instead of the preconfigured traefik network, I'm using my own. Apart from that everything is the same. Now, the autogenerated env contains the following line: _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes Is this correct?

i have the same issue...
Build Stage completed in 1 seconds Executing Runtime: 623cb7dd55f6fb306342-6243a100a9eec38aec0f [Error] Type: Exception [Error] Message: An internal curl error has occurred within the executor! Error Msg: Could not resolve host: 623cb7dd55f6fb306342-6243a100a9eec38aec0f [Error] File: /usr/src/code/app/executor.php [Error] Line: 481

in .env:
_APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes Is this correct?

@matigumma
Copy link
Contributor

i share here a copy of my docker-compose.yml
https://gist.github.com/matigumma/39b61488957b0c10e69c0c07e13b3d1b

@yngwi
Copy link

yngwi commented Mar 30, 2022

Hi for me the functions work now, thank you.

@matigumma
Copy link
Contributor

could you share your configuration? im not making this work ...

@talshimoni
Copy link

allright:
docker network ls
NETWORK ID NAME DRIVER SCOPE
2474a4128a20 bridge bridge local
7304c48fb2c9 host host local
73d644e5a189 none null local
e7a483f7ca05 projecto-freewaves-docker_appwrite bridge local
706dfe1e953b projecto-freewaves-docker_backend bridge local
00cbd61e02a2 projecto-freewaves-docker_default bridge local
655fcd33db62 projecto-freewaves-docker_gateway bridge local
2c000b798a8a projecto-freewaves-docker_runtimes bridge local
d98264de5f6d web bridge local

this is the issue, your network change from appwrite_runtimes to projecto-freewaves-docker_runtimes,
you should fix env to the same name, if it is not working, create new network with the name appwrite_runtimes and connect the Appwrite_executor

@matigumma
Copy link
Contributor

thanks
i recreate installation as default and adapt my others containers to it...
the function has been executed but
docker logs appwrite-executor said;

Warming up PHP 8.0 environment...
Warming up Ruby 3.0 environment...
Warming up Python 3.9 environment...
Removing orphan runtimes...
Failed to Warmup Python 3.9!
Failed to Warmup Ruby 3.0!
Failed to Warmup PHP 8.0!
Failed to Warmup Node.js 16.0!
Building container : 6246385b65949a33f428-624644e6306d78a130d5
Build Stage completed in 5 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 423
Building container : 6246385b65949a33f428-624644e6306d78a130d5
Build Stage completed in 1 seconds
Executing Runtime: 6246385b65949a33f428-624644e6306d78a130d5
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 481
Executing Runtime: 6246385b65949a33f428-624644e6306d78a130d5
Function executed in 0.049613952636719 seconds, status: completed```

its allright here?

im on Ubuntu 19.10 (GNU/Linux 5.3.0-64-generic x86_64)

@stnguyen90
Copy link
Contributor

@onceuponacode, were you able to get things working? Can this issue be closed now?

@onceuponacode
Copy link
Author

Yep, you can close it. @stnguyen90

@LeonardoMantovani
Copy link

Hi, I'm still encountering this issue: should I open a new issue, or it's fine to continue here?

I'm using AppWrite 1.0 with the Python 3.9 runtime, and when I try to execute a cloud function I wrote (that works flawlessly if I run it as a local python function on my computer) I get the Internal Runtime Error output on STDERR

I went checking the logs as suggested above and this is what I found:

appwrite-executor  | Warming up Node.js 16.0 environment...
appwrite-executor  | Warming up PHP 8.0 environment...
appwrite-executor  | Warming up Ruby 3.0 environment...
appwrite-executor  | Warming up Python 3.9 environment...
appwrite-executor  | Warming up Dart 2.17 environment...
appwrite-executor  | Removing orphan runtimes...
appwrite-executor  | Successfully Warmed up Python 3.9!
appwrite-executor  | Successfully Warmed up Dart 2.17!
appwrite-executor  | Successfully Warmed up Ruby 3.0!
appwrite-executor  | Successfully Warmed up Node.js 16.0!
appwrite-executor  | Successfully Warmed up PHP 8.0!
appwrite-executor  | Successfully removed presents-632f27980becd2e21abf
appwrite-executor  | Successfully removed presents-632f2bae8c7e3b2ca944
appwrite-executor  | [Error] Type: Exception
appwrite-executor  | [Error] Message: Runtime not found. Please create the runtime.
appwrite-executor  | [Error] File: /usr/src/code/app/executor.php
appwrite-executor  | [Error] Line: 469
appwrite-executor  | Building container : presents-632f2bae8c7e3b2ca944
appwrite-executor  | Build Stage completed in 2 seconds
appwrite-executor  | Executing Runtime: presents-632f2bae8c7e3b2ca944
appwrite-executor  | [Error] Type: Exception
appwrite-executor  | [Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
appwrite-executor  | [Error] File: /usr/src/code/app/executor.php
appwrite-executor  | [Error] Line: 541
appwrite-executor  | [Error] Type: Exception
appwrite-executor  | [Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
appwrite-executor  | [Error] File: /usr/src/code/app/executor.php
appwrite-executor  | [Error] Line: 541
appwrite-executor  | Executing Runtime: presents-632f2bae8c7e3b2ca944
appwrite-executor  | Executing Runtime: presents-632f2bae8c7e3b2ca944
appwrite-executor  | Function executed in 0.022143125534058 seconds, status: failed

This is when I execute the function for the first time, then the next times the log output is just

appwrite-executor  | Executing Runtime: presents-632f2bae8c7e3b2ca944
appwrite-executor  | Function executed in 0.022143125534058 seconds, status: failed

I've read above that it may be something wrong with the appwrite_runtimes network but it seems up and connected to both the appwrite-executor container and the container created for the cloud function, so I have no idea what else should I look for...

any help?

@stnguyen90
Copy link
Contributor

@LeonardoMantovani, please open a GitHub Q&A discussion or join us on Discord.

@LeonardoMantovani
Copy link

Ok done it: here is the discussion I opened on GitHub and I also opened a Thread on Discord functions channel :)

@FuadEfendi
Copy link

Hey,

I have the same kind of error logs when I am trying to execute my Java function; note that I have another trivial Java function example which runs without errors:

An internal curl error has occurred within the executor! Error Msg: Operation timed out
Warming up Node.js 16.0 environment...
Warming up Java 11.0 environment...
Removing orphan runtimes...
Successfully Warmed up Java 11.0!
Successfully Warmed up Node.js 16.0!
Building container : 6345ae7a2c9d0756fcb0-6345b58094da18581307
Build Stage completed in 15 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 469

@FuadEfendi
Copy link

I'd be very happy to join to Discord, but the problem is that it is no searchable by Google; otherwise I'd find an answer already. Documenting it here so that anyone having the same issue with Appwrite + Java can easily find, instead of creating duplicate bug reports:

The issue still exists, Appwrite v.1.0.1,

% docker logs appwrite-executor
Warming up Node.js 16.0 environment...
Warming up Java 11.0 environment...
Warming up Java 17.0 environment...
Removing orphan runtimes...
Successfully removed 6345ae7a2c9d0756fcb0-6345b832f1f60808f55c
Successfully removed 6345ae7a2c9d0756fcb0-6345b58094da18581307
Successfully Warmed up Node.js 16.0!
Successfully Warmed up Java 11.0!
Successfully Warmed up Java 17.0!
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 469
Building container : 6345ae7a2c9d0756fcb0-6345b832f1f60808f55c
Build Stage completed in 1 seconds
Executing Runtime: 6345ae7a2c9d0756fcb0-6345b832f1f60808f55c
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 541
Executing Runtime: 6345ae7a2c9d0756fcb0-6345b832f1f60808f55c
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Connection refused
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 541

@benjamin-carriou
Copy link

benjamin-carriou commented Nov 14, 2022

Same here:

Building container : la-ruee-vers-le-bois-6371d1d254049408f4b5
Build Stage completed in 7 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 469
Building container : la-ruee-vers-le-bois-6371d1d254049408f4b5
Build Stage completed in 1 seconds
Executing Runtime: la-ruee-vers-le-bois-6371d1d254049408f4b5
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Could not resolve host: la-ruee-vers-le-bois-6371d1d254049408f4b5
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 544
Building container : la-ruee-vers-le-bois-6371d75c73ea12839d3a
Build Stage completed in 4 seconds
[Error] Type: Exception
[Error] Message: Runtime not found. Please create the runtime.
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 469
Building container : la-ruee-vers-le-bois-6371d75c73ea12839d3a
Build Stage completed in 1 seconds
Executing Runtime: la-ruee-vers-le-bois-6371d75c73ea12839d3a
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Could not resolve host: la-ruee-vers-le-bois-6371d75c73ea12839d3a
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 544

@andreped
Copy link

Noticed that this issue has been closed, but I'm still having this issue with manual deployment.

I followed the tutorial on how to setup a simple function and deploy it through appwrite, but it fails during execution.

I have setup appwrite through docker on macOS, with the latest version (1.1.2).

@MyWay
Copy link

MyWay commented Dec 16, 2022

Same here.

@BraveDevelopment
Copy link

Noticed that this issue has been closed, but I'm still having this issue with manual deployment.

I followed the tutorial on how to setup a simple function and deploy it through appwrite, but it fails during execution.

I have setup appwrite through docker on macOS, with the latest version (1.1.2).

Same here.

@memetrusidovski
Copy link

having the same issue as the users above

@stnguyen90
Copy link
Contributor

For anyone still having problems, please join us on Discord to troubleshoot since each problem needs to be addressed on a case-by-case basis.

@Kvark1205
Copy link

For anyone who have this kind error as TC:

An internal curl error has occurred within the executor! Error Msg: Could not resolve host: 622bb6f3725e4422610e-622d226c1a20e10fc330

In docker-compose.yml declared networks doesn't have specific names and when you up your containers from docker-compose it creates networks with template as "directory-name-of-compose-location"_"network-in-compose-file".

So, in .env described network is hardcoded as _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes which only work if your docker-compose.yml file located in appwrite directory.

To avoid that do the next:

  1. Define specific network names in docker-compose.yml like this (be aware that they must be unique because of docker-host scope):
...
networks:
  gateway:
    name: gateway
  appwrite:
    name: appwrite
  runtimes:
    name: runtimes
...
  1. Change .env and set your correct defined networks:
...
_APP_EXECUTOR_RUNTIME_NETWORK=runtimes
OPEN_RUNTIMES_NETWORK=runtimes
...
  1. Recreate containers for applying changes:
docker-compose up -d
  1. Try to execute function from UI and after function execution you can find newly created container with name as "project_id"-"deployment_id". Check with docker inspect "container name" that in Networks section there is a network with your defined name.

@hemangjoshi37a
Copy link

Has anyone solved this yet? I am still facing same issue with python function. Also there is no clear documenttaion or youtube video about this. may ber the code is broker in appwrite.

@garvitomer
Copy link

I am also facing the same issue since few months now. How to solve this error, it is such a critical bug? Can someone please help

@frenchmustard
Copy link

For anyone who have this kind error as TC:

An internal curl error has occurred within the executor! Error Msg: Could not resolve host: 622bb6f3725e4422610e-622d226c1a20e10fc330

In docker-compose.yml declared networks doesn't have specific names and when you up your containers from docker-compose it creates networks with template as "directory-name-of-compose-location"_"network-in-compose-file".

So, in .env described network is hardcoded as _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes which only work if your docker-compose.yml file located in appwrite directory.

To avoid that do the next:

  1. Define specific network names in docker-compose.yml like this (be aware that they must be unique because of docker-host scope):
...
networks:
  gateway:
    name: gateway
  appwrite:
    name: appwrite
  runtimes:
    name: runtimes
...
  1. Change .env and set your correct defined networks:
...
_APP_EXECUTOR_RUNTIME_NETWORK=runtimes
OPEN_RUNTIMES_NETWORK=runtimes
...
  1. Recreate containers for applying changes:
docker-compose up -d
  1. Try to execute function from UI and after function execution you can find newly created container with name as "project_id"-"deployment_id". Check with docker inspect "container name" that in Networks section there is a network with your defined name.

Tried this but doesn't solve it for me.

Running AppWrite on DigitalOcean as a Droplet through the marketplace, didn't touch anytime except upload my code as .tar (followed the docs) but same error as the rest here. Sad because the rest looks really sleek.

@kecsot
Copy link

kecsot commented Apr 21, 2023

Same. (1.3.1)

We found a solution for our case, hope works for you
appwrite functions createDeployment --functionId=YOUR_FID --entrypoint='src/index.php' --code="functions/Functionname" --activate=true

Previously we got Internal Runtime error. When we just copied

appwrite functions createDeployment \ 
    --functionId=644101c535550ab4ce99 \ 
    --entrypoint='index.php' \ 
    --code="." \ 
    --activate=true

@garvitomer
Copy link

I use this in CLI and it didn't work. I basically restart docker every day to minimize the error. No other solution yet 😞
"$id": "......", "name": "orderMatchingAlgorithmFunction4", "runtime": "dart-2.17", "path": "functions/orderMatchingAlgorithmFunction4", "entrypoint": "lib/main.dart", "ignore": [".packages", ".dart_tool"], "execute": ["role:member"], "events": [], "schedule": "", "timeout": 15

@koyapo
Copy link

koyapo commented Apr 24, 2023

still not working here too its pretty annoying ... im doing like u restarting server every days

@koyapo
Copy link

koyapo commented Apr 25, 2023

@garvitomer do you use return when the response has to be sent in this way ? return res.json({
'message': "hello",
});

@stnguyen90 doing this :
return res.json({
'message': "hello",
});

instead of :
res.json({
'message': "hello",
});
can have some side effect ?

@Alex-Fenner
Copy link

I have run in to this issue working in an environment with no internet connectivity, and have got a workaround by removing the node-appwrite dependency and making all calls through the REST API. I assume that connectivity to internet is required to use the node-appwrite package? (I appreciate that this is a bit of an edge use case and ignores the issue)

@t0mm4rx
Copy link

t0mm4rx commented Aug 22, 2023

I think this issue should be re-open as it could stilll happen during the 1.3.7 -> 1.3.8 migration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests