🔴 The Error You're Seeing

Confirm this matches your console output. If it does, you're in the right place.

ERROR LOG2026-02-20 13:40:05.200 ERROR 8842 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.cloud.config.client.ConfigServerConfigDataMissingException: Could not locate PropertySource: None of the configured locations returned a value at org.springframework.cloud.config.client.ConfigServerConfigDataLoader.load(ConfigServerConfigDataLoader.java:60)

⚡ Quick Fix Works 80% of the time

Set spring.config.import=optional:configserver: instead of configserver:

# application.properties spring.config.import=optional:configserver:http://localhost:8888

🧠 Why this Happens

Tap to expand the deep technical explanation

Your application is configured as a Spring Cloud Config Client. On startup, it tried to fetch its external configuration from a Config Server, but the server was unreachable or didn't have the configuration file. Because `fail-fast` is often true, the app crashes instead of starting with local defaults.

The HITEC City Parking Spot Analogy:

It's like a satellite trying to download its flight path from mission control before taking off. If mission control is offline, the satellite aborts the launch because it doesn't know where to go.

🔁 How to Reproduce Confirm this is your error

Add spring-cloud-starter-config. Set `spring.config.import=configserver:http://localhost:9999` (a port where nothing is running). Run the app.

🛠️ Solutions (5 Ways to Fix)

Solution 1✓ Most common cause

Use optional: prefix

👉 Use this for microservices that should start even if the Config Server is down.

Tells Spring Boot to try fetching the config, but fall back to local `application.properties` if the server is unreachable.

spring.config.import=optional:configserver:http://localhost:8888
Solution 2

Ensure Config Server is running

👉 Use this if the Config Server is required and the app shouldn't start without it.

Check that your Spring Cloud Config Server application is running on the specified URL before starting the client.

# Check if the server is up curl http://localhost:8888/actuator/health
Solution 3

Check Config Server URL and credentials

👉 Use this if the server is running but the client still fails.

Ensure the URL, username, and password in `spring.cloud.config.uri`, `username`, and `password` are correct.

spring.cloud.config.uri=http://localhost:8888 spring.cloud.config.username=admin spring.cloud.config.password=secret
Solution 4

Set fail-fast=false

👉 Use this to prevent the app from crashing on startup if the config fetch fails.

Overrides the default behavior of crashing if the config server is unreachable.

spring.cloud.config.fail-fast=false
Solution 5

Verify network connectivity / VPN

👉 Use this if the Config Server is hosted in a private cloud.

The client might be blocked by a firewall. Ensure your app can reach the Config Server IP and port.

ping config-server.mycompany.com

📋 Version Notes

Spring Boot 2.x

Used `bootstrap.yml` and `spring.cloud.config.uri`.

Spring Boot 3.x

Uses `spring.config.import` in `application.properties`. Bootstrap is deprecated.

🛡️ How to Prevent This Next Time

In microservices, only use `fail-fast=true` for core services. For edge services, use `optional:configserver:` so they can start with local defaults.