Home > Software design >  Liquibase/Springboot startup exception
Liquibase/Springboot startup exception

Time:12-21

Starting yesterday (Sunday) morning my production app fails to start, with no code changes from my side. It's running Springboot 2.3.4, Liquibase-core 3.8.0 and is hosted on Amazon linux2. Funny thing is there are no exceptions locally, only when deployed.

Here is the relevant stack trace:

Caused by: liquibase.exception.UnexpectedLiquibaseException: java.nio.file.NoSuchFileException: /tmp/agent12302722365010540729.jar
 at liquibase.servicelocator.ServiceLocator.setResourceAccessor(ServiceLocator.java:129)
 at liquibase.servicelocator.ServiceLocator.<init>(ServiceLocator.java:69)
 at liquibase.servicelocator.CustomResolverServiceLocator.<init>(CustomResolverServiceLocator.java:16)
 at org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener$LiquibasePresent.replaceServiceLocator(LiquibaseServiceLocatorApplicationListener.java:55)
 at org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener.onApplicationEvent(LiquibaseServiceLocatorApplicationListener.java:44)
 at org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener.onApplicationEvent(LiquibaseServiceLocatorApplicationListener.java:36)
...
Caused by: java.nio.file.NoSuchFileException: /tmp/agent801508645517312012.jar
  at liquibase.resource.ClassLoaderResourceAccessor.getResourcesAsStream(ClassLoaderResourceAccessor.java:53)
  at liquibase.servicelocator.ServiceLocator.setResourceAccessor(ServiceLocator.java:115)

I double checked all application related files and env variables and they are all the same. The file in question is in no way related to my app.

Do you have any idea what this file is and why is Liquibase trying to find it all of the sudden?

CodePudding user response:

I have the same problem and after checking, on startup of the amazon linux 2, there is security patches that are installed.

in /var/log/yum.log, I saw that these patches was installed after a startup :

-tzdata-java-2021a-1.amzn2.noarch
-log4j-cve-2021-44228-hotpatch-1.1-9.amzn2.noarch
-1:java-11-openjdk-headless-11.0.13.0.8-1.amzn2.0.3.x86_64
-1:java-11-openjdk-11.0.13.0.8-1.amzn2.0.3.x86_64

Can you check / uninstall these to validate that this is the problem ?

CodePudding user response:

Get inside your hosting amazon linux server and execute the following command.

ps -ef | grep java.io.tmpdir

Then try to locate what exactly the tmpdir is configured to be.

Then go to this temporary directory and make a backup just for safety somewhere. Then clean every folder and file contained inside the temporary directory.

Start your application again, and it should be able to start.

This temporary directory is used by java agent so that the application can be started more quickly from JVM, and those files should be automatically cleaned when the application gracefully closes.

  • Related