1
votes

I deployed my app on Cloud Run service of google. It shows error "Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information. ". I run this image on Cloud Shell to test, it still runs with PORT 8080 and bind 0.0.0.0, I can not find more error in log of cloud run. My project is laravel project. Please help me, how to find out more logs and debug this case. Check Image

Port running

2
What does your Container logic look like? At the highest level, the contract is that your code will be called and supplied a value in an environment variable called PORT. That is a port that you should TCP listen on as soon as your container starts. It will provide the coupling to the incoming request that caused your Cloud Run instance to start.Kolban
Need more info. Can you please paste logs of your Cloud Run service? They should be available on the UI. Also please add more info on how you're testing on Cloud Shell. Instructions on how to locally test: cloud.google.com/run/docs/testing/localAhmet Alp Balkan
Hi @AhmetB-Google, Kolban. My app includes php-fpm and nginx, i used supervisord to start they when run docker. it only one message from cloud run log, 2019-12-10 11:21:35.938 ICTUnlinking stale socket /var/run/supervisor/supervisor.sock. So, i dont think it's error. I've checked base link like you sent, it's okie.HoangThang
Your error message is standard one when the container failed to start. Paste your Cloud Run logs as requested by @AhmetB-Googleguillaume blaquiere
Did you do something like this to setup nginx to listen on PORT environment variable? .... itnext.io/running-any-container-on-cloudrun-cca137cddbcaKolban

2 Answers

1
votes

I fixed it. When i run with supervisor at local it runs, but on Cloud Run it's not ok. So i've changed to entrypoint to start php-fpm and nginx, it's okie on Cloud Run

0
votes

You can look at this step by step guide that might help for this or similar problems with Laravel and Google Cloud Run.