Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools still refers to deprecated keys #24203

Closed
didiez opened this issue Nov 18, 2020 · 9 comments
Closed

DevTools still refers to deprecated keys #24203

didiez opened this issue Nov 18, 2020 · 9 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@didiez
Copy link
Contributor

didiez commented Nov 18, 2020

The following WARN shows up when adding spring-boot-devtools and spring-boot-properties-migrator in a vanilla spring-boot-2.4.0 application:

2020-11-18 14:40:06.087  INFO 15872 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-11-18 14:40:06.391  WARN 15872 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : Unable to start LiveReload server
2020-11-18 14:40:06.401  INFO 15872 --- [  restartedMain] com.example.demo.DemoApplication         : Started DemoApplication in 0.599 seconds (JVM running for 0.893)
2020-11-18 14:40:06.405  WARN 15872 --- [  restartedMain] o.s.b.c.p.m.PropertiesMigrationListener  : 
The use of configuration keys that have been renamed was found in the environment:

Property source 'devtools':
	Key: spring.resources.cache.period
		Replacement: spring.web.resources.cache.period
	Key: spring.resources.chain.cache
		Replacement: spring.web.resources.chain.cache


Each configuration key has been temporarily mapped to its replacement for your convenience. To silence this warning, please update your configuration to use the new keys.
@snicoll
Copy link
Member

snicoll commented Nov 18, 2020

Thanks for the report, this is a corner case where we had to restructure the configuration a bit and decided to use a common parent that led to some property to be both created and deprecated at the same time. I'll investigate how to handle that case and whether we should reconsider this arrangement.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 18, 2020
@wilkinsona
Copy link
Member

Isn't this due to me forgetting to rename a couple of properties when I moved the spring.resources properties under spring.web?

properties.put("spring.resources.cache.period", "0");
properties.put("spring.resources.chain.cache", "false");

@snicoll
Copy link
Member

snicoll commented Nov 18, 2020

Ah ha! Yeah ok, my gut instinct told me adding and deprecating a property in the same release could have led to this but that snippet makes way more sense.

@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 18, 2020
@snicoll snicoll self-assigned this Nov 18, 2020
@snicoll snicoll added this to the 2.4.1 milestone Nov 18, 2020
@snicoll snicoll changed the title spring-boot-devtools-2.4.0 using old property keys DevTools still refers to deprecated keys Nov 18, 2020
@matthewlowry
Copy link

For the record, I stumbled onto this when I upgraded an project from Spring Boot 1.5 straight to 2.4 (it was !!FUN!!).
I'm not using spring-boot-properties-migrator and for me this bug manifests as the application failing to start.

2020-11-27 07:09:49.293 ERROR 34423 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'spring.resources.cache.period' to java.time.Duration:

    Property: spring.resources.cache.period
    Value: 0
    Origin: "spring.resources.cache.period" from property source "devtools"
    Reason: failed to convert java.lang.String to @org.springframework.boot.convert.DurationUnit java.time.Duration

Action:

Update your application's configuration

I tried adding the migrator and I see the same WARN log that @didiez reported but still the application still refuses to start for me.

No big deal, and easy to work around (spring.devtools.add-properties: false in application.yml) until 2.4.1 is released.

@snicoll
Copy link
Member

snicoll commented Nov 27, 2020

@matthewlowry thanks for the feedback. Odd, I did not reproduce this myself. Can you double check that your app (without the spring.devtools.add-properties) works with 2.4.1-SNAPSHOT? If It doesn't, a separate issue with more details about your setup would be very much appreciated.

@mishraShubhamOyo

This comment has been minimized.

@snicoll

This comment has been minimized.

@mishraShubhamOyo

This comment has been minimized.

@snicoll

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants