Back

Swift Functions Deployment Fail (10m Timeout?)

  • 0
  • Self Hosted
  • Functions
  • Apple
SonOfBoo
26 Dec, 2023, 22:17

I'm using Swift swift-5.8 runtime for Functions. When I run docker locally on my mac, I'm able to successfully compile, and deploy/execute my Swift Functions API.

However, every time that I deploy on Digital Ocean (using the same .env file), the functions stop building at exactly 10 minutes with no crash log. Just regular logs where compilation is unfinished:

TypeScript
[793/949] Compiling bn-586.windows.x86.S
[794/949] Compiling bn-586.linux.x86.S
[795/949] Compiling armv8-mont.linux.aarch64.S
[796/949] Compiling armv8-mont.ios.aarch64.S
[797/949] Compiling armv4-mont.linux.arm.S
[798/949] Compiling armv4-mont.ios.arm.S
[799/949] Compiling aesv8-gcm-armv8.linux.aarch64.S
[800/949] Compiling aesv8-gcm-armv8.ios.aarch64.S
[801/949] Compiling aesv8-armx64.linux.aarch64.S
[802/949] Compiling aesv8-armx64.ios.aarch64.S
[803/949] Compiling aesv8-armx32.linux.arm.S
[804/949] Compiling aesv8-armx32.ios.arm.S
[805/949] Compiling aesni-x86_64.mac.x86_64.S
[806/949] Compiling aesni-x86_64.linux.x86_64.S
[807/949] Compiling aesni-x86.windows.x86.S
[808/949] Compiling aesni-x86.linux.x86.S
[809/949] Compiling aesni-gcm-x86_64.mac.x86_64.S
[810/949] Compiling aesni-gcm-x86_64.linux.x86_64.S
```

I've tried updating my _APP_FUNCTIONS_BUILD_TIMEOUT in .env to be a high value, but the functions still timeout during deploy.

_APP_FUNCTIONS_SIZE_LIMIT=30000000 _APP_FUNCTIONS_TIMEOUT=1800 _APP_FUNCTIONS_BUILD_TIMEOUT=100000 _APP_FUNCTIONS_CONTAINERS=10 _APP_FUNCTIONS_CPUS=0 _APP_FUNCTIONS_MEMORY=2048 _APP_FUNCTIONS_MEMORY_SWAP=2048 _APP_FUNCTIONS_RUNTIMES=swift-5.8 _APP_EXECUTOR_HOST=http://appwrite-executor/v1 _APP_EXECUTOR_RUNTIME_NETWORK=appwrite_runtimes _APP_FUNCTIONS_ENVS=swift-5.8 _APP_FUNCTIONS_INACTIVE_THRESHOLD=60

TypeScript

I used the one click setup for digital ocean.
TL;DR
User is experiencing build timeouts when deploying Swift functions on Digital Ocean. They have tried using the CLI and deleting code to improve the situation, but the timeouts persist. Another user suggests that it could be an issue with the function code or deployment method. The user provides logs and suggests checking the logs for the openruntimes-executor and appwrite-worker-functions. Another user suggests checking the Appwrite version. Solution: There is no solution provided in the support thread.
D5
26 Dec, 2023, 22:36

What are the logs for the openruntimes-executor and appwrite-worker-functions?

D5
26 Dec, 2023, 22:36

You can get them with those commands: docker compose logs openruntimes-execuror And docker compose logs appwrite-worker-functions

SonOfBoo
26 Dec, 2023, 22:43
TypeScript
# docker compose logs openruntimes-execuror
no such service: openruntimes-execuror
TypeScript
# docker compose logs appwrite-worker-functions
appwrite-worker-functions  | [Worker] Worker 0 is ready!
appwrite-worker-functions  | Worker functions  started
appwrite-worker-functions  | [Job] Received Job (658b55366a4530.47515950).
appwrite-worker-functions  | Fetched 1 functions...
appwrite-worker-functions  | [Job] (658b55366a4530.47515950) successfully run.
appwrite-worker-functions  | [Job] Received Job (658b553683a4a0.52328783).
appwrite-worker-functions  | Fetched 1 functions...
appwrite-worker-functions  | [Job] (658b553683a4a0.52328783) successfully run.
appwrite-worker-functions  | [Job] Received Job (658b565da55d70.13691850).
appwrite-worker-functions  | [Job] (658b565da55d70.13691850) successfully run.
D5
26 Dec, 2023, 22:45

What's your Appwrite version?

D5
26 Dec, 2023, 22:45

Oh, sorry

SonOfBoo
26 Dec, 2023, 22:45

1.4.13

D5
26 Dec, 2023, 22:45

I had put execuror instead of executor . My bad 😆

D5
26 Dec, 2023, 22:46

Run: docker compose logs openruntimes-executor

SonOfBoo
26 Dec, 2023, 22:46
TypeScript
openruntimes-executor  | [574/949] Compiling x509_txt.c
openruntimes-executor  | [575/949] Compiling x509_trs.c
openruntimes-executor  | [576/949] Compiling x509_set.c
openruntimes-executor  | [577/949] Compiling x509_req.c
openruntimes-executor  | [578/949] Compiling x509_obj.c
openruntimes-executor  | [579/949] Compiling x509_lu.c
openruntimes-executor  | [580/949] Compiling x509_ext.c
openruntimes-executor  | 
openruntimes-executor  | [Error] File: /usr/local/app/http.php
openruntimes-executor  | [Error] Line: 611
D5
26 Dec, 2023, 22:47

Okay, that probably means something Is wrong with your function code

D5
26 Dec, 2023, 22:47

What does the function code contain?

SonOfBoo
26 Dec, 2023, 22:50

It's a fairly simple Swift package with an appwrite/sdk-for-swift (4.1.0) dependency. I can try removing code to see if that helps. If this is an issue with the function code, It would be nice if It had a debug message displayed.

SonOfBoo
26 Dec, 2023, 22:51

When I setup appwrite docker containers on my mac it works fine, but when I'm using digital ocean it just pauses around this point.

D5
26 Dec, 2023, 22:52

Then it could be an issue with the function variables or during deployment. Are you manually uploading the functions or using Appwrite CLI?

SonOfBoo
26 Dec, 2023, 22:53

I'm using the REST api because I discovered the CLI a bit too late 😂

D5
26 Dec, 2023, 22:55

Oh, I see. I would try deploying with CLI. Happened to me that a function didn't run while deploying it by uploading manually, and after deploying the same with CLI it worked due to entrypoint, etc.

D5
26 Dec, 2023, 22:56

Also it will make it simpler for you to deploy future functions

SonOfBoo
26 Dec, 2023, 22:57

Alright, I'll give that a shot. I think it would be best to use this CLI anyways. Thank you for responding so fast 😄

D5
26 Dec, 2023, 22:57

Try it and tell me if you manage to solve it

D5
26 Dec, 2023, 22:57

If not, we can continue debugging to see what's failing 😅

Drake
27 Dec, 2023, 00:17

There's a known issue with the build timeout: https://github.com/appwrite/appwrite/issues/7318

SonOfBoo
27 Dec, 2023, 06:46

Thanks for sharing Steven! Does anyone have a fix for this?

D5, I switched to the CLI and I was able to delete a lot of code. Still running into build timeouts, but this was still a great improvement.

SonOfBoo
28 Dec, 2023, 02:49
SonOfBoo
28 Dec, 2023, 02:56
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