-
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
No subdirectories found for mandatory directory location 'file:./config/*/' is thrown when config dir exists #26627
Comments
To help us to figure out exactly what's happening, can you please provide a minimal sample that reproduces the problem with 2.4.6 and that works with 2.4.5? You can share it with us by zipping it up and attaching it to this issue or by pushing it to a separate repository on GitHub. |
I have the same problem since v. 2.4.6/2.5.0. It can be reproduced with a simple default project from start.spring.io (java 11, maven) by adding an empty folder "config" into the project root. It makes no difference if there actually is an application.yml file or not. |
Same here; this prevents us from upgrading to 2.4.6. I managed to circumvent this by adding an empty subdirectory to |
@wilkinsona created https://github.com/gmariotti/spring-boot-bug to run it in a local kubernetes cluster |
We are also affected by this and had to stay with version 2.4.5. We configure our application containers by mounting directories containing all config files to /config inside the individual containers. See: https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.external-config.files
We use |
Thanks, @Prieschl and @gmariotti, for the samples. With those I now believe I fully understand the problem. The problem is that the default A couple of workarounds:
The second option retains all the default config locations other than the one causing the problem. Note that |
…: No subdirectories found for mandatory directory location 'file:./config/*/'.原因为Spring Boot的问题,待修复,相关Issues:spring-projects/spring-boot#26627
We also get this error when upgrading to Spring Boot 2.5.0. Setting the "spring.config.location" to |
Same problem here |
@johanhaleby By the time the |
This workaround will not work if |
There is a regression reported in [1] (also reported in Spring Boot 2.4.6), preventing from leveraging a /config folder. This reverts commit 9f3a6d5. [1] spring-projects/spring-boot#26627
Same problem here! |
Is this fix planned for 2.5.x too? We need to upgrade to address cve-2021-22118, but this bug blocks us from upgrading. |
@astellingwerf all fixes are obviously merged forward see #26672. Also, there's no need to upgrade to Spring Boot 2.5.x to benefit from the CVE fix. |
Thanks @snicoll, you're right, I mentally took a wrong turn there. Upgrading the Spring Boot Gradle plugin or Maven parent to v2.3.11.RELEASE should do the trick. |
After upgrading Spring Boot from 2.4.5. to 2.4.6 started getting the same error. Was able to fix it by setting |
@amkuio you can figure that out by yourself right now by testing |
Confirming that both Currently I just tried Is there a way to use only one fixed dependency in SNAPTHOT version? Instead of whole parent? which one? |
Given 2.4.5 has security issues and that 2.4.6 and 2.5.0 are both broken, it makes sense to immediately release another version. Maybe release a 2.4.5.1 or something that fixes the security issues and does nothing else. Or release a 2.4.6.1 that just fixes this issue. |
Spring Boot
As @snicoll mentioned, you likely don't need a Spring Boot release to mitigate CVEs, as you can override the version of any dependency in your build. |
Update `StandardConfigDataLocationResolver` to deal with patterns when resolving empty directories. This update also fixes the handling of mandatory pattern locations which would previously throw an exception. The error message returned when a location with a pattern does not contain any subdirectories has also been improved. Fixes gh-26468 Fixes gh-26577 Fixes gh-26415
Along with this address issue about missing comment flagged by SonarQube
* Bump org.springframework.boot from 2.5.0 to 2.5.1 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v2.5.0...v2.5.1) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Reverted workaround for spring-projects/spring-boot#26627 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bert Roos <[email protected]>
Same here |
Hi, something changed in Spring Boot 2.4.6 and 2.5.0 when the docker image is built using Jib gradle plugin. Previously, our application was able to start without any issue with the following directories structure
but since the update, the application fails with a
java.lang.IllegalStateException: No subdirectories found for mandatory directory location 'file:./config/*/'.
. Any idea why?Some extra information:
SPRING_PROFILES_ACTIVE=kubernetes
The text was updated successfully, but these errors were encountered: