Hi everyone, I've some problems when I'm trying to start Appwrite in my own environment. I'm always getting the same error as below and don't know were would be the problem. The Redis is running and reachable also for the Appwrite containers. Is there any option to get some more info, ie. to get some additional debug logs?
Fatal error: Uncaught Swoole\Error: API must be called in the coroutine in /usr/src/code/app/init.php:709
Stack trace:
#0 /usr/src/code/app/init.php(709): Redis->pconnect('appwrite-redis-...', 6379)
#1 /usr/src/code/app/init.php(748): {closure}()
#2 /usr/src/code/vendor/utopia-php/pools/src/Pools/Pool.php(189): {closure}()
#3 /usr/src/code/app/cli.php(36): Utopia\Pools\Pool->pop()
#4 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(173): {closure}(Object(Utopia\Pools\Group))
#5 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(193): Utopia\CLI\CLI->getResource('cache')
#6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(173): Utopia\CLI\CLI->getResources(Array)
#7 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(296): Utopia\CLI\CLI->getResource('dbForConsole')
#8 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(320): Utopia\CLI\CLI->getParams(Object(Utopia\CLI\Task))
#9 /usr/src/code/app/cli.php(211): Utopia\CLI\CLI->run()
#10 {main}
thrown in /usr/src/code/app/init.php on line 709
Hi 👋 What branch are you using to run Appwrite?
@futurmaster Also I notice its coming from cli.php. Did you run some specific command? If not, what command did you run to see those logs?
First I want to clarify that I'm trying to start the Appwrite ecosystem in a Kubernetes cluster but I used the docker-compose file from the main branch to build all the necessary yaml files for Kubernetes. I'm using the Docker image with the 1.4.13 tag. Here is the part of the yaml of one of the services that drop this error:
- name: maintenance
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
image: docker.io/appwrite/appwrite:1.4.13
imagePullPolicy: IfNotPresent
command:
- maintenance
The affected services are: schedule, maintenance, realtime and usage
Seems like Appwrite API itself isnt affected, are you able to visit Appwrite Console, and move around?
It might be issue with connection to Redis. Then it goes to parts of code that we didn't expect it to go, causing weird Swoole error. But that shouldn't be the case if you can visit Console. Another possibility is that our Dockerfile isn't compatible with Kubernetes, so it didn't install Swoole properly. CPU architecture is another thing I would consider for compatibility.
All blind guesses honestly, it's not a clear error, or error we see often. If you gain any more insights with those, please let me know and Ill give it some more thoughts.
Docker is the runtime engine behind my test Kubernetes cluster so behind the scenes everything is the same, but then I try to investigate it more deeper. The console what you mentioned is the web interface? Becaus that container also not able to startup but the problem is that not generate any logs
I found the cause of the problem. I set the POSIX permission too strictly in the container to make the app more secure, but in that mode how you implemented Swoole can't run without root permission.
[Solved] Init problem
Are you able to use appwrite in kubernetes now? If yes Can you also guide me to set up appwrite in kubernetes ?
There is still some problem with Telegraf, but as I mentioned in the general channel Appwrite can't fully work in a Kubernetes cluster, because the Kubernetes adapter still missing so you won't be able to use serverless functions
Recommended threads
- How to use Sites on selfhosted appwrite
whenever I try to create a site even with template it says 404 nginx error
- How to send Webhooks to internal network
When saving the URL for sending Webhooks, Appwrite checks if it's a valid external domain name so entering internal IP address or docker hostnames won't save th...
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...