REST API POST to /v2/snaps with unknown snap results in 500 "Internal Server Error"
Bug #2024858 reported by
Mitch Burton
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Committed
|
Undecided
|
Zeyad Gouda |
Bug Description
Making a POST request to the Snapd REST API with a snap name that it cannot find results in a 500 error and an uninformative message:
# curl -sS --unix-socket /run/snapd.socket http://
-d '{"action": "install", "snaps": ["spamandeggs", "hello"]}' -H "Content-Type: application/json" \
| jq
{
"type": "error",
"status-code": 500,
"status": "Internal Server Error",
"result": {
"message": "store.SnapNotFound with 2 snaps"
}
}
404 is probably a more valuable HTTP response code, but I'm more concerned that there's no indication of which snap was not found.
description: | updated |
Changed in snapd: | |
status: | New → Confirmed |
Changed in snapd: | |
assignee: | nobody → Zeyad Gouda (zeyadgouda) |
status: | Confirmed → In Progress |
Changed in snapd: | |
status: | In Progress → Fix Committed |
To post a comment you must log in.
Hello Mitch, This PR should fix this bug https:/ /github. com/snapcore/ snapd/pull/ 12945. Thank you for reporting!