Skip to content

Upgrading from spring-cloud 2021 to spring-cloud 2024 causes AWS vault-agent error (HttpClient5 protocolUpgradeEnabled) #739

Description

@v-ladynev

It is possible a duplicate of #738

Could you provide a full example of creating Spring Config Bean to fix it please?
Something like

@Configuration
class VaultConfig {

}

Error description
After upgrading from

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:2021.0.3"
    }
}

to

dependencyManagement {
	imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:2024.0.0"
	}
}

It is impossible to get anything from AWS vault-agent.

The errors from vault-agent:

2024-12-12T14:43:53.593Z [ERROR] agent.apiproxy.client: request failed: error="Get \"https://vault.qa.xxx.net/v1/sys/internal/ui/mounts/kv/didinv/dev/my-service\": http2: invalid Upgrade request header: [\"TLS/1.2\"]" method=GET url=https://vault.qa.xxx.net/v1/sys/internal/ui/mounts/kv/didinv/dev/my-service

The errors from Spring Boot application:

org.springframework.vault.core.lease.SecretLeaseEventPublisher$LoggingErrorListener: 
[RequestedSecret [path='kv/didinv/dev/my-service', mode=ROTATE]] Lease [leaseId='null', leaseDuration=PT0S, renewable=false] 
I/O error on GET request for "http://17.17.17.1:8200/v1/kv/didinv/dev/my-service": "Read timed out"
org.springframework.web.client.ResourceAccessException: "I/O error on GET request for http://17.17.17.1:8200/v1/kv/didinv/dev/my-service: Read timed out"
at org.springframework.web.client.RestTemplate.createResourceAccessException(RestTemplate.java:926
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:906
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:801
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:415
at org.springframework.vault.core.VaultTemplate.lambda$doRead$5(VaultTemplate.java:464
at org.springframework.vault.core.VaultTemplate.doWithSession(VaultTemplate.java:451
at org.springframework.vault.core.VaultTemplate.doRead(VaultTemplate.java:461
at org.springframework.vault.core.VaultTemplate.read(VaultTemplate.java:356
at org.springframework.vault.core.lease.SecretLeaseContainer.doGetSecrets(SecretLeaseContainer.java:713
at org.springframework.vault.core.lease.SecretLeaseContainer.doStart(SecretLeaseContainer.java:391
at org.springframework.vault.core.lease.SecretLeaseContainer.start(SecretLeaseContainer.java:381
at org.springframework.vault.core.lease.SecretLeaseContainer.addRequestedSecret(SecretLeaseContainer.java:343
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.loadProperties(LeaseAwareVaultPropertySource.java:176
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.\u003cinit\u003e(LeaseAwareVaultPropertySource.java:161
at org.springframework.vault.core.env.LeaseAwareVaultPropertySource.\u003cinit\u003e(LeaseAwareVaultPropertySource.java:119
at org.springframework.cloud.vault.config.LeasingVaultPropertySourceLocator.createVaultPropertySource(LeasingVaultPropertySourceLocator.java:146
at org.springframework.cloud.vault.config.LeasingVaultPropertySourceLocator.createVaultPropertySource(LeasingVaultPropertySourceLocator.java:83
at org.springframework.cloud.vault.config.VaultPropertySourceLocatorSupport.doCreatePropertySources(VaultPropertySourceLocatorSupport.java:122
at org.springframework.cloud.vault.config.VaultPropertySourceLocatorSupport.createCompositePropertySource(VaultPropertySourceLocatorSupport.java:101
at org.springframework.cloud.vault.config.VaultPropertySourceLocatorSupport.locate(VaultPropertySourceLocatorSupport.java:76
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:50
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:46
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.doInitialize(PropertySourceBootstrapConfiguration.java:121

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions