swoole / docker-swoole

🏄 Official Docker Image of Swoole
https://hub.docker.com/r/phpswoole/swoole
Apache License 2.0
526 stars 112 forks source link

Issue with Deployment on K8S #25

Closed babarinde closed 3 years ago

babarinde commented 3 years ago

Hi, when deploying on K8s, It shows that deployment is successful, All workers are started but when i visit the http://my-app/ it shows an error An unexpected error occurred and a 500 on the logs When i deploy this on a dokku server for example, it works fine I am using the phpswoole/swoole:4.6.7-php8.0 as base for my docker image And am running mezzio-swole

deminy commented 3 years ago

Hello. It might not be an issue with the Swoole image, but it's hard to tell since there isn't enough information from your post:

a 500 on the logs: Which logs? The logs from the Swoole container? or the logs from somewhere else? If the logs are from the Swoole container, there should be more details in the logs, which could help identify the issue. Also, if the logs are from the Swoole container, I'd suggest updating the source code to return 'Hello World!' directly, and see if it works; you can also update your PHP configurations to have warnings/errors directly printed out (for debugging purpose).

As you said, the image worked fine in another environment. I highly suggest going through different logs and see which part causes the issue. We'd like to help if it's some issue with the Swoole image.

Thanks

babarinde commented 3 years ago

These are my logs from the pod

Swoole is running at 0.0.0.0:5000, in /var/www

Worker started in /var/www with ID 0 Worker started in /var/www with ID 3 Worker started in /var/www with ID 7 Worker started in /var/www with ID 6 Worker started in /var/www with ID 1 Worker started in /var/www with ID 2 Worker started in /var/www with ID 5 Worker started in /var/www with ID 4 10.240.0.6 - - [31/May/2021:19:06:45 +0000] "GET / HTTP/1.1" 500 28 10.240.0.6 - - [31/May/2021:19:06:45 +0000] "GET /favicon.ico HTTP/1.1" 500 28 10.244.3.1 - - [31/May/2021:19:09:48 +0000] "GET / HTTP/1.1" 500 28 10.240.0.7 - - [31/May/2021:19:09:48 +0000] "GET / HTTP/1.1" 500 28 10.240.0.4 - - [31/May/2021:19:10:14 +0000] "GET / HTTP/1.1" 500 28 10.240.0.4 - - [31/May/2021:19:10:14 +0000] "GET /favicon.ico HTTP/1.1" 500 28 10.240.0.6 - - [31/May/2021:19:10:30 +0000] "GET / HTTP/1.1" 500 28 10.240.0.7 - - [31/May/2021:19:11:28 +0000] "GET / HTTP/1.1" 500 28 10.240.0.7 - - [31/May/2021:19:11:28 +0000] "GET /favicon.ico HTTP/1.1" 500 28`

It suggest that the request hits the service but cant seem to get more than that Could this have anything to do with the default server running

babarinde commented 3 years ago

Apologies for this, it had nothing to do with Swoole My config was actually wrong. Thanks for your prompt response Regards