Back

Deployed Function Not Executing Child Process for Video Conversion

  • 0
  • Self Hosted
  • Functions
  • Databases
  • Storage
VanillaFish
3 Feb, 2025, 12:26

I'm encountering an issue with my video conversion function. Locally (using the appwrite-cli) the function works as expected, including spawning a child process to convert video files. However, after deployment on my server (Appwrite 1.6.0), the function only creates the document and does not execute the child process to start the conversion.

Details:

  • **Local Behavior: ** When run locally via appwrite-cli, the function successfully spawns a child process (using Node's child_process) to convert videos into different sizes. The function logs and conversion progress work fine.
  • Deployed Behavior: After deploying the function, the document is created as expected, but it appears that the child process is not being executed on the server. All permissions are set correctly (even trying ANY CRUD), so I suspect an environment limitation or configuration issue.
  • ** Execution Time Limit:** The function's execution time is limited to 900 seconds. I am using the background process to offload the conversion, ensuring the user does not have to wait. Unfortunately, due to the use of child_process, I cannot retrieve logs from the spawned process for debugging.

Questions:

  1. Is there a known limitation or special configuration required for using child_process in deployed Appwrite functions?
  2. Is it possible to inspect or retrieve logs from within the Docker container running the function — additionally mounting the temporary folder — to better diagnose the issue?
  3. Are there any recommended workarounds or best practices for running long-running background tasks (child processes) in a deployed Appwrite environment?

For your reference, I have documented the function and provided all relevant files in my GitHub repository: https://github.com/Vanillabacke/appwrite-cargoose-function

Thank you for your help!

TL;DR
Issue: Video conversion function works locally but not after deployment on server. Troubleshooting Steps: - Function successfully spawns child process locally using appwrite-cli. - After deployment on Appwrite server (v1.6.0), only document creation works, child process doesn't execute. - Suspect environment limitation or configuration issue. - Execution time limit of 900 seconds. - Unable to retrieve logs from spawned process due to use of `child_process`. Questions: 1. Known limitations or special configuration for using `child_process` in deployed Appwrite functions? 2. How to inspect or retrieve logs from Docker container running the function for debugging
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