Snap management error logs should include the unsupported computer IDs

Bug #2072985 reported by Kyle Metscher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Landscape Server
Fix Released
High
Bill Kronholm

Bug Description

When using the snap management features of the new UI (23.10+) it is possible to attempt snap management on hosts that do not support it. This results in an unspecified "Server error" message on the UI, and an unclear error message / stack trace in the API logs:

api-2 ERR Traceback (most recent call last):
api-2 ERR File \"/opt/canonical/landscape/canonical/landscape/api/resource.py\", line 197, in handle_path
api-2 ERR body, status = await call_handler(handler, request)
api-2 ERR File \"/opt/canonical/landscape/canonical/landscape/api/helpers.py\", line 685, in call_handler
api-2 ERR return await handler(*args, **kwargs)
api-2 ERR File \"/opt/canonical/landscape/canonical/landscape/api/jwt_auth.py\", line 160, in wrapper
api-2 ERR return await handler(request, principal, *args, **kwargs)
api-2 ERR File \"/opt/canonical/landscape/canonical/landscape/api/helpers.py\", line 668, in wrapper
api-2 ERR return await handler(
api-2 ERR File \"/opt/canonical/landscape/canonical/landscape/api/helpers.py\", line 504, in wrapper
api-2 ERR return await handler(request, principal, selection, *args, **kwargs)
api-2 ERR File \"/opt/canonical/landscape/canonical/landscape/api/snap.py\", line 67, in snaps_action_handler
api-2 ERR unsupported_computers = \", \".join(
api-2 ERR TypeError: 'method' object is not iterable

Without more information it is difficult to determine where the issue occurred. Ideally, error handlers should exist for snap management that include the nature of the problem to appear in a modal / error message on the UI as well as in the logs along with a 500 response code (if appropriate).

To reproduce, attempt to install a snap on a Landscape client running a version older than 23.02.

Tags: snap
information type: Proprietary → Public
Bill Kronholm (wck0)
Changed in landscape:
status: New → Confirmed
milestone: none → 24.10-beta.4
Bill Kronholm (wck0)
Changed in landscape:
importance: Undecided → High
Bill Kronholm (wck0)
Changed in landscape:
assignee: nobody → Bill Kronholm (wck0)
status: Confirmed → In Progress
Bill Kronholm (wck0)
Changed in landscape:
status: In Progress → Fix Committed
Bill Kronholm (wck0)
Changed in landscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.