oxidecomputer / oxidecomputer/omicron

Nexus API returns 400 when trying to add a switchport IP that's already assigned

Open
#10,023 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api bug networking nexus
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

When trying to add an IP address from an address-lot to a switchport, a 400 (Bad Request) is returned if the IP is already assigned to a switchport. This is misleading, as it indicates there was something structurally/semantically wrong with the request rather than the state of the object being the issue. It would make more sense to return a different response code that aligns better to the situation, e.g. 409 (Conflict).

Command to trigger 400 error (after fd00:101::2/126 is already used):
oxide system networking addr add --rack c7efde80-847a-4ab4-b855-5a0579cfa268 --switch switch0 --port qsfp0 --addr fd00:101::2/126 --lot initial-infra-v6 when fd00:101::2/126

Return:

Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "024de8d5-50ee-4055-b9f2-2557d0e31ff1", "content-length": "128", "date": "Tue, 1
0 Mar 2026 20:05:52 GMT"}; value: Error { error_code: Some("InvalidRequest"), message: "address unavailable", request_id: "024de8d5-50ee-4055-b9f2-2557d0e31ff1" }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the oxide system networking addr add API entry point and trace the handling of an address that is already assigned to a switchport. Look for existing API error-response tests around this command. Done means the same conflict returns an appropriate conflict response, such as 409, rather than 400, while other invalid requests retain their current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.