Back

[STANDBY] executor log Error but function works

  • 0
  • Self Hosted
  • Functions
Bouahaza
6 Jun, 2023, 15:50

In all cases, the functions are launched correctly, despite the errors.

TL;DR
The user is experiencing an error in the executor log, but the function itself is working fine. They suspect that the issue might be due to the runtime container not being ready. They tried using a blank function but still encountered the same behavior. There is a suggestion to catch the kill signal and gracefully stop the execution. The user wonders if these errors can be ignored, but it's unclear if they should be taken seriously. Force recreating the Docker compose brings back the error. Locally, the error has disappeared, and the function is executing correctly. There is confusion about the meaning of the "Connection refused" error. The user tried a
Drake
6 Jun, 2023, 15:52

only 1 runtime container is created

Bouahaza
6 Jun, 2023, 15:52

I try with fresh install of appwrite 1.3.4/6/7, only upload fonction, same things

Drake
6 Jun, 2023, 15:52

what error?

Bouahaza
6 Jun, 2023, 15:53

Connection refused

Drake
6 Jun, 2023, 15:55

on every execution?

Bouahaza
6 Jun, 2023, 15:59

Hard to say, locally now error is gone

TypeScript
appwrite-worker-functions     | Fetched 1 functions...
appwrite-worker-functions     | Iterating function: Database to Redis
appwrite-executor             | Executing Runtime: production-64799a2654cc3fc38bba
appwrite-executor             | Function executed in 0.010145902633667 seconds, status: completed
appwrite-worker-functions     | Triggered function: databases.dID.collections.cID.documents.647aed18a9ce5746bffa.update
Bouahaza
6 Jun, 2023, 16:01

If I force docker compose -f docker-compose-appwrite.yml up -d --force-recreate error returns

TypeScript
appwrite-executor             | Build Stage completed in 1 seconds
appwrite-executor             | Executing Runtime: production-64799a2654cc3fc38bba
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: production-64799a2654cc3fc38bba
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: production-64799a2654cc3fc38bba
appwrite-executor             | Function executed in 1.1776671409607 seconds, status: completed
appwrite-worker-functions     | Triggered function: databases.dID.collections.cID.documents.647aed18a9ce5746bffa.update
Bouahaza
6 Jun, 2023, 16:02

But I can see document updated on redis

Drake
6 Jun, 2023, 16:06

perhaps the runtime containers are trying to exit so they aren't accepting new requests

Bouahaza
6 Jun, 2023, 16:08

Maybe... Do you think these errors aren't serious and can be ignored?

Drake
6 Jun, 2023, 16:09

up to you. i'd look into somehow cleanly exiting

Bouahaza
6 Jun, 2023, 16:11

What could cause this exit? Because the runtime works, since it sends to redis 100% of the time.

Drake
6 Jun, 2023, 16:21

Your force re create stops the executor which then tries to stop the runtime containers it's managing

Bouahaza
6 Jun, 2023, 16:49

From that you mean ? I wait for executor up before test it

Drake
6 Jun, 2023, 16:53

maybe in your code somehow catch the kill signall and then stopping execution?

Bouahaza
6 Jun, 2023, 16:56

All the code is encapsulated in a try/catch

Bouahaza
6 Jun, 2023, 16:57

Catch only set isError=err.message

Drake
6 Jun, 2023, 17:04
Bouahaza
6 Jun, 2023, 17:08

I try with a blank function

TypeScript
module.exports = async function (req, res) {
  res.json({
    areDevelopersAwesome: true,
  });
};

And have same behavior

TypeScript
appwrite-worker-functions     | Fetched 1 functions...
appwrite-worker-functions     | Iterating function: My Awesome Function
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 : production-647f670dba63ab3232e0
appwrite-executor             | Build Stage completed in 0 seconds
appwrite-executor             | Executing Runtime: production-647f670dba63ab3232e0
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
Drake
6 Jun, 2023, 17:19

oh...perhaps the runtime container isn't actually ready yet before it's trying to be executed?

Bouahaza
6 Jun, 2023, 17:23

I can see {areDevelopersAwesome: true} on Console > Functions > Executions > Logs Or executor auto retry perhaps ?

Drake
6 Jun, 2023, 17:25

it could be a tiny window where the runtime container is created, but the web server isn't actually up and ready yet

Bouahaza
6 Jun, 2023, 17:30

Everyone should reproduce in this case ? Let's just say it's a normal error...

Bouahaza
6 Jun, 2023, 17:31

[STANDBY] executor log Error but function works

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