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

app.py TypeError('port must be an integer') error #3

Open
0xlen opened this issue Mar 22, 2018 · 1 comment
Open

app.py TypeError('port must be an integer') error #3

0xlen opened this issue Mar 22, 2018 · 1 comment

Comments

@0xlen
Copy link

0xlen commented Mar 22, 2018

Hi Abby,

Thanks for your good tutorial for ecs demo.

When building the docker image for ecs-demo-web and ecs-demo-api:

$ cd <path/to/project>/ecs-demo/web
$ docker build -t ecs-demo-web .
$ cd <path/to/project>/ecs-demo/api 
$ docker build -t ecs-demo-api .

In the app.py, it specifies the string as the port number, this may occur the type error when running the docker image.

app.run(port='3000',host='0.0.0.0')

app.run(port='8000',host='0.0.0.0')

Error output

Traceback (most recent call last):
  File "app.py", line 9, in <module>
    app.run(port='8000',host='0.0.0.0')
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 772, in run
    run_simple(host, port, self, **options)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 748, in run_simple
    raise TypeError('port must be an integer')

I open a PR to fix this issue and hope it helps.

0xlen added a commit to 0xlen/ecs-demo that referenced this issue Mar 22, 2018
@fbukevin
Copy link

fbukevin commented Mar 23, 2018

Here are related flask official issue discussing about this case.

Change port type from string to integer works fine.
app.run(port=3000,host='0.0.0.0')

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

No branches or pull requests

2 participants