Skip to content

[Veeam] Unknown paths, sub-collections and VM/cluster ids return HTTP 500 instead of 404; malformed host id resolves to host 0 #8157

Closed

Description

@ArnauGabrielAtienza

OpenNebula oVirt API wrapper (ovirtapi-server, opennebula-ovirtapi-7.4.0-1.el9 + the 07.09.26 patch), compared against OLVM.

Summary

Requests for unknown paths, unimplemented sub-collections and unknown VM or cluster ids return HTTP 500 Internal Server Error instead of 404 Not Found. The error bodies use the correct oVirt fault format; only the status code is wrong. The underlying Sinatra::NotFound and "not found" lookups are reported as server errors.

Behaviour is also inconsistent across collections, and a malformed id silently resolves to host 0.

Request | OpenNebula | OLVM (expected) -- | -- | -- GET /nonexistent | 500 Sinatra::NotFound | 404 GET /hosts/{id}/statistics (advertised in host.link[]) | 500 Sinatra::NotFound | 200 with data (see #32) GET /hosts/{id}/nics (advertised in host.link[]) | 500 Sinatra::NotFound | 200 with data GET /vms/99999999-0000-0000-0000-000000000000 | 500 Unable to retrieve VM 9999… | 404 GET /clusters/99999999-0000-0000-0000-000000000000 | 500 Error obtaining OpenNebula cluster: 9999… | 404 GET /hosts/99999999-0000-0000-0000-000000000000 | 404 {} ✅ (but an empty body, no fault) | 404 GET /hosts/not-a-uuid | 200, returns host 0 (opennebula-node1) | 404

Note that GET /vms/00000000-0000-0000-0000-000000000000 correctly returns 404 VM 0 not found, while a different unknown VM id returns 500.

Response examples

OpenNebula GET /ovirt-engine/api/nonexistent:

HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{"fault":{"reason":"Operation Failed","detail":"Internal server error. (Sinatra::NotFound: Sinatra::NotFound)"}}

OpenNebula GET /ovirt-engine/api/vms/99999999-0000-0000-0000-000000000000:

HTTP/1.1 500 Internal Server Error

{"fault":{"reason":"Operation Failed","detail":"Unable to retrieve VM 99999999000000000000000000000000"}}

OpenNebula GET /ovirt-engine/api/hosts/not-a-uuid:

HTTP/1.1 200 OK

{"name":"opennebula-node1.robofish.local","address":"opennebula-node1.robofish.local","id":"00000000-0000-0000-0000-000000000000", …}

OLVM, same kind of requests:

GET /ovirt-engine/api/nonexistent
HTTP/2 404
Content-Type: text/html;charset=UTF-8

RESTEASY003210: Could not find resource for full path: https://…/ovirt-engine/api/v4/nonexistent

GET /ovirt-engine/api/hosts/00000000-0000-0000-0000-000000000000
HTTP/2 404
Content-Length: 0

Impact

A client can't tell "object doesn't exist" from "server failed". A 500 is typically retried, so a deleted VM or cluster turns into a retry loop and a misleading "server error" in logs instead of a clean "not found". The not-a-uuid → host 0 case can make a malformed id act on the wrong host.

Expected

  • 404 (oVirt fault body) for unknown paths, unimplemented sub-collections and unknown or malformed ids; 5xx only for real server failures.

  • Don't advertise links (host.link[]) to sub-collections that aren't implemented.

Logs

onl-status-codes-evidence.zip contains:

  • onl-status-requests.txt: raw requests and responses (headers + body) for every row above. Session cookies are redacted.

  • olvm-reference-requests.txt: the OLVM equivalents for comparison.

Found while investigating #32.

Tracked as TFS #1731095 (Risk — Severity 4 - Low).

> 🤖 AI-generated — this issue was created by an AI assistant (Claude) and should be reviewed by a human before it is relied upon.

OpenNebula oVirt API wrapper (ovirtapi-server, opennebula-ovirtapi-7.4.0-1.el9 + the 07.09.26 patch), compared against OLVM.

Summary

Requests for unknown paths, unimplemented sub-collections and unknown VM or cluster ids return HTTP 500 Internal Server Error instead of 404 Not Found. The error bodies use the correct oVirt fault format; only the status code is wrong. The underlying Sinatra::NotFound and "not found" lookups are reported as server errors.

Behaviour is also inconsistent across collections, and a malformed id silently resolves to host 0.

Request OpenNebula OLVM (expected)
GET /nonexistent 500 Sinatra::NotFound 404
GET /hosts/{id}/statistics (advertised in host.link[]) 500 Sinatra::NotFound 200 with data (see #32)
GET /hosts/{id}/nics (advertised in host.link[]) 500 Sinatra::NotFound 200 with data
GET /vms/99999999-0000-0000-0000-000000000000 500 Unable to retrieve VM 9999… 404
GET /clusters/99999999-0000-0000-0000-000000000000 500 Error obtaining OpenNebula cluster: 9999… 404
GET /hosts/99999999-0000-0000-0000-000000000000 404 {} ✅ (but an empty body, no fault) 404
GET /hosts/not-a-uuid 200, returns host 0 (opennebula-node1) 404

Note that GET /vms/00000000-0000-0000-0000-000000000000 correctly returns 404 VM 0 not found, while a different unknown VM id returns 500.

Response examples

OpenNebula GET /ovirt-engine/api/nonexistent:

HTTP/1.1 500 Internal Server Error
Content-Type: application/json

{"fault":{"reason":"Operation Failed","detail":"Internal server error. (Sinatra::NotFound: Sinatra::NotFound)"}}

OpenNebula GET /ovirt-engine/api/vms/99999999-0000-0000-0000-000000000000:

HTTP/1.1 500 Internal Server Error

{"fault":{"reason":"Operation Failed","detail":"Unable to retrieve VM 99999999000000000000000000000000"}}

OpenNebula GET /ovirt-engine/api/hosts/not-a-uuid:

HTTP/1.1 200 OK

{"name":"opennebula-node1.robofish.local","address":"opennebula-node1.robofish.local","id":"00000000-0000-0000-0000-000000000000", …}

OLVM, same kind of requests:

GET /ovirt-engine/api/nonexistent
HTTP/2 404
Content-Type: text/html;charset=UTF-8

RESTEASY003210: Could not find resource for full path: https://…/ovirt-engine/api/v4/nonexistent

GET /ovirt-engine/api/hosts/00000000-0000-0000-0000-000000000000
HTTP/2 404
Content-Length: 0

Impact

A client can't tell "object doesn't exist" from "server failed". A 500 is typically retried, so a deleted VM or cluster turns into a retry loop and a misleading "server error" in logs instead of a clean "not found". The not-a-uuid → host 0 case can make a malformed id act on the wrong host.

Expected

  • 404 (oVirt fault body) for unknown paths, unimplemented sub-collections and unknown or malformed ids; 5xx only for real server failures.
  • Don't advertise links (host.link[]) to sub-collections that aren't implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions