Skip to content
Back

[SOLVED] Cannot deploy functions from the CLI on dart environment

  • 0
  • Self Hosted
  • Functions
  • Tools
Olivier Pavie
9 Mar, 2023, 16:38

I am currently on Appwrite 1.2.0 the cli version is 1.2.1 The dart sdk is 2.17.0

When i create a function ( a fresh one, not change at all ), the build fails, here is the log (attached)

TL;DR
Issue: Cannot deploy functions from the CLI on dart environment Solution: Set environment variables `_APP_FUNCTIONS_MEMORY` and `_APP_FUNCTIONS_MEMORY_SWAP` to a higher value, such as 2048MB. Make sure to upgrade to the latest version of Appwrite if running on GitPod. Check the log file for more information on the build failure.
joeyouss
9 Mar, 2023, 16:42

Hi, let me have a look

Olivier Pavie
9 Mar, 2023, 18:56

Ok ok no pb

Olivier Pavie
10 Mar, 2023, 05:47

hi, any updates?

joeyouss
10 Mar, 2023, 10:28

Apologies for being late regarding this, are you running docker on windows? also can you please make sure that Appwrite is in its latest version?

Olivier Pavie
10 Mar, 2023, 13:48

i don't think it is a windows machine... It is an image from GitPod, Appwrite is not at the latest version I will try upgrading and see

joeyouss
10 Mar, 2023, 17:19

AOT compilation failed error might hint that the memory dedicated to the function is not enough. Can you go to your environment variables and set _APP_FUNCTIONS_MEMORY and _APP_FUNCTIONS_MEMORY_SWAP to a number you want? please not the values are in MB so maybe try assigning 2048 MB? by default they are set to 0. If this does not work, let me know because then it might not be a memory issue

Olivier Pavie
10 Mar, 2023, 17:52

ok. ok let me do this now

Olivier Pavie
10 Mar, 2023, 17:58

The current values were _APP_FUNCTIONS_MEMORY=256 _APP_FUNCTIONS_MEMORY_SWAP=256 Changed to 2048... Worked like a charm πŸ™‚

but isn't 2048MB a lil too much πŸ˜… [edit] Changed the values to 850... it has been building for the last 20min ......

Olivier Pavie
10 Mar, 2023, 18:13

I think that giving a value of 2048 might be too much ? Running on NodeJs works with 256.. Do you think it is better to keep it at 256 and use node instead ?

Drake
10 Mar, 2023, 18:58

you could try 1024 to see if it works. dart has to compile to binary so it takes a bit more memory to build, but, when it runs, it's faster than node

Olivier Pavie
10 Mar, 2023, 18:58

ok ok

Olivier Pavie
10 Mar, 2023, 18:58

will do that now

Olivier Pavie
10 Mar, 2023, 19:14

Yes build time was 15seconds with 1024 I guess it is cool then πŸ™‚

Olivier Pavie
11 Mar, 2023, 10:48

[SOLVED] Cannot deploy functions from the CLI on dart environment

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