Rohandeep Singh
Rohandeep Singh

Reputation: 69

socket.gaierror: [Errno 11001] getaddrinfo. Flask app was working a week ago and now I'm seeing this error. not sure what is going

Flask app that I run on windows I have not changed any since it was last functioning. and now I'm seeing this error which I don't understand why its occuring.

Trackback when I try to run the app:

 flask run -host=0.0.0.0
     * Serving Flask app "predict_app.py"
     * Environment: production
       WARNING: Do not use the development server in a production environment.
       Use a production WSGI server instead.
     * Debug mode: off
    Using TensorFlow backend.
    2018-11-29 12:56:44.685154: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX
    Traceback (most recent call last):
      File "c:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "c:\programdata\anaconda3\lib\runpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "C:\ProgramData\Anaconda3\Scripts\flask.exe\__main__.py", line 9, in <module>
      File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 894, in main
        cli.main(args=args, prog_name=name)
      File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 557, in main
        return super(FlaskGroup, self).main(*args, **kwargs)
      File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 717, in main
        rv = self.invoke(ctx)
      File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "c:\programdata\anaconda3\lib\site-packages\click\decorators.py", line 64, in new_func
        return ctx.invoke(f, obj, *args, **kwargs)
      File "c:\programdata\anaconda3\lib\site-packages\click\core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "c:\programdata\anaconda3\lib\site-packages\flask\cli.py", line 771, in run_command
        threaded=with_threads, ssl_context=cert)
      File "c:\programdata\anaconda3\lib\site-packages\werkzeug\serving.py", line 814, in run_simple
        inner()
      File "c:\programdata\anaconda3\lib\site-packages\werkzeug\serving.py", line 774, in inner
        fd=fd)
      File "c:\programdata\anaconda3\lib\site-packages\werkzeug\serving.py", line 660, in make_server
        passthrough_errors, ssl_context, fd=fd)
      File "c:\programdata\anaconda3\lib\site-packages\werkzeug\serving.py", line 577, in __init__
        self.address_family), handler)
      File "c:\programdata\anaconda3\lib\socketserver.py", line 453, in __init__
        self.server_bind()
      File "c:\programdata\anaconda3\lib\http\server.py", line 136, in server_bind
        socketserver.TCPServer.server_bind(self)
      File "c:\programdata\anaconda3\lib\socketserver.py", line 467, in server_bind
        self.socket.bind(self.server_address)
    socket.gaierror: [Errno 11001] getaddrinfo failed

Upvotes: 2

Views: 6173

Answers (1)

Dinko Pehar
Dinko Pehar

Reputation: 6061

From flask docs:

If you have the debugger disabled or trust the users on your network, you can make the server publicly available simply by adding --host=0.0.0.0 to the command line:

So use --host instead of -host:

flask run --host=0.0.0.0

Upvotes: 1

Related Questions