spring-cloud-config: Breaking change in 3.1.8: using config.import with gives "[//] give is not a valid HTTP URL"

Describe the bug

After upgrading from 3.1.7 to 3.1.8 using config.import with optional and using default β€œπŸ˜•/” gives a β€œ[//] is not a valid HTTP URL error”.

Stacktrace:

Caused by: java.lang.IllegalArgumentException: [//] is not a valid HTTP URL
	at org.springframework.web.util.UriComponentsBuilder.fromHttpUrl(UriComponentsBuilder.java:316)

Sample Using this config in application.yml:

spring:
    config.import:
      - optional:vault://
      - optional:configserver:${SPRING_CLOUD_CONFIG_URI://}

As reference this should still be valid use: Conditionally enable/disable Vault Configuration In some cases, it can be required to launch an application without Vault. You can express whether a Vault config location should be optional or mandatory (default) through the location string:

optional:vault:// (default location)

See: https://docs.spring.io/spring-cloud-vault/docs/current/reference/html/config-data.html

Using these dependencies:

<spring-boot.version>2.7.13</spring-boot.version>
<spring-cloud.version>2021.0.8</spring-cloud.version>

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks Ryan, it’s clear to me now. πŸ‘

In our setup I will go forward to moving the config.import to the specific cloud profile. So not use it in the default.

Correct the fix went into the 3.1.x, 4.0.x, and main branches