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

Environment variables are not bound properly when unknown fields are not ignored #3745

Closed
wujek-srujek opened this issue Aug 13, 2015 · 2 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@wujek-srujek
Copy link

When deploying to Cloud Foundry, the embedded web server (Undertow in my case) must use the port defined in the PORT env variable. Simply deploying the repackaged jar to CF used to work for M2.
After an upgrade to M3, Undertow always starts on its default port 8080, which results in an error: 'Instance (index 0) failed to start accepting connections'. This issue is caused by CF checking if the application listens on the port it defined for it, and if it doesn't, it's an error and the app is killed.
I'm not sure if this is a Boot issue, or maybe Undertow's (I think M3 upgrades Untertow, among others).

@wilkinsona wilkinsona added the type: bug A general bug label Aug 13, 2015
@wilkinsona wilkinsona added this to the 1.3.0.RC1 milestone Aug 13, 2015
@wilkinsona
Copy link
Member

Thanks for the report. The Java build pack maps the PORT environment variable to the SERVER_PORT environment variable.

Running the Undertow sample:

  • java -DSERVER_PORT=8888 -jar target/spring-boot-sample-undertow-1.3.0.M3.jar uses 8080
  • java -Dserver.port=8888 -jar target/spring-boot-sample-undertow-1.3.0.M3.jar uses 8888

This looks like a Boot issue to me.

@wilkinsona
Copy link
Member

DefaultPropertyNamePatternsMatcher is created with a single name (server), two delimiters (_ and .) and ignoreCase set to false. This causes it to consider SERVER_PORT as not matching so it's not included in the property values used for the binding.

@wilkinsona wilkinsona self-assigned this Aug 13, 2015
@wilkinsona wilkinsona changed the title Cannot deploy to Cloud Foundry after upgrade 1.3.0M2 -> M3 Environment variables are not bound properly when unknown fields are not ignored Aug 13, 2015
@snicoll snicoll modified the milestones: 1.3.0.RC1, 1.3.0.M4 Aug 17, 2015
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

3 participants