Question

Issue with Werkzeug library

Posted May 18, 2021 362 views
PythonUbuntu 20.04Flask

Hey everybody,

My code works perfectly fine on my machine, but when I deploy it to Ubuntu server (Ubuntu 20.04 (LTS) x64) I get the following error:

(env) root@ubuntu-s-1vcpu-1gb-intel-nyc1-01:~/demo# python run.py

  • Serving Flask app “demo” (lazy loading)
  • Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Debug mode: on
  • Running on all addresses. WARNING: This is a development server. Do not use it in a production deployment.
  • Running on http://143.198.118.35:5000/ (Press CTRL+C to quit)
  • Restarting with stat Killed (env) root@ubuntu-s-1vcpu-1gb-intel-nyc1-01:~/demo# * Debugger is active!
  • Debugger PIN: 521-632-002 Traceback (most recent call last): File “/root/demo/run.py”, line 4, in <module> app.run(host=‘0.0.0.0’) File “/root/demo/env/lib/python3.8/site-packages/flask/app.py”, line 990, in run runsimple(host, port, self, **options) File “/root/demo/env/lib/python3.8/site-packages/werkzeug/serving.py”, line 1000, in runsimple rwr( File “/root/demo/env/lib/python3.8/site-packages/werkzeug/reloader.py”, line 418, in runwithreloader ensureechoon() File “/root/demo/env/lib/python3.8/site-packages/werkzeug/reloader.py”, line 398, in ensureecho_on termios.tcsetattr(sys.stdin, termios.TCSANOW, attributes) termios.error: (5, 'Input/output error’)

What could be the problem?

Thank you so much for your help!
niko

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Not entirely sure of what might cause this, but input/output error might have to do with permissions. Is this writing to the terminal or a (virtual?) serial port?

In the latter case, make sure you are added to the correct group (modem, I believe, then logout and login again).

In the former, check who owns the python script you’re trying to run.
Go to the folder where run.py is located and run ls -lh
Try running as root (sudo python run.py) to see if it fixes it.

If it works under sudo, it is most likely a permissions issue.

If you’ve uploaded the file as root, then the regular user may not be allowed to run the script (just a thought).