Closed happycouak closed 3 years ago
Hiya, I'm seeing the same issue with 2.9.1 and libmaas.
Our call is a bit different, it happens when we use the release
method on a machine.
for machine in machines:
if machine.status_name != 'Ready':
print("Releasing machine " + machine.hostname + " from MaaS")
machine.release(wait=False)
Traceback (most recent call last):
File "release_machines.py", line 51, in <module>
main()
File "release_machines.py", line 44, in main
machine.release(wait=False)
File "/usr/local/lib/python3.7/site-packages/maas/client/utils/maas_async.py", line 43, in wrapper
result = eventloop.run_until_complete(result)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/site-packages/maas/client/viscera/machines.py", line 662, in release
self._reset(await self._handler.release(**params))
File "/usr/local/lib/python3.7/site-packages/maas/client/bones/__init__.py", line 307, in __call__
response = await self.bind(**params).call(**data)
File "/usr/local/lib/python3.7/site-packages/maas/client/bones/__init__.py", line 460, in dispatch
self.action.method, uri, data=body, headers=_prefer_json(headers)
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 504, in _request
await resp.start(conn)
File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 847, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 591, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError
Thank you for filing this issue, and to those of you who filed issues that are duplicates of this issue. This has additionally been raised in the MAAS discourse, and as bugs on MAAS itself.
I'm glad to share that this issue has now been resolved, and was caused by a bug in Twisted - details on Launchpad and in (upstream's trac)[https://twistedmatrix.com/trac/ticket/10084].
Those of you using MAAS from debian packages should get the fixed version after upgrading your systems (e.g. apt update; apt-full-upgrade
), for those using MAAS from a snap - we have pushed a version of MAAS which incorporates the new twisted package to 2.9/candidate
.
Using restore_*_configuration() return the following error:
Code snippet:
This code worked some times ago, I have tried some older version of python3, libmaas and aiohttp without success.
Among things that could had potentially changed, the MaaS server is now in 2.9.1 (9153-g.66318f531). Previous successfull runs where against MaaS 2.7 (maybe 2.6).
python-libmaas 0.6.6 aiohttp 3.7.3 async-timeout 3.0.1