-
Notifications
You must be signed in to change notification settings - Fork 41k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalStateException: Unable to register SSL bundle after 3.3.8 or 3.4.2 #43966
Comments
If it's related to #43586 then I suspect that |
Hey @wilkinsona, thanks for your reply! I'm unsure if ../data is a path we can use. Hopefully the below can help 😄 This article may be a helpful link for context. Kubernetes manages symlinks much differently than a regular operating system.
To replicate this, we'd need to run this within a cluster (perhaps with kind), and have a pod that is consuming a certificate secret by mounting it as a volume with the relevant environment vars to point to it.
To validate this further, we've had a go at writing some unit tests to verify
Interestingly enough, the third test (rbSymlink3) fails with the following:
Not 100% sure I'm on the right track, but I feel like it's something to do with how java manages working directories that have symlinks which point to relative directories (note how the IO exception leads to a ../ path which is similar to what we faced in the boot crash above) Any help is much appreciated! |
@TazBruce Thanks for the feedback and the link to this article. I have replicated the k8s setup and behavior with a test: /*
* Replicating a k8s configmap folder structure like:
*
* secret.txt -> ..data/secret.txt
* ..data/ -> ..a72e81ff-f0e1-41d8-a19b-068d3d1d4e2f/
* ..a72e81ff-f0e1-41d8-a19b-068d3d1d4e2f/secret.txt
*
* After a secret update, this will look like:
*
* secret.txt -> ..data/secret.txt
* ..data/ -> ..bba2a61f-ce04-4c35-93aa-e455110d4487/
* ..bba2a61f-ce04-4c35-93aa-e455110d4487/secret.txt
*/
@Test
void shouldTriggerOnConfigMapUpdates(@TempDir Path tempDir) throws Exception {
Path configMap1 = createConfigMap(tempDir, "secret.txt");
Path configMap2 = createConfigMap(tempDir, "secret.txt");
Path data = tempDir.resolve("..data");
Files.createSymbolicLink(data, configMap1);
Path secretFile = tempDir.resolve("secret.txt");
Files.createSymbolicLink(secretFile, data.resolve("secret.txt"));
try {
WaitingCallback callback = new WaitingCallback();
this.fileWatcher.watch(Set.of(secretFile), callback);
Files.delete(data);
Files.createSymbolicLink(data, configMap2);
FileSystemUtils.deleteRecursively(configMap1);
callback.expectChanges();
}
finally{
FileSystemUtils.deleteRecursively(configMap2);
Files.delete(data);
Files.delete(secretFile);
}
}
Path createConfigMap(Path parentDir, String secretFileName) throws IOException {
Path configMapFolder = parentDir.resolve(".." + UUID.randomUUID());
Files.createDirectory(configMapFolder);
Path secret = configMapFolder.resolve(secretFileName);
Files.createFile(secret);
return configMapFolder;
} This test is green and I'm not replicating the issue. Note, the article you're mentioning does not refer to relative folder but to folders with names starting with "..". In your case, it seems it's trying to resolve "/..data/tls.key" which doesn't seem to exist? Maybe you can show the complete file structure of the container in this case? Thanks! |
In my usecase, I have a letsencrypt certbot updating my files. Same problem as OP. When I have "reload-on-update" enabled it won't start.
config:
|
@kasprzakdanielt I'm trying to reproduce this in a test but I'm missing something. |
@bclozel ah, sorry, I copied the wrong part of a stacktrace.
Here is a more detailed file structure: |
Thanks @kasprzakdanielt I managed to reproduce the behavior in a test and fixed it for the next maintenance release. |
Glad to help. Thanks for the fix @bclozel |
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:
My application.yaml has the following config to mount a certificate:
My k8s deployment provides the environment variables:
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!
The text was updated successfully, but these errors were encountered: