You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I found a situation in which an exception interrupts the startup of the application, the SpringApplication class tries to log the error, but it doesn't get written, since the SLF4JBridgeHandler handler was already removed from the root logger.
After discovering it, I found another issue reported where the cause seems to be the same: #9457. But in the case I'm describing, the solution seems to be simple, just moving the log instruction some lines above.
I found at least 2 cases when this is happening for me:
I have a spring cloud application that tries to decrypt secrets from the yaml files by using aws-kms. If the KMS client is not able to contact the service, it throws an exception:
Cannot decrypt: key=oauth2.clientSecret
Caused by com.amazonaws.services.kms.model.AWSKMSException: The security token included in the request is expired (Service: AWSKMS; Status Code: 400; Error Code: ExpiredTokenException; Request ID: 5033cffe-34a0-4118-986c-8e11aba3b5d3)
A similar thing happens when the secret starts with {cipher} but the value is not wrapped with quotes.
In both cases, the exception is captured by SpringApplication, which tries to log it, but some lines before, the ApplicationFailedEvent was triggered. And one of the listeners triggers a call to org.springframework.cloud.bootstrap.LoggingSystemShutdownListener, that removes the SLF4JBridgeHandler from the root Logger.
I am using version 2.0.3 of spring-boot.
The text was updated successfully, but these errors were encountered:
I think this is an issue that needs to be resolved in Spring Cloud. It seems like LoggingSystemShutdownListener is perhaps listening to the wrong event. If you're able to create a sample application without Spring Cloud in the mix then please attach it here and we'll re-open this issue. Otherwise, could you please report this with the Spring Cloud team here.
jorgefr
changed the title
Spring application shuts down silently after exception during startup
spring-cloud application shuts down silently after exception during startup
Oct 27, 2018
Hi, I found a situation in which an exception interrupts the startup of the application, the SpringApplication class tries to log the error, but it doesn't get written, since the SLF4JBridgeHandler handler was already removed from the root logger.
After discovering it, I found another issue reported where the cause seems to be the same: #9457. But in the case I'm describing, the solution seems to be simple, just moving the log instruction some lines above.
I found at least 2 cases when this is happening for me:
I have a spring cloud application that tries to decrypt secrets from the yaml files by using aws-kms. If the KMS client is not able to contact the service, it throws an exception:
A similar thing happens when the secret starts with
{cipher}
but the value is not wrapped with quotes.In both cases, the exception is captured by SpringApplication, which tries to log it, but some lines before, the ApplicationFailedEvent was triggered. And one of the listeners triggers a call to
org.springframework.cloud.bootstrap.LoggingSystemShutdownListener
, that removes theSLF4JBridgeHandler
from the root Logger.I am using version 2.0.3 of spring-boot.
The text was updated successfully, but these errors were encountered: