Back

Problem when loading a function in manual mode

  • 0
  • Functions
CrazyAlarmClock
3 Apr, 2023, 11:51

Docker Error: mv: cannot stat '/usr/code/lib/main.dart': No such file or directory I get this error when I try to load a function. use of CLI is not yet possible. I create an archive via gtar -zcvf code.tar.gz project_name. lib/main.dart - project structure

TL;DR
The user is experiencing a problem when loading a function in manual mode. They suspect that the function is timing out when doing 'pub get' due to no internet access on the server where Appwrite is installed. Another user suggests using the Appwrite CLI or a specific template for deploying functions. Another user suggests tarring the code inside the function folder before deploying. The user tries both methods but still encounters a timeout error. They share the Docker error they receive when trying to load the function. They also mention the project structure. No solution is provided in the thread.
joeyouss
3 Apr, 2023, 11:54

Hi, do you have the code saved somewhere? if so, can you share so I can take a look?

CrazyAlarmClock
3 Apr, 2023, 11:58

for example

joeyouss
3 Apr, 2023, 19:55

Thanks for sharing @CrazyAlarmClock , I will have a review and let you know

CrazyAlarmClock
4 Apr, 2023, 10:43

@joeyouss hi, I deployed the appwrite cli locally, and loaded the function through it. but I get this: Operation timed out after 900000 milliseconds with 0 bytes received with status code 0

Meldiron
4 Apr, 2023, 12:18

Hey there 👋 Tarring needs to happen relative to the content of your folder, not outside of it. Solution is really simple. Before running the command, make sure to be inside your function folder. Then run:

TypeScript
tar --exclude code.tar.gz -czf code.tar.gz .

This will create code.tar.gz file inside your function folder, which should work with manual deployment.

Meldiron
4 Apr, 2023, 12:19

From theory it should also be possible to do from outside when proper -C parameter is provided, buuut the command I sent is battle-tested and I can guarantee it works 😅

CrazyAlarmClock
5 Apr, 2023, 09:17

Hello! tried this method, also getting timeout while building the function

Meldiron
5 Apr, 2023, 09:19

Can you please share with me the new code.tar.gz? 🙏

CrazyAlarmClock
5 Apr, 2023, 09:47

@Meldiron

Meldiron
5 Apr, 2023, 09:52

Looks good. What did you set as value of entrypoint when making deployment?

Meldiron
5 Apr, 2023, 09:53

Also, do build logs tell anything more than timeout error? After how long does the timeout error happen?

CrazyAlarmClock
5 Apr, 2023, 10:24

lib/main.dart Indicates only a timeout error. The error is constant, I can not load functions. Tried dart-2.16 and dart-2.17/ Runtime set for dart

joeyouss
5 Apr, 2023, 15:20

Hi @CrazyAlarmClock

joeyouss
5 Apr, 2023, 15:20

can you use our r template for function as source code, to see if that resolves it https://appwrite.io/docs/functions#writingYourOwnFunction

If not, let's see if using Appwrite CLI as a way to deploy a function works for you: https://appwrite.io/docs/command-line https://appwrite.io/docs/functions#gettingStarted

CrazyAlarmClock
5 Apr, 2023, 15:22

Hi! On the server where appwrite is installed, there is no Internet access. There is a suspicion that when the function does pub get - it falls into a timeout

joeyouss
5 Apr, 2023, 16:06

could be possible

CrazyAlarmClock
6 Apr, 2023, 09:47

@Meldiron @joeyouss I figured out the problem. The function during the build did pub get and fell into a timeout. Is it possible in the function build to call pub get --offile rather than pub get?

Drake
6 Apr, 2023, 16:09

right now, probably not...maybe down the line.

for now, maybe you can tweak your pubspec.yaml with overrides or something to prevent going externally:

https://dart.dev/tools/pub/dependencies#dependency-overrides

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