Back

Recently created Appwrite Functions always failed

  • 0
  • Self Hosted
  • Functions
Alana
7 Dec, 2023, 13:51

An internal curl error has occurred within the executor! Error Msg: Operation timed out My code:

TypeScript
def main(req, res):
    return res.send("Hello World")

I'm running Appwrite 1.2.1

TL;DR
Recently created Appwrite Functions are consistently failing. The issue was identified as an incompatibility between Flask 2.0.1 and Werkzeug 3.0.1. To resolve this, the user had to include `Werkzeug==2.3.8` in the requirements.txt file. Additionally, a log from a container with the same name as the deployment ID showed an ImportError when trying to import 'url_quote' from 'werkzeug.urls'. The error message also mentioned that the runtime was not found and there was an internal curl error with a connection refused or operation timed out. The user is currently using Appwrite
Drake
7 Dec, 2023, 20:35

What do the docker logs for the executor say?

Alana
7 Dec, 2023, 20:53
TypeScript
Building container : 65196a7a4ab351c8b23e-6571cbbc0b008bd19a81
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
Building container : 65196a7a4ab351c8b23e-6571cbbc0b008bd19a81
Build Stage completed in 1 seconds
[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: 65196a7a4ab351c8b23e-6571cbbc0b008bd19a81
Executing Runtime: 65196a7a4ab351c8b23e-6571cbbc0b008bd19a81
[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: 65196a7a4ab351c8b23e-6571cbbc0b008bd19a81
[Error] Type: Exception
[Error] Message: An internal curl error has occurred within the executor! Error Msg: Operation timed out
[Error] File: /usr/src/code/app/executor.php
[Error] Line: 544
Running maintenance task ...
Successfully removed 65196a7a4ab351c8b23e-6571cbbc0b008bd19a81
Alana
8 Dec, 2023, 09:08

also, I found this log from a container with the same name as the deployment ID

TypeScript
Traceback (most recent call last):
  File "/usr/local/src/server.py", line 1, in <module>
    from flask import Flask, request, jsonify
  File "/usr/local/src/userlib/runtime-env/lib/python3.10/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/usr/local/src/userlib/runtime-env/lib/python3.10/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/usr/local/src/userlib/runtime-env/lib/python3.10/site-packages/flask/cli.py", line 18, in <module>
    from .helpers import get_debug_flag
  File "/usr/local/src/userlib/runtime-env/lib/python3.10/site-packages/flask/helpers.py", line 16, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/src/userlib/runtime-env/lib/python3.10/site-packages/werkzeug/urls.py)
Alana
8 Dec, 2023, 10:12

okay I found the problem

Alana
8 Dec, 2023, 10:14

so Flask 2.0.1 apparently isn't compatible with Werkzeug 3.0.1 I had to put Werkzeug==2.3.8 in the requirements.txt to override the one installed in the build

Alana
8 Dec, 2023, 10:21

I can say it's solved, but I need to use this workaround until I upgrade to the latest Appwrite.

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