basf / metis-backend

Scientific server implementation for the cloud environment
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

Socket hang up, 'int' object has no attribute 'strip' #21

Open alinzh opened 11 months ago

alinzh commented 11 months ago

I tried to run metis in Ubuntu. I received an error when trying to add data to 'My data' after a request to the Materials Project.

Output from CLI:

2023-12-13 22:17:24,919 [WARNING] 'int' object has no attribute 'strip'
2023-12-13 22:17:24,936 [INFO] Traceback (most recent call last):
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/base/server.py", line 764, in on_read
2023-12-13 22:17:24,937 [INFO]     if data: self.on_data(connection, data)
2023-12-13 22:17:24,937 [INFO]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/servers/http.py", line 755, in on_data
2023-12-13 22:17:24,937 [INFO]     connection.parse(data)
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/servers/http2.py", line 119, in parse
2023-12-13 22:17:24,937 [INFO]     return self.parser.parse(data)
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/common/http.py", line 512, in parse
2023-12-13 22:17:24,937 [INFO]     count = method(data)
2023-12-13 22:17:24,937 [INFO]             ^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/common/http.py", line 753, in _parse_message
2023-12-13 22:17:24,937 [INFO]     else: return self._parse_normal(data)
2023-12-13 22:17:24,937 [INFO]                  ^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/common/http.py", line 781, in _parse_normal
2023-12-13 22:17:24,937 [INFO]     self.trigger("on_data")
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/base/observer.py", line 81, in trigger
2023-12-13 22:17:24,937 [INFO]     method(*args, **kwargs)
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/servers/http.py", line 494, in on_data
2023-12-13 22:17:24,937 [INFO]     self.owner.on_data_http(self.connection_ctx, self.parser_ctx)
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/servers/wsgi.py", line 176, in on_data_http
2023-12-13 22:17:24,937 [INFO]     self.on_environ(connection, environ)
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/netius/servers/wsgi.py", line 189, in on_environ
2023-12-13 22:17:24,937 [INFO]     sequence = self.app(environ, start_response)
2023-12-13 22:17:24,937 [INFO]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/app.py", line 1478, in __call__
2023-12-13 22:17:24,937 [INFO]     return self.wsgi_app(environ, start_response)
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/app.py", line 1458, in wsgi_app
2023-12-13 22:17:24,937 [INFO]     response = self.handle_exception(e)
2023-12-13 22:17:24,937 [INFO]                ^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/app.py", line 1455, in wsgi_app
2023-12-13 22:17:24,937 [INFO]     response = self.full_dispatch_request()
2023-12-13 22:17:24,937 [INFO]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/app.py", line 869, in full_dispatch_request
2023-12-13 22:17:24,937 [INFO]     rv = self.handle_user_exception(e)
2023-12-13 22:17:24,937 [INFO]          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/app.py", line 867, in full_dispatch_request
2023-12-13 22:17:24,937 [INFO]     rv = self.dispatch_request()
2023-12-13 22:17:24,937 [INFO]          ^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/app.py", line 852, in dispatch_request
2023-12-13 22:17:24,937 [INFO]     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/PycharmProjects/metis_first_not_bild/metis-backend/metis_backend/helpers.py", line 46, in decorated
2023-12-13 22:17:24,937 [INFO]     return f(*args, **kwargs)
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/PycharmProjects/metis_first_not_bild/metis-backend/metis_backend/datasources/bp_data.py", line 50, in create
2023-12-13 22:17:24,937 [INFO]     content = request.values.get("content")
2023-12-13 22:17:24,937 [INFO]               ^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/utils.py", line 106, in __get__
2023-12-13 22:17:24,937 [INFO]     value = self.fget(obj)  # type: ignore
2023-12-13 22:17:24,937 [INFO]             ^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wrappers/request.py", line 463, in values
2023-12-13 22:17:24,937 [INFO]     sources.append(self.form)
2023-12-13 22:17:24,937 [INFO]                    ^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/utils.py", line 106, in __get__
2023-12-13 22:17:24,937 [INFO]     value = self.fget(obj)  # type: ignore
2023-12-13 22:17:24,937 [INFO]             ^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wrappers/request.py", line 443, in form
2023-12-13 22:17:24,937 [INFO]     self._load_form_data()
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/flask/wrappers.py", line 114, in _load_form_data
2023-12-13 22:17:24,937 [INFO]     super()._load_form_data()
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wrappers/request.py", line 268, in _load_form_data
2023-12-13 22:17:24,937 [INFO]     self._get_stream_for_parsing(),
2023-12-13 22:17:24,937 [INFO]     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wrappers/request.py", line 295, in _get_stream_for_parsing
2023-12-13 22:17:24,937 [INFO]     return self.stream
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/utils.py", line 106, in __get__
2023-12-13 22:17:24,937 [INFO]     value = self.fget(obj)  # type: ignore
2023-12-13 22:17:24,937 [INFO]             ^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wrappers/request.py", line 347, in stream
2023-12-13 22:17:24,937 [INFO]     return get_input_stream(
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wsgi.py", line 169, in get_input_stream
2023-12-13 22:17:24,937 [INFO]     content_length = get_content_length(environ)
2023-12-13 22:17:24,937 [INFO]                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/wsgi.py", line 123, in get_content_length
2023-12-13 22:17:24,937 [INFO]     return _sansio_utils.get_content_length(
2023-12-13 22:17:24,937 [INFO]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/sansio/utils.py", line 157, in get_content_length
2023-12-13 22:17:24,937 [INFO]     return max(0, _plain_int(http_content_length))
2023-12-13 22:17:24,937 [INFO]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO]   File "/home/alina/miniconda3/lib/python3.11/site-packages/werkzeug/_internal.py", line 210, in _plain_int
2023-12-13 22:17:24,937 [INFO]     value = value.strip()
2023-12-13 22:17:24,937 [INFO]             ^^^^^^^^^^^
2023-12-13 22:17:24,937 [INFO] AttributeError: 'int' object has no attribute 'strip'
2023-12-13 22:17:24,937 [INFO] {
2023-12-13 22:17:24,937 [INFO]     "_lid" : 4313,
2023-12-13 22:17:24,937 [INFO]     "connections" : 1,
2023-12-13 22:17:24,937 [INFO]     "encoding_s" : "plain",
2023-12-13 22:17:24,937 [INFO]     "has_all_h2" : false,
2023-12-13 22:17:24,937 [INFO]     "has_h2" : false,
2023-12-13 22:17:24,937 [INFO]     "host" : "localhost",
2023-12-13 22:17:24,937 [INFO]     "legacy" : true,
2023-12-13 22:17:24,937 [INFO]     "loaded" : true,
2023-12-13 22:17:24,937 [INFO]     "name" : "WSGIServer",
2023-12-13 22:17:24,937 [INFO]     "poll" : "epoll",
2023-12-13 22:17:24,937 [INFO]     "port" : 7050,
2023-12-13 22:17:24,937 [INFO]     "safe" : false,
2023-12-13 22:17:24,937 [INFO]     "ssl" : false,
2023-12-13 22:17:24,937 [INFO]     "state" : "read",
2023-12-13 22:17:24,937 [INFO]     "type" : 1
2023-12-13 22:17:24,937 [INFO] }

When running on MacOS (of course, with a different config), this particular problem did't arise.

blokhin commented 11 months ago

Known problem. As a temporary solution, please, downgrade flask / werkzeug to a previous major version.