spring-cloud / spring-cloud/spring-cloud-vault

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

Open
#739 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
291
Forks
152
Avg merge
11h 24m
Merged PRs (30d)
3

Description

It is possible a duplicate of https://github.com/spring-cloud/spring-cloud-vault/issues/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the possible duplicate issue 738 and the Spring Cloud Vault stack trace, especially VaultTemplate and the leasing configuration classes named in the report. Determine whether the Spring Cloud 2024 upgrade and HttpClient5 protocolUpgradeEnabled error share a fix, then document a complete VaultConfig example and verify that the reported secret request succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java, spring, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.