After porting `stx-nova-api-proxy` to Debian, I noticed that this error started to appear in other subcommands that worked normally in the CentOS based version (e.g. `nova flavor create`).
Upon further investigation, I found out that the code was breaking due to some request headers that were being passed to the Python 3's built-in `http` library with `NoneType` as their values (where, in fact, they should've been passed as strings [or not passed at all]):
In Python 2.7 – and therefore in the CentOS-based version of `nova-api-proxy` – this wasn't a problem because the builtin `httplib` (equivalent of Python 3's `http`) library handled the conversion to string (even of `NoneType`):
Therefore, some adjustments related to the Python 2.7 to Python 3 migration need to be made to the `nova-api-proxy` source code, something I will do in this LP.
----
Unfortunately, the original exception thrown during pause/unpause/suspend/resume is still occurring. The debug logs in `nova-api-proxy` shows the following tracestack:
```
2023-01-31 11:27:50,871.871 6 DEBUG nova_api_proxy.common.service [-] Traceback (most recent call last):
File "/var/lib/openstack/lib/python3.9/site-packages/eventlet/wsgi.py", line 573, in handle_one_response
result = self.application(self.environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 143, in __call__
return resp(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/routes/middleware.py", line 153, in __call__
response = self.app(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 143, in __call__
return resp(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 129, in __call__
resp = self.call_func(req, *args, **kw)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 193, in call_func
return self.func(req, *args, **kwargs)
File "/var/lib/openstack/lib/python3.9/site-packages/keystonemiddleware/auth_token/__init__.py", line 341, in __call__
response = req.get_response(self._app)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/request.py", line 1313, in send
status, headers, app_iter = self.call_application(
File "/var/lib/openstack/lib/python3.9/site-packages/webob/request.py", line 1278, in call_application
app_iter = application(self.environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 143, in __call__
return resp(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/routes/middleware.py", line 153, in __call__
response = self.app(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 143, in __call__
return resp(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 143, in __call__
return resp(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/webob/dec.py", line 143, in __call__
return resp(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/nova_api_proxy/apps/proxy.py", line 50, in __call__
result = self.proxy_app(environ, start_response)
File "/var/lib/openstack/lib/python3.9/site-packages/paste/proxy.py", line 236, in __call__
res = conn.getresponse()
File "/usr/lib/python3.9/http/client.py", line 1347, in getresponse
response.begin()
File "/usr/lib/python3.9/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.9/http/client.py", line 276, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response write /var/lib/openstack/lib/python3.9/site-packages/nova_api_proxy/common/service.py:91
```
Right now, I'm trying to understand what might be leading to this error.
As this behavior already happened when `nova-api-proxy` was still based on CentOS, I'm tending to believe that this is more related to `python-novaclient` itself.
After porting `stx-nova- api-proxy` to Debian, I noticed that this error started to appear in other subcommands that worked normally in the CentOS based version (e.g. `nova flavor create`).
Upon further investigation, I found out that the code was breaking due to some request headers that were being passed to the Python 3's built-in `http` library with `NoneType` as their values (where, in fact, they should've been passed as strings [or not passed at all]):
... _SYSTEM_ SCOPE': None, DOMAIN_ NAME': None
'HTTP_OPENSTACK
'HTTP_X_DOMAIN_ID': None,
'HTTP_X_
...
In Python 2.7 – and therefore in the CentOS-based version of `nova-api-proxy` – this wasn't a problem because the builtin `httplib` (equivalent of Python 3's `http`) library handled the conversion to string (even of `NoneType`):
https:/ /github. com/enthought/ Python- 2.7.3/blob/ master/ Lib/httplib. py#L938
However, in Python 3 – and therefore in the Debian-based version of `nova-api-proxy` – an exception is thrown instead:
https:/ /github. com/python/ cpython/ blob/044fb4fb53 594b37de8188cb3 6f3ba33ce2d617e /Lib/http/ client. py#L1262
Therefore, some adjustments related to the Python 2.7 to Python 3 migration need to be made to the `nova-api-proxy` source code, something I will do in this LP.
----
Unfortunately, the original exception thrown during pause/unpause/ suspend/ resume is still occurring. The debug logs in `nova-api-proxy` shows the following tracestack:
``` proxy.common. service [-] Traceback (most recent call last): openstack/ lib/python3. 9/site- packages/ eventlet/ wsgi.py" , line 573, in handle_one_response n(self. environ, start_response) openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 143, in __call__ openstack/ lib/python3. 9/site- packages/ routes/ middleware. py", line 153, in __call__ openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 143, in __call__ openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 129, in __call__ openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 193, in call_func openstack/ lib/python3. 9/site- packages/ keystonemiddlew are/auth_ token/_ _init__ .py", line 341, in __call__ response( self._app) openstack/ lib/python3. 9/site- packages/ webob/request. py", line 1313, in send application( openstack/ lib/python3. 9/site- packages/ webob/request. py", line 1278, in call_application self.environ, start_response) openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 143, in __call__ openstack/ lib/python3. 9/site- packages/ routes/ middleware. py", line 153, in __call__ openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 143, in __call__ openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 143, in __call__ openstack/ lib/python3. 9/site- packages/ webob/dec. py", line 143, in __call__ openstack/ lib/python3. 9/site- packages/ nova_api_ proxy/apps/ proxy.py" , line 50, in __call__ app(environ, start_response) openstack/ lib/python3. 9/site- packages/ paste/proxy. py", line 236, in __call__ python3. 9/http/ client. py", line 1347, in getresponse begin() python3. 9/http/ client. py", line 307, in begin python3. 9/http/ client. py", line 276, in _read_status ted("Remote end closed connection without" RemoteDisconnec ted: Remote end closed connection without response write /var/lib/ openstack/ lib/python3. 9/site- packages/ nova_api_ proxy/common/ service. py:91
2023-01-31 11:27:50,871.871 6 DEBUG nova_api_
File "/var/lib/
result = self.applicatio
File "/var/lib/
return resp(environ, start_response)
File "/var/lib/
response = self.app(environ, start_response)
File "/var/lib/
return resp(environ, start_response)
File "/var/lib/
resp = self.call_func(req, *args, **kw)
File "/var/lib/
return self.func(req, *args, **kwargs)
File "/var/lib/
response = req.get_
File "/var/lib/
status, headers, app_iter = self.call_
File "/var/lib/
app_iter = application(
File "/var/lib/
return resp(environ, start_response)
File "/var/lib/
response = self.app(environ, start_response)
File "/var/lib/
return resp(environ, start_response)
File "/var/lib/
return resp(environ, start_response)
File "/var/lib/
return resp(environ, start_response)
File "/var/lib/
result = self.proxy_
File "/var/lib/
res = conn.getresponse()
File "/usr/lib/
response.
File "/usr/lib/
version, status, reason = self._read_status()
File "/usr/lib/
raise RemoteDisconnec
http.client.
```
Right now, I'm trying to understand what might be leading to this error.
As this behavior already happened when `nova-api-proxy` was still based on CentOS, I'm tending to believe that this is more related to `python-novaclient` itself.