oxidecomputer / oxidecomputer/omicron
Fetch switch port lldp neighbors API incorrectly returns 500 error when no record is found
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
The issue is seen on both rack2 and rack3 (the latter running on r14). Here is an example of the error:
$ RACK_ID=$(oxide api /v1/system/hardware/racks | jq -r .items[0].id)
$ echo $RACK_ID
de608e01-b8e4-4d93-b972-a7dbed36dd22
$ oxide api /v1/system/hardware/rack-switch-port/$RACK_ID/switch0/qsfp0/lldp/neighbors
error; status code: 500 Internal Server Error
{
"error_code": "Internal",
"message": "Internal Server Error",
"request_id": "ca53c840-b2cf-4d9c-90e2-da47057e7ae8"
}
error
Nexus log shows that it's actually a 404 error:
04:25:28.047Z INFO 65a11c18-7f59-41ac-b9e7-680627f996e7 (dropshot_external): request completed
error_message_external = Internal Server Error
error_message_internal = failed to get neighbor list for switch0/qsfp0: Error Response: status: 404 Not Found; headers: {"content-type": "application/json", "x-request-id": "bb315203-4219-478e-805c-24b4ec30bd41", "content-length": "130", "date": "Tue, 03 Jun 2025 04:25:28 GMT"}; value: Error { error_code: Some("no such interface: qsfp0/0"), message: "Not Found", request_id: "bb315203-4219-478e-805c-24b4ec30bd41" }
file = /home/build/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/dropshot-0.16.2/src/server.rs:855
latency_us = 316829
local_addr = 172.30.2.5:443
method = GET
remote_addr = 172.20.17.42:51159
req_id = ca53c840-b2cf-4d9c-90e2-da47057e7ae8
response_code = 500
uri = /v1/system/hardware/rack-switch-port/de608e01-b8e4-4d93-b972-a7dbed36dd22/switch0/qsfp0/lldp/neighbors
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided oxide API request for the rack switch-port LLDP neighbors endpoint and compare its response with the Nexus log. Trace how the upstream 404 for a missing interface is handled; done means this condition is exposed as a 404 response instead of being converted to a 500 Internal Server Error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100