spring-cloud / spring-cloud/spring-cloud-consul

Springboot application restarting after getting warning -Error querying consul Key/Values for context

Open
#822 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

waiting-for-triage
Dominant language
Java
Stars
822
Forks
539
Avg merge
9h 31m
Merged PRs (30d)
7

Description

Springboot app in production restarts after below warning occurs. This happens after the application has been running for sometime due to which all the nodes restarts.

WARN o.s.c.c.c.ConfigWatch [ConfigWatch.java:206] Error querying consul Key/Values for context .Message: Error creating bean with name 'getDataSource': Could not bind properties to 'DataSource' : prefix=spring.datasource, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.datasource' to javax.sql.DataSource

This is happening continuously. Tried to stop restart by setting fail-fast as false but didn't work. Now i have disabled the watch to not keep looking for updates in consul. But that doesn't solve the problem.

I have been using springboot 2.2.0 and dependency spring-cloud-starter-consul-al

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at ConfigWatch.java:206 and trace how the Consul configuration refresh handles the DataSource binding failure shown in the warning. Reproduce the production restart if possible and identify why fail-fast=false does not prevent it; done means the application remains running when this warning occurs and the relevant behavior is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.