I'm working on a custom function in Appwrite, but I'm facing an issue where some environment variables are not passing through correctly.
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.
Please check the end of the log below to see the missing variable I'm referring to.
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
Recommended threads
- How should I handle my errors?
I followed the following guide to setup a simple project with authentication: https://appwrite.io/docs/tutorials/nextjs-ssr-auth/step-1 And Kenny gave me the mi...
- Clarity on Appwrite Messging
When using Appwrite messaging with FCM, do I need to include the user's firebaseToken in the createTarget object? If I omit the firebaseToken, will Appwrite sti...
- functions cors error
async function getData() { const url = "https://6798f32eae97aea2944b.appwrite.global/"; try { const response = await fetch(url); if (!response.ok) {...