Situation:
We are facing an issue while applying a patch on our Linux server. The Patch get failed and throwing connectivity errors with the backend database. In the patch log, we are seeing the below error:-
ERROR ROOT c.a.p.p.steps.BackendDBConnection - Error while creating connection with backend database
com.app.exception.SystemException:
UNABLE_TO_CONNECT_DATABASE:com.app.patch.exception.errorcode.PrerequisiteErrorCode : Exception Id "7a5e2365-38a7-47be-b8d8-d50480ab97db" Message :Not able to connect with database, to continue with patch process database should be accessible.
[Database type=Oracle]
[URL=jdbc:oracle:thin:@vldcdstd22rtp1a:1521:ADPT]
[User=ABC]
[prerequisite step=Step to check backend database connection]
at com.app.patch.utils.DatabaseUtils.checkDBConnection(DatabaseUtils.java:310) ~[patchUpdate.jar:na]
Cause:
The initial error in the logs was not descriptive enough. So when tested with a Database utility(attached below) with additional logging we were able to see the exact error, we have found the following error:-
java.sql.SQLRecoverableException: IO Error: Connection reset by peer, Authentication lapse 87623 ms.
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:794)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at test.DatabaseConnectionTest.createConnection(DatabaseConnectionTest.java:22)
at test.DatabaseConnectionTest.main(DatabaseConnectionTest.java:74)
Caused by: java.io.IOException: Connection reset by peer, Authentication lapse 87623 ms.
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:790)
... 7 more
This is an environment-specific issue and some customers face this issue when their Linux servers face trouble while generating Random numbers, when the Adeptia tries to generate a random number but JVM is unable to generate the number resulting in the Patch Application failure. More details are available on the below link:-
https://stackoverflow.com/questions/137212/how-to-deal-with-a-slow-securerandom-generator
Solution:
In order to resolve this issue, kindly, perform the following steps and make the required changes. The steps are:-
- Goto the extracted patch folder.
- Open Apply-Patch.sh file in edit mode and search for "Invoke command" section.
- Now, replace the second line with the following one:-
java -Djava.security.egd=file:/dev/../dev/urandom -Xms256M -Xmx2048M -DinstallationDirectory="$installDirPath" -DpatchMode="deployment" -Dcomponent=$component -cp "libs/logback-access-1.1.3.jar:libs/logback-classic-1.1.3.jar:libs/logback-core-1.1.3.jar:libs/*:etc" com.app.Main
- Save the file and apply the patch again.
Comments
0 comments
Article is closed for comments.