You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "chiruv123 (via GitHub)" <gi...@apache.org> on 2023/02/22 20:17:22 UTC

[GitHub] [incubator-devlake] chiruv123 opened a new issue, #4496: [Bug][backend] PORT variable requires colon before the port number

chiruv123 opened a new issue, #4496:
URL: https://github.com/apache/incubator-devlake/issues/4496

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-devlake/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   Running apache/devlake:v0.15.0 with environment variable PORT=8080 results in this startup error:
   ```
   2023-02-22T18:48:49.616435101Z [GIN-debug] Listening and serving HTTP on 8080
   2023-02-22T18:48:49.609124257Z [GIN-debug] [ERROR] listen tcp: address 8080: missing port in address
   2023-02-22T18:48:49.616447001Z panic: listen tcp: address 8080: missing port in address
   2023-02-22T18:48:49.616451101Z
   2023-02-22T18:48:49.616455101Z goroutine 1 [running]:
   2023-02-22T18:48:49.616459001Z [github.com/apache/incubator-devlake/api.CreateApiService()](http://github.com/apache/incubator-devlake/api.CreateApiService())
   2023-02-22T18:48:49.616463001Z 	/app/api/api.go:100 +0x4c5
   2023-02-22T18:48:49.616467101Z main.main()
   2023-02-22T18:48:49.616471201Z 	/app/main.go:39 +0x7e
   ```
   The app then does not respond to requests on port 8080.
   In my case, I'm trying to run this on an Azure App Service.  Azure App Services automatically (and unchangeably) supply `-e PORT=8080` when issuing the `docker run` command.  The full command is:
   ```
   docker run -d --expose=8080 --name <redacted azure web app name> -e PORT=8080 -e WEBSITE_SITE_NAME=<redacted azure web app name> -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=<redacted azure web app name>.[azurewebsites.net](http://azurewebsites.net/) -e WEBSITE_INSTANCE_ID=<redacted random azure id> -e HTTP_LOGGING_ENABLED=1 -e WEBSITE_USE_DIAGNOSTIC_SERVER=False apache/devlake:v0.15.0
   ```
   
   ### What do you expect to happen
   
   Container starts up normally and responds to requests.
   
   ### How to reproduce
   
   1. Create a database
   2. Create an Azure Web App with access to the database
       1. Add the db connection string as an App Setting/Environment Variable
       2. Configure it to run apache/devlake:v0.15.0
   
   ### Anything else
   
   It seems the default value of PORT is `:8080`, [seen here](https://github.com/apache/incubator-devlake/blob/d9a0f7f512651ed84029f8bd8743d7365386d6c5/backend/core/config/config_viper.go#L74).  I also see that the PORT value is being split on a colon `:` character [here](https://github.com/apache/incubator-devlake/blob/d9a0f7f512651ed84029f8bd8743d7365386d6c5/backend/server/api/api.go#L118).  These examples in the code seem to treat the PORT value as a url or connection string rather than a simple port number.  I consider this a bug since it's not conventional for a port to include a colon or anything besides a number.  It also conflicts with docker's default behavior for how ports are specified.
   
   ### Version
   
   main
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh commented on issue #4496: [Bug][backend] PORT variable requires colon before the port number

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on issue #4496:
URL: https://github.com/apache/incubator-devlake/issues/4496#issuecomment-1454327082

   @keon94 Good question. We almost finish the alpha test and the beta release is coming next week. Hopefully, the `release-candidate` will be available around 15th Mar. @chiruv123 Do you think it is ok to wait and upgrade to v0.16?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] keon94 commented on issue #4496: [Bug][backend] PORT variable requires colon before the port number

Posted by "keon94 (via GitHub)" <gi...@apache.org>.
keon94 commented on issue #4496:
URL: https://github.com/apache/incubator-devlake/issues/4496#issuecomment-1450909252

   @klesh Should this be cherry-picked back into v0.16 and v0.15 (the reported release)?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] joshschmitter commented on issue #4496: [Bug][backend] PORT variable requires colon before the port number

Posted by "joshschmitter (via GitHub)" <gi...@apache.org>.
joshschmitter commented on issue #4496:
URL: https://github.com/apache/incubator-devlake/issues/4496#issuecomment-1441910516

   Hi @mappjzc, thanks for your response.  The issue is that we can't control what's passed in because, as mentioned in the original description above, Azure App Services always starts containers with the environment variable PORT=8080.  We can't control or change this value.  I see this is a bug in DevLake because the port is not really being treated as a port, but as a url or connection string.  If the variable is called PORT it should be treated as such.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mappjzc commented on issue #4496: [Bug][backend] PORT variable requires colon before the port number

Posted by "mappjzc (via GitHub)" <gi...@apache.org>.
mappjzc commented on issue #4496:
URL: https://github.com/apache/incubator-devlake/issues/4496#issuecomment-1441617129

   Thanks for your valuable feedback and suggestion.
   
   I have checked the code for it.
   ![image](https://user-images.githubusercontent.com/2921251/220877959-65b075af-c31c-4c3b-ad1f-14c22b0a9488.png)
   
   And with your error `missing port in address` we think it is because here need to use `host:port` but not only the port.
   
   Maybe you can try PORT=0.0.0.0:8080


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] klesh closed issue #4496: [Bug][backend] PORT variable requires colon before the port number

Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh closed issue #4496: [Bug][backend] PORT variable requires colon before the port number
URL: https://github.com/apache/incubator-devlake/issues/4496


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org