Strange behavior with Liquibase on AWS Elastic Beanstalk

I have a strange behavior with a Spring Boot project using Liquibase and deployed on AWS Elastic Beanstalk. The same project works correctly on my local machine.

below are some logs. You can see that everything starts fine but then on “SELECT * FROM xxx.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC”, there is pause of 17 seconds and the application restarts, and it restarts, and it restarts, …

|2020-11-25T10:37:41.170-05:00|INFO | liquibase.executor.jvm.JdbcExecutor | info | SELECT COUNT(*) FROM xxx.DATABASECHANGELOG|
|2020-11-25T10:37:41.175-05:00|INFO | liquibase.changelog.StandardChangeLogHistoryService | info | Reading from xxx.DATABASECHANGELOG|
|2020-11-25T10:37:41.176-05:00|INFO | liquibase.executor.jvm.JdbcExecutor | info | SELECT * FROM xxx.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC|
|2020-11-25T10:37:58.578-05:00|INFO | xxx | logStarting | Starting xxx on ip-172-33-10-198.us-east-2.compute.internal with PID 9196 (/var/app/current/lib/xxx.jar started by webapp in /var/app/current)|
|2020-11-25T10:37:58.580-05:00|DEBUG | xxx | logStarting | Running with Spring Boot v2.3.4.RELEASE, Spring v5.2.9.RELEASE|

Any idea what could be the problem ? If I set the “liquibase.enable” property to false then the application starts correctly. And as I said above, it works fine on my local machine with enable at true.

Hi @cimballi,

Sorry for the delay in responding. We would need to see more of the error. I am not a Spring Boot or Beanstalk expert but, I will try to help on the liquibase front.

Is SpringBoot running a liquibase update when it starts? Could you include the whole log so we can see what it is trying to do? I see no failure in the above, and liquibase is designed to check its DATABASECHANGELOG if SpringBoot is running a liquibase update.

HTH,

Ronak

Hi @ronak,

Honestly for now I just removed the use of Liquibase because of that problem. As you said there is no error. It blocks on a query, then after 15-0 seconds the application restarts (that’s probably something specific to Elastic Beanstalk). Then it blocks again and it restats, etc… I am not 100% sure the problem is wih Liquibase, nevertheless when I disabled Liquibase in the application.yml file, then the application started correctly.

It would be interesting to test with a very basic SpringBoot project. I may try when I have some availability, but for now I don’t have anything that I could share.