First of all there's no error in my function codes ,it was working fine on the previous appwrite version , this issue happened when i update appwrite last night: Whenever i create a deployment within CLI its just failed to build after 15-22 seconds, (I also tried the starter appwrite fucntion code.) Hopefully someone could help.
Did you check the logs of your appwrite-executor docker instance? That usually seem to give some information when a build fails or times out.
kind of , but its not clear to me:
2023-02-22 16:22:19 Docker Error: Killed
2023-02-22 16:22:19 Resolving dependencies...
2023-02-22 16:22:19 + collection 1.17.0 (1.17.1 available)
2023-02-22 16:22:19 + matcher 0.12.12 (0.12.14 available)
2023-02-22 16:22:19 + meta 1.9.0
2023-02-22 16:22:19 + path 1.8.3
2023-02-22 16:22:19 + pub_semver 2.1.3
2023-02-22 16:22:19 + pubspec 2.3.0
2023-02-22 16:22:19 + quiver 3.2.1
2023-02-22 16:22:19 + source_span 1.9.1
2023-02-22 16:22:19 + stack_trace 1.10.0 (1.11.0 available)
2023-02-22 16:22:19 + string_scanner 1.1.1 (1.2.0 available)
2023-02-22 16:22:19 + term_glyph 1.2.1
2023-02-22 16:22:19 + uri 1.0.0
2023-02-22 16:22:19 + yaml 3.1.1
2023-02-22 16:22:19 Downloading pubspec 2.3.0...
2023-02-22 16:22:19 Downloading uri 1.0.0...
2023-02-22 16:22:19 Downloading yaml 3.1.1...
2023-02-22 16:22:19 Downloading string_scanner 1.1.1...
2023-02-22 16:22:19 Downloading path 1.8.3...
2023-02-22 16:22:19 Downloading collection 1.17.0...
2023-02-22 16:22:19 Downloading pub_semver 2.1.3...
2023-02-22 16:22:19 Downloading quiver 3.2.1...
2023-02-22 16:22:19 Downloading matcher 0.12.12...
2023-02-22 16:22:19 Downloading stack_trace 1.10.0...
2023-02-22 16:22:19 Downloading source_span 1.9.1...
2023-02-22 16:22:19 Downloading term_glyph 1.2.1...
2023-02-22 16:22:19 Downloading meta 1.9.0...
2023-02-22 16:22:19 Changed 13 dependencies!
Which environment are you using?
dart?
It seems like your docker instance is being killed. Probably running out of memory, did you set functions memory limit using the _APP_FUNCTIONS_MEMORY
env variable? or maybe try providing some swap memory
No, it's all set to the default value. haven't mess with them at all.
Are you using a vps? is there enough ram for appwrite and functions?
Im running it locally, i have 8g ram ,docker used 3.5 i think so there's no lack of memory
You might want to increase the following environment variables:
_APP_FUNCTIONS_MEMORY
_APP_FUNCTIONS_MEMORY_SWAP
See https://appwrite.io/docs/environment-variables#functions for more info
Hmm i see but im confused, in the documentation it said:
The default value is empty. When it's empty, memory limit will be disabled.
Why i need to increase them. Besides in my .env their values are 0.
What's the output of:
docker compose exec appwrite vars | grep MEMORY
command not recognized.
docker compose version
doesn't work for you?
docker compose version
it worked
where are you running this? are you on a unix server? what exactly is your error?
This one worked
docker compose exec appwrite vars
Output:
- _APP_STORAGE_WASABI_REGION=eu-central-1
- _APP_STORAGE_WASABI_BUCKET=
- _APP_FUNCTIONS_SIZE_LIMIT=30000000
- _APP_FUNCTIONS_TIMEOUT=900
- _APP_FUNCTIONS_BUILD_TIMEOUT=900
- _APP_FUNCTIONS_CONTAINERS=10
- _APP_FUNCTIONS_CPUS=1
- _APP_FUNCTIONS_MEMORY=128
- _APP_FUNCTIONS_MEMORY_SWAP=128
- _APP_FUNCTIONS_RUNTIMES=dart-2.17
- _APP_EXECUTOR_SECRET=your-secret-key
- _APP_EXECUTOR_HOST=http://appwrite-executor/v1
- _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes
- _APP_FUNCTIONS_ENVS=
- _APP_FUNCTIONS_INACTIVE_THRESHOLD=
- DOCKERHUB_PULL_USERNAME=
- DOCKERHUB_PULL_PASSWORD=
- DOCKERHUB_PULL_EMAIL=
- OPEN_RUNTIMES_NETWORK=
- _APP_MAINTENANCE_INTERVAL=86400
- _APP_MAINTENANCE_RETENTION_CACHE=2592000
- _APP_MAINTENANCE_RETENTION_EXECUTION=1209600
- _APP_MAINTENANCE_RETENTION_AUDIT=1209600
- _APP_MAINTENANCE_RETENTION_ABUSE=86400
- _APP_MAINTENANCE_RETENTION_USAGE_HOURLY=8640000
- _APP_GRAPHQL_MAX_BATCH_SIZE=10
- _APP_GRAPHQL_MAX_COMPLEXITY=250
- _APP_GRAPHQL_MAX_DEPTH=
so as you can see, you have memory set to:
- _APP_FUNCTIONS_MEMORY=128
- _APP_FUNCTIONS_MEMORY_SWAP=128
The docker image itself has the values set to 128. You can try setting it to 0 in your .env file or some bigger value
Why they are different? in .env _APP_FUNCTIONS_MEMORY=0 _APP_FUNCTIONS_MEMORY_SWAP=0
is it listed in the environment section of the appwrite
container? If it is, maybe you changed it, but never recreated the containers
Uhh i see,
[SOLVED] Cloud Function - Deployment failed
Recommended threads
- HTTP POST to function returning "No Appw...
Hi everyone, I’m running into an issue with my self-hosted Appwrite instance. I’ve set up my environment variables (APPWRITE_FUNCTION_PROJECT_ID, APPWRITE_FUNC...
- Can't add dart 3.5 runtime
Modified the `.env` to enable dart 3.5 runtime on my self-hosted instance but still can't find the runtime when creating a new function. I manually pulled the i...
- How to verify an user using AppWrite Fun...
I have seen similar questions but none whose solutions serve me. I have a function to verify a user with their secret and their id: https://blahblah.appwrite.gl...