Invalid operation nodes/?op=list returns 500 error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Medium
|
Unassigned |
Bug Description
When using maasclient to issue API requests the server suffers a RuntimeError.
#######
# Relevant /var/log/maas entries #
#######
2016-09-07 07:59:26 [maasserver] ERROR: #######
2016-09-07 07:59:26 [maasserver] ERROR: Traceback (most recent call last):
File "/usr/lib/
response = wrapped_
File "/usr/lib/
return view_atomic(*args, **kwargs)
File "/usr/lib/
self.
File "/usr/lib/
yield
File "/usr/lib/
return view_atomic(*args, **kwargs)
File "/usr/lib/
return func(*args, **kwds)
File "/usr/lib/
response = upcall(request, *args, **kwargs)
File "/usr/lib/
response = func(*args, **kwargs)
File "/usr/lib/
request = self.cleanup_
File "/usr/lib/
for k in sanitized.keys():
RuntimeError: dictionary changed size during iteration
2016-09-07 07:59:26 [-] 127.0.0.1 - - [07/Sep/
#######
# dpkg -l '*maas*'|cat #
#######
ubuntu@
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii maas 2.0.0+bzr5189-
ii maas-cli 2.0.0+bzr5189-
un maas-cluster-
ii maas-common 2.0.0+bzr5189-
ii maas-dhcp 2.0.0+bzr5189-
ii maas-dns 2.0.0+bzr5189-
ii maas-proxy 2.0.0+bzr5189-
ii maas-rack-
ii maas-region-api 2.0.0+bzr5189-
ii maas-region-
un maas-region-
un python-django-maas <none> <none> (no description available)
un python-maas-client <none> <none> (no description available)
un python-
ii python3-django-maas 2.0.0+bzr5189-
ii python3-maas-client 2.0.0+bzr5189-
ii python3-
#######
# Steps to reproduce: #
#######
Python 3.5.2 (default, Sep 7 2016, 00:46:12)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from maasclient import MaasClient
>>> from maasclient.auth import MaasAuth
>>> auth = MaasAuth("http://
>>> client = MaasClient(auth)
>>> ret = client.
>>> ret.raise_
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/
raise HTTPError(
requests.
It's unclear to me if this is a maas bug or a django piston error. But given that I don't know django or piston, I'll post this here until told otherwise.
Changed in maas: | |
milestone: | 2.1.0 → 2.1.1 |
Changed in maas: | |
milestone: | 2.1.1 → 2.1.2 |
Changed in maas: | |
milestone: | 2.1.2 → 2.1.3 |
nodes/?op=list is not a valid endpoint in MAAS 2.0 - see the API docs for Nodes here: https:/ /maas.ubuntu. com/docs2. 0/api.html# nodes, you want to just list the nodes by doing a GET on http:// 10.90.0. 2/MAAS/ api/2.0/ nodes/ (with appropriate headers)
The list operation is a MAAS 1.9 concept - the API has actually changed major version between MAAS 1.9 and 2.0 , notice the 1.0 changed to 2.0 in the URL.
If you have code that uses the API, you will likely have to rewrite large parts of it.
However there is still probably a bug here, in that this shouldn't really cause a server error.