Question

Issue with Werkzeug library

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 run_simple(host, port, self, **options) File “/root/demo/env/lib/python3.8/site-packages/werkzeug/serving.py”, line 1000, in run_simple _rwr( File “/root/demo/env/lib/python3.8/site-packages/werkzeug/_reloader.py”, line 418, in run_with_reloader ensure_echo_on() File “/root/demo/env/lib/python3.8/site-packages/werkzeug/_reloader.py”, line 398, in ensure_echo_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

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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).