I'm working on a custom function in Appwrite, but I'm facing an issue where some environment variables are not passing through correctly.
Mising Variables: APPWRITE_FUNCTION_EVENT: undefined APPWRITE_FUNCTION_EVENT_DATA: undefined Parsed Event Data: {} Database ID: undefined Collection ID: undefined Document ID: undefined
This occurs whether I trigger the function manually or through a client using: databases . * . collections . * . documents . * . create
What I’ve Tried: Checked that all environment variables are correctly defined in the function settings. Verified that they are accessible within other parts of the Appwrite project. Manually triggered the function to see if the issue persists outside of client-side triggers. Examined logs for any errors or missing data. Observations: Some environment variables are available, but others are missing or undefined. This issue occurs regardless of the trigger method. The function is running in Node.js 22.9.0, and I’m using Appwrite 1.6.1.
Attached is the log file and my script. Any help is much appreciated!
Native logs detected. Use context.log() or context.error() for better experience. Starting audio analysis trigger function... All Environment Variables: APPWRITE_API_KEY: [DEFINED-ANONYMIZED] APPWRITE_VCS_ROOT_DIRECTORY: APPWRITE_VCS_REPOSITORY_ID: 922324856 APPWRITE_FUNCTION_RUNTIME_NAME: Node.js NODE_VERSION: 22.9.0 HOSTNAME: b658da0aaa4c28060e1cfe4992945025 APPWRITE_VERSION: 1.6.1 YARN_VERSION: 1.22.22 APPWRITE_VCS_REPOSITORY_BRANCH_URL: [DEFINED-ANONYMIZED] APPWRITE_VCS_COMMIT_HASH: af7d242a2276fe21293d7afdffe29ff5354e91e1 SHLVL: 5 APPWRITE_AUDIO_COLLECTION_ID: 679286ca00381c6ed109 HOME: /root OLDPWD: /usr/local/server APPWRITE_FUNCTION_CPUS: 1 APPWRITE_VCS_COMMIT_AUTHOR_URL: [DEFINED-ANONYMIZED] OPEN_RUNTIMES_ENV: production APPWRITE_FUNCTION_MEMORY: 512 OPEN_RUNTIMES_HEADERS: {} CYANITE_API_KEY: [DEFINED-ANONYMIZED] OPEN_RUNTIMES_CPUS: 1 APPWRITE_DEPLOYMENT_TYPE: vcs OPEN_RUNTIMES_MEMORY: 512 APPWRITE_VCS_REPOSITORY_BRANCH: main APPWRITE_VCS_COMMIT_AUTHOR_NAME: [DEFINED-ANONYMIZED] APPWRITE_DB_ID: 679286550029ad300dcd PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin APPWRITE_VCS_REPOSITORY_OWNER: [DEFINED-ANONYMIZED] APPWRITE_FUNCTION_NAME: Cyanite_api_request APPWRITE_REGION: fra APPWRITE_ENDPOINT: [DEFINED-ANONYMIZED] APPWRITE_VCS_REPOSITORY_URL: [DEFINED-ANONYMIZED] INERNAL_EXECUTOR_HOSTNAME: exc1 OPEN_RUNTIMES_ENTRYPOINT: src/main.js APPWRITE_FUNCTION_RUNTIME_VERSION: 22 APPWRITE_FUNCTION_ID: 6795663c00271b1663c3 APPWRITE_FUNCTION_API_ENDPOINT: [DEFINED-ANONYMIZED] APPWRITE_VCS_REPOSITORY_NAME: Cyanite_api_request PWD: /usr/local/server APPWRITE_VCS_COMMIT_URL: [DEFINED-ANONYMIZED] OPEN_RUNTIMES_HOSTNAME: exc1 APPWRITE_FUNCTION_DEPLOYMENT: 679767b345af6f175f01 APPWRITE_VCS_COMMIT_MESSAGE: debug main
APPWRITE_FUNCTION_PROJECT_ID: 679283e8000cb489b808 OPEN_RUNTIMES_SECRET: [DEFINED-ANONYMIZED] CYANITE_WEBHOOK_SECRET: [DEFINED-ANONYMIZED] APPWRITE_FUNCTION_EVENT: undefined APPWRITE_FUNCTION_EVENT_DATA: undefined Parsed Event Data: {} Database ID: undefined Collection ID: undefined Document ID: undefined Missing event data; no document created.
The main.js file
Updated version
Recommended threads
- Random function timeouts
Sometimes my function runs without issue and I can see my logs in the Logs tab on cloud.appwrite.io. Other times, the function fails with a 500 status code, the...
- [SOLVED] Get Relations when using Tables...
Hi there, I have a table containing a relation column with a one-to-many relationship to another table. When Using TablesDB.GetRow in "node-appwrite" i get all ...
- Appwrite loading issue with Nuxt UI
For some reason when I add nuxt ui to my nuxt 4 project, appwrite will build the project but the project website will load indefinitely. Without adding Nuxt UI,...