Back

500 internal function error after upgrading from 1.4.13 to 1.5.1

  • 0
  • Self Hosted
  • Functions
Tawfek
9 Mar, 2024, 08:07

Some details: Appwrite: Self-hosted. Upgraded from 1.4.13 to 1.5.0 to 1.5.1. Function: Python (Tried 3.10, 3.11, and 3.12) Was working fine before upgrading.

Error:

Traceback (most recent call last): File "/usr/local/server/src/server.py", line 163, in action output = await asyncio.wait_for(execute(context), timeout=safeTimeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 510, in wait_for return await fut ^^^^^^^^^ File "/usr/local/server/src/server.py", line 148, in execute userModule = importlib.import_module("function." + userPath) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1381, in _gcd_import File "<frozen importlib._bootstrap>", line 1354, in _find_and_load File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 929, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 994, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/usr/local/server/src/function/src/main.py", line 2, in <module> from appwrite.client import Client File "/usr/local/server/src/function/runtime-env/lib/python3.12/site-packages/appwrite/client.py", line 7, in <module> from .encoders.value_class_encoder import ValueClassEncoder ModuleNotFoundError: No module named 'appwrite.encoders'

TL;DR
Developers face 500 internal server error after upgrading from 1.4.13 to 1.5.1 in a self-hosted Appwrite environment. The Python function was working fine prior to the upgrade but fails to find the 'appwrite.encoders' module post-upgrade. **Solution:** Check the Python function code for the correct import path for 'appwrite.encoders'. Update the import statement to point to the correct module location post-upgrade from 1.4.13 to 1.5.1.
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