0
0

【AWS】Elastic Beanstalkへのデプロイ中に502 Bad Gatewayが出た話

Last updated at Posted at 2024-01-31

Elastic BeanstalkにSpring Bootアプリをデプロイ中に以下のような502 Bad Gateway(Nginx)エラーが発生しました。

スクリーンショット 2024-01-31 13.37.45.png

色々調べてみると、ロードバランサーやポート番号の設定ミスが原因になることがあるらしいが、それは問題なさそう。ここで、RDSでデータベース作成の際に指定したDB名とapplication.propertiesファイルに記述したDB名が違っていることに気づく。

本来以下のようにapplication.properties内に記述するべきところ、

application.properties
spring.datasource.url=jdbc:mysql://{エンドポイント}:3306/db_ems_1

このようにDB名を記述していました。

application.properties
spring.datasource.url=jdbc:mysql://{エンドポイント}:3306/ems_db_1

今後はこのような簡単なミスをしないようにしたいですね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0