Async API operations don't return error codes

Bug #1763289 reported by Robert Ancell on 2018-04-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Synchronous snapd API operations return an error string and optional "kind" on error:

    "type": "error"
    "status-code": 401,
    "status": "Unauthorized",
    "result": {
        "message": "access denied",
        "kind": "login-required",

Async operations can fail (as returned from /v2/changes):

    "status": "Error",
    "err": "Error text"

There is no error kind reported here, so a client can't tell what caused the async operation to fail. Suggest solution is to add an "errKind" field or similar to this object.

Robert Ancell (robert-ancell) wrote :

I discussed this with John Lenton at the Budapest sprint, but I forgot to open a bug it seems.

Gustavo Niemeyer (niemeyer) wrote :

What specific operation would you be interested in differentiating?

Robert Ancell (robert-ancell) wrote :

Operations that are useful to differentiate:
- (install/remove) Abort (i.e. calling /v2/changes/[id] with "action": "abort")
- (install) Download failure (e.g. no network connection)
- (install) Insufficient disk space
- (install/remove) I/O failures (e.g. hard disk failures)

Michael Vogt (mvo) on 2018-11-15
Changed in snapd:
importance: Undecided → High
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers