Label-studio: Bug when starting release branch 0.7.3

Created on 8 Jul 2020  路  8Comments  路  Source: heartexlabs/label-studio

I am on Windows with Python 3.7.
I did pip install git+https://github.com/heartexlabs/label-studio.git@release/0.7.3 but got the error below

>label-studio start my_labeling_project --init
c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\site-pac
kages\label_studio\examples\image_polygons\config.xml label config copied to .\m
y_labeling_project\config.xml
.\my_labeling_project\completions output dir has been created.

Label Studio has been successfully initialized. Check project states in .\my_lab
eling_project
Start the server: label-studio start .\my_labeling_project
Start browser at URL: http://localhost:8080/welcome
 * Serving Flask app "label_studio.server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployme
nt.
   Use a production WSGI server instead.
 * Debug mode: off
Traceback (most recent call last):
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\phmay\AppData\Local\Continuum\miniconda3\envs\label-studio\Scri
pts\label-studio.exe\__main__.py", line 7, in <module>
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
site-packages\label_studio\server.py", line 1012, in main
    app.run(host=host, port=port, debug=input_args.debug)
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
site-packages\flask\app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
site-packages\werkzeug\serving.py", line 1010, in run_simple
    inner()
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
site-packages\werkzeug\serving.py", line 963, in inner
    fd=fd,
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
site-packages\werkzeug\serving.py", line 806, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
site-packages\werkzeug\serving.py", line 699, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
socketserver.py", line 452, in __init__
    self.server_bind()
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
http\server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "c:\users\phmay\appdata\local\continuum\miniconda3\envs\label-studio\lib\
socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno 11004] getaddrinfo failed
bug

Most helpful comment

Thanks for fixing this.

All 8 comments

What host name and port do you use to start LS?

Please, check my latest commit on release/0.7.3 branch (Fix with sockeraddr on windows).

@RasmusEdvardsen have you the same issue with socket bind?

@makseq Yes, I do

label-studio version:
label-studio 0.7.3rc2

Stacktrace:

(lblstd) PS C:\ai\labelstudio> label-studio start poc-front
Start browser at URL: http://localhost:8080/welcome
 * Serving Flask app "label_studio.server" (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: off
Traceback (most recent call last):
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\rasmus.edvardsen\Anaconda3\envs\lblstd\Scripts\label-studio.exe\__main__.py", line 7, in <module>
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\site-packages\label_studio\server.py", line 1012, in main
    app.run(host=host, port=port, debug=input_args.debug)
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\site-packages\flask\app.py", line 990, in run
    run_simple(host, port, self, **options)
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\site-packages\werkzeug\serving.py", line 1010, in run_simple
    inner()
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\site-packages\werkzeug\serving.py", line 963, in inner
    fd=fd,
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\site-packages\werkzeug\serving.py", line 806, in make_server
    host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\site-packages\werkzeug\serving.py", line 699, in __init__
    HTTPServer.__init__(self, server_address, handler)
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\socketserver.py", line 452, in __init__
    self.server_bind()
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\http\server.py", line 137, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "c:\users\rasmus.edvardsen\anaconda3\envs\lblstd\lib\socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
socket.gaierror: [Errno 11001] getaddrinfo failed

@makseq
The issue is in app.run(host=host,...) where host now has the protocol prepended to the address (http://localhost), whereas it was just the path previously (localhost)

Also, this is a problem, when the config file is generated by the init script from the cli.
0.7.2:
"host": "0.0.0.0",

0.7.3-rc:
"host": "http://0.0.0.0",

https://github.com/heartexlabs/label-studio/blob/20d0612a596b5f2656f12fe4b73f5ce561cde657/label_studio/server.py#L998

@RasmusEdvardsen check the latest commit now, please.
If you use the old project, be sure there is "host": "localhost" in project/config.json, without "http://"

@makseq perfect!

(lblstd) PS C:\ai\labelstudio> label-studio start poc-front
Chick host & port is available localhost:8080
Start browser at URL: http://localhost:8080/welcome
 * Serving Flask app "label_studio.server" (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: off
[2020-07-08 17:43:22,672] [INFO] [werkzeug::_log::122]  * Running on http://0.0.0.0:8080/ (Press CTRL+C to quit)
[2020-07-08 17:43:25,912] [INFO] [werkzeug::_log::122] 127.0.0.1 - - [08/Jul/2020 17:43:25] "GET /welcome HTTP/1.1" 200 -

And config.json:

{
  "title": "Label Studio",
  "protocol": "http://",
  "host": "0.0.0.0",
  "port": 8080,
  "debug": false,
  "label_config": "config.xml",
  "input_path": "tasks.json",
  "output_dir": "completions",
  "instruction": "Type some <b>hypertext</b> for label experts!",
  "allow_delete_completions": true,
  "templates_dir": "examples",
  "editor": {
    "debug": false
  },
  "sampling": "sequential",
  "ml_backends": [],
  "source": {
    "name": "Tasks",
    "type": "tasks-json",
    "path": "C:\\ai\\labelstudio\\poc-front\\tasks.json"
  },
  "target": {
    "name": "Completions",
    "type": "completions-dir",
    "path": "C:\\ai\\labelstudio\\poc-front\\completions"
  }
}

Thanks for fixing this.

Was this page helpful?
0 / 5 - 0 ratings