Pylons / waitress

Waitress - A WSGI server for Python 3
https://docs.pylonsproject.org/projects/waitress/en/latest/
Other
1.45k stars 175 forks source link

ValueError: invalid literal for int() with base 10: '$PORT' #356

Closed mestrecalendo closed 2 years ago

mestrecalendo commented 2 years ago

i tried deploy an container on heroku, im using flask e waitress-serve but the variable $PORT dont work

the command to start the container CMD ["waitress-serve", "--port=$PORT", "--url-scheme=https", "--call" ,"app:create_app"] the error on heroku

2021-11-11T18:33:41.335629+00:00 heroku[web.1]: Starting process with command `waitress-serve --port\=\12061 --url-scheme\=https --call app:create_app`
2021-11-11T18:33:43.013593+00:00 app[web.1]: /usr/local/lib/python3.10/site-packages/flask_sqlalchemy/__init__.py:872: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.
2021-11-11T18:33:43.013603+00:00 app[web.1]:   warnings.warn(FSADeprecationWarning(
2021-11-11T18:33:43.024531+00:00 app[web.1]: Starting up..
2021-11-11T18:33:43.024537+00:00 app[web.1]: Traceback (most recent call last):
2021-11-11T18:33:43.024551+00:00 app[web.1]:   File "/usr/local/bin/waitress-serve", line 8, in <module>
2021-11-11T18:33:43.024693+00:00 app[web.1]:     sys.exit(run())
2021-11-11T18:33:43.024700+00:00 app[web.1]:   File "/usr/local/lib/python3.10/site-packages/waitress/runner.py", line 298, in run
2021-11-11T18:33:43.024840+00:00 app[web.1]:     _serve(app, **kw)
2021-11-11T18:33:43.024855+00:00 app[web.1]:   File "/usr/local/lib/python3.10/site-packages/waitress/__init__.py", line 13, in serve
2021-11-11T18:33:43.024934+00:00 app[web.1]:     server = _server(app, **kw)
2021-11-11T18:33:43.024949+00:00 app[web.1]:   File "/usr/local/lib/python3.10/site-packages/waitress/server.py", line 49, in create_server
2021-11-11T18:33:43.025050+00:00 app[web.1]:     adj = Adjustments(**kw)
2021-11-11T18:33:43.025060+00:00 app[web.1]:   File "/usr/local/lib/python3.10/site-packages/waitress/adjustments.py", line 325, in __init__
2021-11-11T18:33:43.025245+00:00 app[web.1]:     setattr(self, k, self._param_map[k](v))
2021-11-11T18:33:43.025267+00:00 app[web.1]: ValueError: invalid literal for int() with base 10: '$PORT'
2021-11-11T18:33:43.231775+00:00 heroku[web.1]: Process exited with status 1
2021-11-11T18:33:43.441510+00:00 heroku[web.1]: State changed from starting to crashed
2021-11-11T18:33:45.649798+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=integration-docker-test.herokuapp.com request_id=c14f7ca9-eb61-4b79-849a-438ff7812b78 fwd="168.205.125.143" dyno= connect= service= status=503 bytes= protocol=https
2021-11-11T18:33:47.124129+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=integration-docker-test.herokuapp.com request_id=ba78ea05-e816-48a1-b335-303334ef98a1 fwd="168.205.125.143" dyno= connect= service= status=503 bytes= protocol=https
stevepiercy commented 2 years ago

You either need to replace $PORT with an integer, or resolve the environment variable.