Skip to content

RefNotFoundException thrown when using spring.cloud.config.send-all-labels=true with invalid commit ID #3126

@jiten686

Description

@jiten686

In the client configuration, we are using the following property:

spring.cloud.config.label=${some-commit-id},develop

As per this setup, if the first label (e.g., a commit ID) is not found, the client automatically retries with the second label (in this case, the develop branch).
For example, if an incorrect commit ID is provided, config server throws RefNotFoundException and the client sends a second request using the develop label, and the application starts successfully.

However, starting from Spring Cloud Config version 4.2.0 and above, a new property spring.cloud.config.send-all-labels=true was introduced.
When this property is enabled, all labels are sent in a single request instead of sequential requests.
Internally, the config server reverses the label order — meaning it checks develop first, followed by the commit ID.

The problem occurs when the commit ID is invalid.
Even though the server first checks the develop branch, it still proceeds to validate the invalid commit ID and throws a RefNotFoundException.
Since all labels are sent in one request, there is no fallback attempt, causing the client startup to fail.

When spring.cloud.config.send-all-labels=true is set, the config server throws a RefNotFoundException for an invalid commit ID and fails to start the client, even if other valid labels (like develop) exist.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions