Back

[Solved] Init problem

  • 0
  • Self Hosted
futurmaster
26 Nov, 2023, 09:28

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?

TypeScript
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
TL;DR
The user is experiencing an initialization problem with Appwrite in a Kubernetes cluster. They suspect it may be due to missing Kubernetes adapter and strict POSIX permissions. They also mention the possibility of issues with connection to Redis, compatibility with Dockerfile, and CPU architecture. It's a complex issue without a clear error message. They provide some YAML code and ask for guidance on debugging. Solution: The solution is not provided in the support thread. Further investigation and troubleshooting is needed.
Meldiron
27 Nov, 2023, 10:53

Hi 👋 What branch are you using to run Appwrite?

Meldiron
27 Nov, 2023, 10:54

@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?

futurmaster
27 Nov, 2023, 11:29

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:

TypeScript
- name: maintenance
  securityContext:
    allowPrivilegeEscalation: false
    capabilities:
      drop:
      - ALL
    seccompProfile:
      type: RuntimeDefault
  image: docker.io/appwrite/appwrite:1.4.13
  imagePullPolicy: IfNotPresent
  command:
    - maintenance
futurmaster
27 Nov, 2023, 11:32

The affected services are: schedule, maintenance, realtime and usage

Meldiron
28 Nov, 2023, 19:25

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.

futurmaster
28 Nov, 2023, 19:42

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

futurmaster
29 Nov, 2023, 20:30

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.

futurmaster
29 Nov, 2023, 20:31

[Solved] Init problem

beingsilent
30 Nov, 2023, 08:23

Are you able to use appwrite in kubernetes now? If yes Can you also guide me to set up appwrite in kubernetes ?

futurmaster
30 Nov, 2023, 16:18

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

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