oxidecomputer / oxidecomputer/omicron
Improve error message from MGS when attempting to set wrong active slot
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 572
- Forks
- 97
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 96
Description
When attempting to set the wrong RoT bootloader slot as active, I get the following response from MGS
error: Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "f843617f-4a97-4e01-8943-920f33b9c38f", "content-length": "257", "date": "Tue, 17 Jun 2025 00:42:33 GMT"}; value: Error { error_code: Some("RequestUnsupportedForComponent"), message: "error communicating with SP SpIdentifier { typ: Switch, slot: 0 }: Error response from SP: unsupported request for this SP component", request_id: "f843617f-4a97-4e01-8943-920f33b9c38f" }
Or from faux-mgs
$ ./target/debug/faux-mgs --sp-sim-addr [::1]:48938 component-active-slot stage0 --set 0 -p
Jun 17 01:08:53.054 INFO creating SP handle on to talk to SP simulator at [::1]:48938, component: faux-mgs
Jun 17 01:08:53.054 INFO initial discovery complete, addr: [::1]:48938, component: faux-mgs
Error: Error response from SP: unsupported request for this SP component
This message implies that you can't set the active slot for the RoT bootloader via MGS, when in reality you're just trying to set the wrong slot.
Working fine when you set the correct slot :)
$ ./target/debug/faux-mgs --sp-sim-addr [::1]:48938 component-active-slot stage0 --set 1 -p
Jun 17 01:09:09.211 INFO creating SP handle on to talk to SP simulator at [::1]:48938, component: faux-mgs
Jun 17 01:09:09.211 INFO initial discovery complete, addr: [::1]:48938, component: faux-mgs
set active slot for SpComponent { id: "stage0" } to 1
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 with the faux-mgs component-active-slot entry point and the MGS error path exercised by setting stage0 to slot 0. Reproduce both the incorrect-slot and correct-slot commands, then trace how the SP response is translated into the displayed message. Done means the incorrect slot produces an accurate actionable error while the valid slot continues to work.
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