【GCP】Cloud Build + Cloud Runで構築する際のエラーはログを見よう

Cloud BuildがコケたのでCloud Runを確認しに行くと、以下のエラーメッセージが表示されていました。

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.

トラブルシューティングではコンテナが想定ポートでリクエストをリッスンしているかとありますが、
ポートに関しては問題ありませんでした。
しかし、上記のエラーが出て続けてどういうことだ?となりました。

しかし、こちらのstack overflowでの記載によると、これはデフォルトのエラー文とのことです。

It’s the default error message when the container don’t start, even if you have well defined the port to listen.

Go to the logs and see what exactly happens. You could fix the start with the correct message.

ログを見ると、きちんと原因を究明することができました。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です