Closed
Description
Bug report
Spring Boot Version: 3.4.2
After upgrading to Spring Boot 3.4.2, my app is crashing on boot with the following logs:
"@timestamp":"2025-01-27T10:42:49.772470089+13:00","level":"ERROR","thread_name":"main","logger_name":"o.s.b.SpringApplication","m
essage":"Application run failed","throwable_class":"ApplicationContextException","stack_trace":"java.io.IOException: **'/..data/tls.k
ey'** is neither a file nor a directory\n\tat o.s.b.a.s.FileWatcher$WatcherThread.register(FileWatcher.java:150)\n\tat o.s.b.a.ssl.Fi
leWatcher.watch(FileWatcher.java:93)\n\t... 80 common frames omitted\nWrapped by: java.io.UncheckedIOException: Failed to register
paths for watching: [/opt/tls/tls.key, /opt/tls/tls.crt]\n\tat o.s.b.a.ssl.FileWatcher.watch(FileWatcher.java:96)\n\tat o.s.b.a.s.S
slPropertiesBundleRegistrar.watchForUpdates(SslPropertiesBundleRegistrar.java:82)\n\t... 79 common frames omitted\nWrapped by: j.la
ng.IllegalStateException: Unable to watch for reload on update\n\tat o.s.b.a.s.SslPropertiesBundleRegistrar.watchForUpdates(SslProp
ertiesBundleRegistrar.java:85)\n\tat o.s.b.a.s.SslPropertiesBundleRegistrar.lambda$registerBundles$2(SslPropertiesBundleRegistrar.j
ava:70)\n\t... 78 common frames omitted\nWrapped by: j.lang.IllegalStateException: Unable to register SSL bundle 'server'
My application.yaml has the following config to mount a certificate:
spring:
ssl:
bundle:
pem:
server:
keystore:
certificate: file:${TLS_CERT_PATH:}
private-key: file:${TLS_KEY_PATH:}
reload-on-update: true
server:
ssl:
bundle: server
enabled: ${TLS_ENABLED:false}
enabled-protocols: TLSv1.3
My k8s deployment provides the environment variables:
- TLS_ENABLED=true
- TLS_CERT_PATH=/opt/tls/tls.crt
- TLS_KEY_PATH=/opt/tls/tls.key
- KEYSTORE_PATH=/opt/tls/keystore.p12
I'm not sure where /..data/tls.key comes from seeing as there's no config that provides that.
Possibly related to #43586?
Any help is appreciated!