appwrite: πŸ› Bug Report: Functions not being executed

πŸ‘Ÿ 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?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 3
  • Comments: 56 (18 by maintainers)

Most upvoted comments

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

Same here.

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

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.

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.

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.

having the same issue as the users above

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).

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

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

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

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)

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.