Skip to content

Unxpected StringIndexOutOfBoundsException #2279

@VitaliyKulikov

Description

@VitaliyKulikov

Describe the bug
After migration to the 2022.0.3 version following exceptions have been appearing:

Caused by: java.lang.StringIndexOutOfBoundsException: begin 183, end 153, length 198
        at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4602) ~[na:na]
        at java.base/java.lang.String.substring(String.java:2705) ~[na:na]
        at org.springframework.cloud.config.client.ConfigServerConfigDataLoader.extractApplicationName(ConfigServerConfigDataLoader.java:223) ~[spring-cloud-config-client-4.0.3.jar:4.0.3]
        at org.springframework.cloud.config.client.ConfigServerConfigDataLoader.isProfileSpecificPropertySource(ConfigServerConfigDataLoader.java:207) ~[spring-cloud-config-client-4.0.3.jar:4.0.3]
        at org.springframework.cloud.config.client.ConfigServerConfigDataLoader.lambda$doLoad$1(ConfigServerConfigDataLoader.java:160) ~[spring-cloud-config-client-4.0.3.jar:4.0.3]

Here are some clues:

  • application.yaml
spring:
  config:
    import: configserver:http://dbs02inplayamq9.donbest.com:8888/
  • debug values: ConfigServerConfigDataLoader#extractApplicationName
    propertySource.getName()
"configserver:ssh://[email protected]:7999/dbs/environments.git/Config resource 'file [/tmp/config-repo-16512912790018624282/platform/pinnacle-sink.yaml' via location 'platform/' (document #0)"
  • something wrong here:
		return !applicationName.equals(extractApplicationName(propertySource))
				&& propertySource.getName().matches(".*[-,]" + profile + ".*");

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions