-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[BUG] spring boot 3.4.5 containers hang at starting up for keyvault property-source with managed identity #45263
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
Comments
The app works fine with 3.0.7. It was a straight forward version upgrade where I updated spring boot from 3.0.7 to 3.4.5 and their respective Azure cloud libraries as per documentation. |
This is a sample config I am using
and here is a screenshot from the AKS vmss managed identity setup. Here, the first managed identity is given RBAC secret user access to kv. And most importantly the existing code just works with older version. Getting above exception every time with new spring boot and azure cloud version. |
here is the full pom file. <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example.example</groupId>
<artifactId>app</artifactId>
<version>1.0.1-TEST</version>
<name>app</name>
<description>app</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<encoding>UTF-8</encoding>
<java.version>17</java.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<sonar.projectKey>example.example.app</sonar.projectKey>
<sonar.host.url>https://sonarqube.example.com</sonar.host.url>
<sonar.junit.reportPaths>target/surefire-reports</sonar.junit.reportPaths>
<sonar.coverage.exclusions>
src/main/java/com/example/example/app/mapper/**,
src/main/java/com/example/example/app/configuration/EncryptionConfig.java,
src/main/java/com/example/example/app/configuration/SftpPollingConfiguration.java,
src/main/java/com/example/example/app/configuration/SftpConfigParams.java,
src/main/java/com/example/example/app/configuration/SftpOutboundConfigParams.java,
src/main/java/com/example/example/app/appJobApplication.java,
src/main/java/com/example/example/app/intmodel/**,
src/main/java/com/example/example/app/filter/**,
</sonar.coverage.exclusions>
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
<sonar.dependencyCheck.jsonReportPath>target/dependency-check-report.json</sonar.dependencyCheck.jsonReportPath>
<sonar.dependencyCheck.htmlReportPath>target/dependency-check-report.html</sonar.dependencyCheck.htmlReportPath>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-sftp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.27.1</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jasypt</groupId>
<artifactId>jasypt</artifactId>
<version>1.9.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.14.0</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-keyvault</artifactId>
<exclusions>
<exclusion>
<groupId>com.microsoft.azure</groupId>
<artifactId>msal4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>msal4j</artifactId>
<version>1.19.1</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-dependencies</artifactId>
<version>5.22.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
<path>
<artifactId>mapstruct-processor</artifactId>
<groupId>org.mapstruct</groupId>
<version>1.6.3</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>4.1.0</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<sourceRoot>${basedir}/target/generated-sources/src/main/java</sourceRoot>
<xsdOptions>
<xsdOption>
<xsd>src/main/resources/exampleXml_5.0.xsd</xsd>
<packagename>com.example.example.model.dcgff</packagename>
</xsdOption>
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<configuration>
<excludes>
<exclude>com/example/payment/service/asd/model/**</exclude>
<exclude>com/example/example/app/configuration/SftpPollingConfiguration</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
<format>HTML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>12.1.0</version>
<configuration>
<formats>
<format>HTML</format>
<format>JSON</format>
<format>XML</format>
</formats>
<ossindexAnalyzerEnabled>false</ossindexAnalyzerEnabled>
<assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
<retireJsUrl>https://artifactory.example.com/artifactory/nvd-local/jsrepository.json</retireJsUrl>
<nvdDatafeedUrl>https://artifactory.example.com/artifactory/nvd-local/nvdcve-{0}.json.gz</nvdDatafeedUrl>
<knownExploitedUrl>https://artifactory.example.com/artifactory/nvd-local/known_exploited_vulnerabilities.json</knownExploitedUrl>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.2</version>
<configuration>
<configLocation>${project.basedir}/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
</configuration>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>1.2.2</version>
<configuration>
<inclusionLevel>NON_EMPTY</inclusionLevel>
<annotationStyle>jackson2</annotationStyle>
<includeGeneratedAnnotation>true</includeGeneratedAnnotation>
</configuration>
<executions>
<execution>
<id>jcmreferencedatagenrqstv4001</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceType>jsonschema</sourceType>
<sourceDirectory>src/main/resources/jcmreferencedatagenrqstv4001</sourceDirectory>
<outputDirectory>${basedir}/target/generated-sources/src/main/java</outputDirectory>
<targetPackage>com.example.json.cm.referencedatagenrqst.v4001</targetPackage>
</configuration>
</execution>
<execution>
<id>jcmreferencedatagenrspv4000</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourceType>jsonschema</sourceType>
<sourceDirectory>src/main/resources/jcmreferencedatagenrspv4000</sourceDirectory>
<outputDirectory>${basedir}/target/generated-sources/src/main/java</outputDirectory>
<targetPackage>com.example.json.cm.referencedatagenrsp.v4000</targetPackage>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.github.git-commit-id</groupId>
<artifactId>git-commit-id-maven-plugin</artifactId>
<configuration>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project> |
Here are my findings after a tiring debug session. Apparently I have to exclude this IMDS endpoint in my
If possible, Kindly update this tutorial page with information related to the IMDC endpoint Plus, a proper error message for the Exception I mentioned above would help as well. I believe there is another item that tracks it at AzureAD/microsoft-authentication-library-for-java#907 |
@saragluna could you follow up with this issue from @raja-anbazhagan @raja-anbazhagan thanks for the detailed issue |
We'll update our doc for it. Thanks for your help @raja-anbazhagan! |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Containers hang at starting up since upgrading from 3.0.7 to 3.4.5. Container starts fine if property source is disabled.
Exception or Stack Trace
To Reproduce
Steps to reproduce the behavior: Not sure Yet. Will update on finding
Code Snippet
Add the code snippet that causes the issue.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
If you suspect a dependency version mismatch (e.g. you see
NoClassDefFoundError
,NoSuchMethodError
or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:Additional context

Add any other context about the problem here.
Here is the process inside the container
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: