p1ngul1n0/blackbird

subprocess.CalledProcessError: Command '('/usr/local/opt/python@3.9/bin/python3.9', 'webserver.py')' returned non-zero exit status 1.

Drjacky opened this issue · 5 comments

python3 blackbird.py --web:

WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.

  • Debug mode: off
    Traceback (most recent call last):
    File "/Users/drjacky/Toolz/H-ck/blackbird/webserver.py", line 28, in
    app.run('0.0.0.0')
    File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 920, in run
    run_simple(t.cast(str, host), port, self, **options)
    File "/usr/local/lib/python3.9/site-packages/werkzeug/serving.py", line 1010, in run_simple
    inner()
    File "/usr/local/lib/python3.9/site-packages/werkzeug/serving.py", line 950, in inner
    srv = make_server(
    File "/usr/local/lib/python3.9/site-packages/werkzeug/serving.py", line 782, in make_server
    return ThreadedWSGIServer(
    File "/usr/local/lib/python3.9/site-packages/werkzeug/serving.py", line 688, in init
    super().init(server_address, handler) # type: ignore
    File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 452, in init
    self.server_bind()
    File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/server.py", line 136, in server_bind
    socketserver.TCPServer.server_bind(self)
    File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
    OSError: [Errno 48] Address already in use
    Traceback (most recent call last):
    File "/Users/drjacky/Toolz/H-ck/blackbird/blackbird.py", line 166, in
    command.check_returncode()
    File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 460, in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
    subprocess.CalledProcessError: Command '('/usr/local/opt/python@3.9/bin/python3.9', 'webserver.py')' returned non-zero exit status 1.

Have you called blackbird.py in two terminals seperately?

No


I have python 3 installed

No

I have python 3 installed

The actual reason of failure is

OSError: [Errno 48] Address already in use

that means some application occupies the port 5000. You may find the solution here.

There is no process run a SimpleHTTPServer :

ps -fA | grep python3
  501 27932 27740   0 10:15PM ttys000    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn python3

There is no process run a SimpleHTTPServer :

ps -fA | grep python3
  501 27932 27740   0 10:15PM ttys000    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn python3

Not only the application which runs by python3
If you unable to find the occupied application, you may directly define the target port (e.g. port=5001) at line 28 in webserver.py

# app.run('0.0.0.0')
app.run('0.0.0.0', port=5001)