oxidecomputer / omicron

Omicron: Oxide control plane
Mozilla Public License 2.0
244 stars 38 forks source link

need to return better error message when specifying incorrect rack id #6393

Open elaine-oxide opened 1 month ago

elaine-oxide commented 1 month ago

I am running a4x2 with the following combination of commits:

I am using the version of the Oxide CLI from https://github.com/oxidecomputer/oxide.rs/pull/795, with commit 6fbbd5568289e95432ed7adfb6808c3d3cd0e3f0:

$ oxide version
Oxide CLI 0.6.1+20240710.0
Built from commit: 6fbbd5568289e95432ed7adfb6808c3d3cd0e3f0 
Oxide API: 20240821.0

This is a valid command under the above version of the Oxide CLI:

$ oxide system networking bgp auth --rack 51becb40-1818-4ea0-b278-2af26bc8bbe4 --switch switch1 --port qsfp0 --peer <IPv4 address> --authstring <password>

I tried using an invalid rack id, where I used the above rack id, but I changed the last character to a different value (this other value doesn't actually exist, because there is only one rack, which has the rack id used above).

$ oxide system networking bgp auth --rack 51becb40-1818-4ea0-b278-2af26bc8bbe5 --switch switch1 --port qsfp0 --peer <IPv4 address> --authstring <password>
port qsfp0 not found for rack switch1 switch 51becb40-1818-4ea0-b278-2af26bc8bbe5

The above error message could instead indicate that the provided rack id is invalid, as that would be more accurate than indicating that port qsfp0 not found, and would allow the user to identify the actual issue better.

Also, the error message as is implies that the id shown belongs to rack switch1 switch.

elaine-oxide commented 1 month ago

I also tried this invalid command, where I specified a valid rack id, but I specified an invalid port name (I changed qsfp0 in the above valid command to qsfp2 in the below invalid command, where qsfp2 doesn't exist on my system).

$ oxide system networking bgp auth --rack 51becb40-1818-4ea0-b278-2af26bc8bbe4 --switch switch1 --port qsfp2 --peer <IPv4 address> --authstring <password>
port qsfp2 not found for rack switch1 switch 51becb40-1818-4ea0-b278-2af26bc8bbe4

The error message as is also implies that the id shown belongs to rack switch1 switch.