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

Release 8.1.0 breaks server startup #449

Closed
rtyley opened this issue Apr 9, 2024 · 2 comments · Fixed by #451
Closed

Release 8.1.0 breaks server startup #449

rtyley opened this issue Apr 9, 2024 · 2 comments · Fixed by #451

Comments

@rtyley
Copy link
Member

rtyley commented Apr 9, 2024

Unfortunately v8.1.0, broke server startup, and should not be used. The release contained this single change:

The error only occurs when Play is run in 'production' mode - typically, when we run Play as developers, we run Play in 'dev' mode, with the run command - in this mode, you have things like hot-code-reload, and the application-secret checks are more lenient. However, those behaviours aren't desirable in Production, so when a Play app is deployed, we get those additional checks.

We can simulate Production behaviour in dev by running with runProd rather than run, eg, for Ophan:

sbt ";project dashboard ;runProd"

The error given is:

Oops, cannot start the server.
Configuration error: Configuration error[
The application secret has not been set, and we are in prod mode. Your application is not secure.
To set the application secret, please read https://playframework.com/documentation/latest/ApplicationSecret
]
	at play.api.Configuration$.$anonfun$configError$1(Configuration.scala:159)
	at scala.Option.map(Option.scala:242)
	at play.api.Configuration$.configError(Configuration.scala:151)
	at play.api.Configuration.reportError(Configuration.scala:410)
	at play.api.http.HttpConfiguration$.getSecretConfiguration(HttpConfiguration.scala:283)
	at play.api.http.HttpConfiguration$.fromConfiguration(HttpConfiguration.scala:228)
	at play.api.BuiltInComponents.httpConfiguration(Application.scala:272)
	at play.api.BuiltInComponents.httpConfiguration$(Application.scala:271)
	at play.api.BuiltInComponentsFromContext.httpConfiguration$lzycompute(ApplicationLoader.scala:229)
	at play.api.BuiltInComponentsFromContext.httpConfiguration(ApplicationLoader.scala:229)
	at configuration.ApplicationComponents.<init>(ApplicationComponents.scala:136)
	at configuration.DashboardApplicationLoader.load(DashboardApplicationLoader.scala:20)
	at play.core.server.ProdServerStart$.start(ProdServerStart.scala:52)
	at play.core.server.ProdServerStart$.main(ProdServerStart.scala:28)
	at play.core.server.ProdServerStart.main(ProdServerStart.scala)
@mkurz
Copy link

mkurz commented Apr 9, 2024

8.0.0 works? I can't see from the referenced PR why 8.1.0 would fail...

@rtyley
Copy link
Member Author

rtyley commented Apr 9, 2024

8.0.0 works? I can't see from the referenced PR why 8.1.0 would fail...

Yep, it is surprising! I intend to investigate the cause as soon as possible today, I'm afraid that PR #447 may hide some changes in it's diff - for instance, for Configuration, it uses withFallback rather than ++, tho' I haven't had time yet to check if that does something to the laziness of evaluation. Will find out soon...

rtyley added a commit to guardian/play-googleauth that referenced this issue Apr 9, 2024
rtyley added a commit that referenced this issue Apr 9, 2024
This fixes #449,
the problem with server startup that was released with
play-secret-rotation v8.1.0.
rtyley referenced this issue in guardian/play-googleauth Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants