module 'werkzeug.wsgi' has no attribute 'DispatcherMiddleware'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloudkitty (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When calling the CloudKitty API using victoria release I get the following error:
```
(openstack) [stack@cranky ~]$ cloudkitty module list
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
(HTTP 500)
```
In the logs I see:
```
==> cloudkitty-
[Fri Mar 05 15:47:56.212556 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] return self.object_
[Fri Mar 05 15:47:56.212563 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] File "/var/lib/
/paste/
[Fri Mar 05 15:47:56.212572 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] return fix_call(
, **context.
[Fri Mar 05 15:47:56.212581 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] File "/var/lib/
/paste/
[Fri Mar 05 15:47:56.212585 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] val = callable(*args, **kw)
[Fri Mar 05 15:47:56.212595 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] File "/var/lib/
/cloudkitty/
[Fri Mar 05 15:47:56.212604 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] return setup_app()
[Fri Mar 05 15:47:56.212611 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] File "/var/lib/
/cloudkitty/
[Fri Mar 05 15:47:56.212616 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] app = wsgi.Dispatcher
dict)
[Fri Mar 05 15:47:56.212639 2021] [wsgi:error] [pid 29:tid 139710101341952] [remote 10.103.1.12:50752] AttributeError: module 'werkzeug.wsgi' has no attribute
'DispatcherMid
```
I can fix this by changing the way that DispatcherMiddl
I see that Werkzeug==1.0.1 is installed, according to upper constraints:
https:/
If I downgrade Werkzeug to 0.16.0, the DispatcherMiddl
```
(openstack) [stack@cranky ~]$ cloudkitty module list
+------
| Module | Enabled | Priority |
+------
| hashmap | False | 1 |
| noop | True | 1 |
| pyscripts | False | 1 |
```
The regression appears to have occurred with the 0.16.1 release of Werkzeug (used in Ussuri onwards).
The current code uses a deprecated method to import DispatcherMiddl eware, see this for more details:
https:/ /github. com/pallets/ werkzeug/ issues/ 1663