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

Fix listening on port 8080 Warning #1511

Merged
merged 14 commits into from
Jul 16, 2019
Merged

Conversation

i0n-
Copy link
Contributor

@i0n- i0n- commented Jul 15, 2019

When the application is deployed with hard-coded port configuration, appear the Warning:

'App is listening on port 8080, it should instead listen on the port defined by the PORT environment variable.'

This patch look for the PORT environment variable, otherwise set 8080.

i0n- added 4 commits July 12, 2019 10:05
Uses the PORT environment variable when is present, otherwise sets 8080.
@i0n- i0n- requested a review from a team July 15, 2019 04:01
@kurtisvg kurtisvg self-assigned this Jul 15, 2019
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 15, 2019
@kurtisvg kurtisvg added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
Copy link
Contributor

@kurtisvg kurtisvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this change is warranted. I think AppEngine always wants port 8080?

@averikitsch - thoughts?

@i0n-
Copy link
Contributor Author

i0n- commented Jul 16, 2019

@kurtisvg I did this to prevent this warning in the console logs viewer :

{
 insertId:  "5d26aeb2000c973148c895ec"  
 labels: {
  clone_id:  "00c61b117c21f3d5d43e23db86e8c2c0964ad67598aa0959da791ccdd718816044908044adf3"   
 }
 logName:  "projects/calculadora-sat/logs/stderr"  
 receiveTimestamp:  "2019-07-11T03:36:18.833405023Z"  
 resource: {
  labels: {
   module_id:  "default"    
   project_id:  "calculadora-sat"    
   version_id:  "north"    
   zone:  "us17"    
  }
  type:  "gae_app"   
 }
 severity:  "WARNING"  
 textPayload:  "App is listening on port 8080, it should instead listen on the port defined by the PORT environment variable. As a consequence, nginx cannot be started. Performance may be degraded. Please listen on the port defined by the PORT environment variable."  
 timestamp:  "2019-07-11T03:36:18.825137Z"  
}

And I will update the code, following your recommendations.

@i0n- i0n- closed this Jul 16, 2019
@i0n- i0n- reopened this Jul 16, 2019
@averikitsch
Copy link
Contributor

@kurtisvg this must be a new warning. The app is suppose to be listening to port 8080. (This error sounds more like a Cloud Run error). I will check in the the GAE team.

@averikitsch
Copy link
Contributor

App engine will respect the user's PORT.
@i0n- Thanks for the PR, will you update your changes to reflect @kurtisvg suggestions?

@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@i0n-
Copy link
Contributor Author

i0n- commented Jul 16, 2019

@averikitsch Updated!

…/example/appengine/demo/jettymain/Main.java

Co-Authored-By: Kurtis Van Gent <[email protected]>
@kurtisvg kurtisvg added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@kurtisvg kurtisvg added the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@kokoro-team kokoro-team removed the kokoro:run Add this label to force Kokoro to re-run the tests. label Jul 16, 2019
@kurtisvg kurtisvg merged commit b9f7749 into GoogleCloudPlatform:master Jul 16, 2019
Sita04 pushed a commit that referenced this pull request Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants