Skip to content

Config server client tries localhost:8888 even if URLs are configured #2052

Closed
@marnee01

Description

@marnee01

This seems to have started some time in the past week, but I am not 100% sure. I am testing with by pulling down the "main", building it, installing locally, and using 4.0.0-SNAPSHOT in my local client.

In this scenario, configure one of the following ways:

  1. Configure one or more config server URLs under spring.config.import.
  2. Or, set up spring.config.import=configserver: without URLs. Set one or more URLs via spring.cloud.config.uri.

Either of the above scenario produces same issue.

Expected: A spring-cloud-config-client will try connecting only to the configured config server URLs.
Observed: The client will try to connect to the default URL "http://localhost:8888" first.

I have attached a sample IntelliJ project that demonstrates the issue. Due to #2051, if you run this as-is, it won't produce a log file, so you can't see the log showing that it is calling localhost. To observe in the logs, update the uri(s) in the application.yml file to point to a real config server and set the application name, password, etc. so that the server will return a 200 and a log will be produced. I will also attach a sample log file.

Note that I was running with Java 17. (Ignore the name of the file in the zipped project that has "Java8".)

LogFile_CallsLocalhost.txt

ConfigServerClient_CallsLocalhost.zip

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