Image download on MAAS 3.6.1 is slow
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MAAS |
Fix Committed
|
High
|
Jacopo Rota | ||
| 3.6 |
Won't Fix
|
High
|
Unassigned | ||
| 3.7 |
Fix Released
|
High
|
Jacopo Rota | ||
Bug Description
Describe the bug:
On a freshly installed MAAS 3.6.1 on Ubuntu 24.04LTS, downloading image is extremely slow (Didn't get pas 1% inside 30 minutes) while download those image from curl command is under 1s.
Steps to reproduce:
- Fresh install of 3.6.1 HA on 3 nodes
- Select a new image to download.
- Wait, and after 30 minutes, progress is still at 1%
- journalctl logs shows this:
Aug 26 17:31:21 maas-013 maas-regiond[3367]: temporalio.
Aug 26 17:31:21 ca3-maas-013 maas-regiond[3367]: Traceback (most recent call last):
Aug 26 17:31:21 ca3-maas-013 maas-regiond[3367]: File "/snap/
Aug 26 17:31:21 maas-013 maas-regiond[3367]: result = await impl.execute_
Aug 26 17:31:21 maas-013 maas-regiond[3367]: ^^^^^^^
Aug 26 17:31:21 maas-013 maas-regiond[3367]: File "/snap/
Aug 26 17:31:21 maas-013 maas-regiond[3367]: return await input.fn(
Aug 26 17:31:21 maas-013 maas-regiond[3367]: ^^^^^^^
Aug 26 17:31:21 maas-013 maas-regiond[3367]: File "/snap/
Aug 26 17:31:21 maas-013 maas-regiond[3367]: raise ApplicationError(
Aug 26 17:31:21 maas-013 maas-regiond[3367]: temporalio.
Aug 26 17:31:22 maas-013 maas-regiond[6796]: twisted.
Aug 26 17:31:22 maas-013 maas-rackd[3551]: Uninitialized: [info] ClusterClient connection established (HOST:IPv6Addre
Aug 26 17:31:22 maas-013 maas-regiond[6796]: twisted.
Aug 26 17:31:22 maas-013 maas-rackd[3551]: Uninitialized: [info] ClusterClient connection established (HOST:IPv6Addre
Expected behavior (what should have happened?):
Image get downloaded inside a few minutes.
Actual behavior (what actually happened?):
Images download is stuck and not progressing.
MAAS version and installation type (deb, snap):
3.6.1 snap
MAAS setup (HA, single node, multiple regions/racks):
HA, 3 nodes.
Host OS distro and version:
Ubuntu 24.04.02 LTS
Additional context:
Running inside VMware VMs.
Related branches
- Jacopo Rota: Approve
-
Diff: 27 lines (+13/-3)1 file modifiedsrc/maasserver/workflow/bootresource.py (+13/-3)
- Jacopo Rota: Approve
-
Diff: 29 lines (+14/-4)1 file modifiedsrc/maastemporalworker/workflow/bootresource.py (+14/-4)
- Alessandro Marcolini: Approve
-
Diff: 27 lines (+13/-3)1 file modifiedsrc/maastemporalworker/workflow/bootresource.py (+13/-3)
- Jacopo Rota: Approve
-
Diff: 12 lines (+1/-0)1 file modifieddebian/control (+1/-0)
- Jacopo Rota: Approve
-
Diff: 12 lines (+1/-0)1 file modifieddebian/control (+1/-0)
- Jacopo Rota: Approve
-
Diff: 191 lines (+37/-40)7 files modifiedrequired-packages/base (+1/-0)
required-packages/forbidden (+0/-1)
snap/snapcraft.yaml (+1/-0)
src/maasserver/workflow/api_client.py (+21/-29)
src/maasserver/workflow/bootresource.py (+11/-8)
src/tests/maasserver/workflow/test_bootresource.py (+2/-2)
utilities/check-imports (+1/-0)
- Javier Fuentes: Approve
- Stamatis Katsaounis: Approve
-
Diff: 12 lines (+1/-0)1 file modifieddebian/control (+1/-0)
- Jacopo Rota: Approve
-
Diff: 174 lines (+31/-37)6 files modifiedrequired-packages/base (+1/-0)
required-packages/forbidden (+0/-1)
snap/snapcraft.yaml (+1/-0)
src/maastemporalworker/workflow/api_client.py (+21/-29)
src/maastemporalworker/workflow/bootresource.py (+7/-7)
utilities/check-imports (+1/-0)
- Jacopo Rota: Approve
-
Diff: 182 lines (+40/-43)6 files modifiedrequired-packages/base (+1/-0)
required-packages/forbidden (+0/-1)
snap/snapcraft.yaml (+1/-0)
src/maasserver/workflow/api_client.py (+24/-34)
src/maasserver/workflow/bootresource.py (+11/-8)
utilities/check-imports (+3/-0)
- Alexsander de Souza: Approve
- Stamatis Katsaounis: Needs Fixing
-
Diff: 174 lines (+31/-37)6 files modifiedrequired-packages/base (+1/-0)
required-packages/forbidden (+0/-1)
snap/snapcraft.yaml (+1/-0)
src/maastemporalworker/workflow/api_client.py (+21/-29)
src/maastemporalworker/workflow/bootresource.py (+7/-7)
utilities/check-imports (+1/-0)
| Changed in maas: | |
| assignee: | nobody → Jacopo Rota (r00ta) |
| Changed in maas: | |
| status: | Triaged → Fix Committed |
| Changed in maas: | |
| milestone: | 3.7.x → 3.8.x |
| tags: | removed: bug-council |

The error `ClientPayloadE rror: Response payload is not completed` is raised by the aiohttp framework due to some internal race condition. This framework is used by MAAS as an async HTTP client, and this exception is observed only when doing chunked HTTP transfers like the Image Sync does.
There was an upstream bug (https:/ /github. com/aio- libs/aiohttp/ issues/ 4581) to investigate this, and some attempts to fix it were made. It was closed on Aug 2024 after the issue was no longer reproducible by the maintainer. Although there are still reports of this error on newer releases, the issue stays closed because of the lack of a better reproducer.
MAAS options:
1) backport the python-aiohttp package from Questing (v3.11.16).
Noble has the 3.9.1 version and the bug was closed at version 3.10.5, so this package should contain all the attempts to fix this issue made by the upstream maintainer.
2) drop aiohttp and use httpx instead.
httpx is used by API v3 tests, so it's already a dependency of MAAS. async HTTP clients are used in a few places in MAAS, and in most cases replacing the framework is trivial. the image download workflow is the most advanced use case, but we have an implementation of it using httpx in site-manager, so there's a reference implementation that we can use.