Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large silo quota amount could crash nexus #5732

Closed
askfongjojo opened this issue May 10, 2024 · 0 comments · Fixed by #5743
Closed

Large silo quota amount could crash nexus #5732

askfongjojo opened this issue May 10, 2024 · 0 comments · Fixed by #5743
Milestone

Comments

@askfongjojo
Copy link

$ oxide silo quotas update --silo silo11 --storage 9999999999999999999999
error: invalid value '9999999999999999999999' for '--storage <storage>': number too large to fit in target type

For more information, try '--help'.
$ oxide silo quotas update --silo silo11 --storage 999999999999999999999
error: invalid value '999999999999999999999' for '--storage <storage>': number too large to fit in target type

For more information, try '--help'.
$ oxide silo quotas update --silo silo11 --storage 99999999999999999999
error: invalid value '99999999999999999999' for '--storage <storage>': number too large to fit in target type

For more information, try '--help'.
$ oxide silo quotas update --silo silo11 --storage 9999999999999999999
error
Communication Error: error sending request for url (https://oxide.sys.rack2.eng.oxide.computer/v1/system/silos/silo11/quotas): connection closed before message completed
$ oxide silo quotas update --silo silo11 --storage 999999999999999999
{
  "cpus": 16,
  "memory": 85899345920,
  "silo_id": "c7dd16b8-255e-4300-8e52-7396a72caf3e",
  "storage": 999999999999999999
}

The 9999999999999999999 number happens to be not caught by the API validation. It crashed nexus (but it did come back on its own):

thread 'tokio-runtime-worker' panicked at {"msg":"authorize result","v":0,"name":"nexus","level":20,"time":"2024-05-10T16:06:24.007618634Z","hostname":"oxz_nexus_65a11c18-7f59-41ac-b9e7-68
0627f996e7","pid":11207,"actor_id":"906e74cb-eab8-4a87-bda8-2cb0914bf853","authenticated":true,"uri":"/v1/system/silos/silo11/quotas","method":"PUT","req_id":"2ab1446e-c689-4bd1-a979-3850a
4ec63ca","remote_addr":"172.20.17.42:49720","local_addr":"172.30.2.5:443","component":"dropshot_external","name":"65a11c18-7f59-41ac-b9e7-680627f996e7","result":"Ok(())","resource":"Silo {
 parent: Fleet, key: c7dd16b8-255e-4300-8e52-7396a72caf3e, lookup_type: ByName(\"silo11\") }","action":"Modify","actor":"Some(Actor::SiloUser { silo_user_id: 906e74cb-eab8-4a87-bda8-2cb091
4bf853, silo_id: 7bd7623a-68ed-4636-8ecb-b59e3b068787, .. })"}
common/src/api/external/mod.rs:630:28:
called `Result::unwrap()` on an `Err` value: TryFromIntError(())
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[ May 10 16:06:24 Stopping because all processes in service exited. ]
[ May 10 16:06:24 Executing stop method (:kill). ]
@askfongjojo askfongjojo added this to the 9 milestone May 10, 2024
jgallagher added a commit that referenced this issue May 13, 2024
Fixes #5732.

I tried adding a custom `JsonSchema` too but hit a typify issue; left a
link in the TODO comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant