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

Alpine 3.17's nvme-cli returns bugged output #41

Open
richardstephens opened this issue Apr 10, 2023 · 1 comment
Open

Alpine 3.17's nvme-cli returns bugged output #41

richardstephens opened this issue Apr 10, 2023 · 1 comment

Comments

@richardstephens
Copy link
Contributor

When testing on Alpine 3.17, we noticed that we weren't seeing any NVMe disks. We quickly discovered the cause was that it was generating slightly different JSON output to my Debian dev machine.

{
  "Devices":[
    {
      "NameSpace":1,
      "DevicePath":"/dev/nvme0n1",
      "Firmware":"P7CR403",
      "ModelNumber":"CT1000P5PSSD8",
      "SerialNumber":"XXXXX",
      "UsedBytes":-2147483648,
      "MaximumLBA":1953525168,
      "PhysicalSize":-2147483648,
      "SectorSize":512
    }
  ]
}

I've submitted a PR to make the missing fields optional and add the Firmware field, but those negative numbers aren't going to parse into a u64.

It seems this was a bug in nvme-cli at some point - building the latest master from source fixes it. Shipping this works fine for us, but is this something we should try to handle in this project?

@cholcombe973
Copy link
Owner

Well that's interesting... I guess I never expected the firmware to return a negative number for the usage haha. Yeah the thing to do here would be have that be a Result so that it's failable and then return the failure to the caller about a negative usage number.

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

No branches or pull requests

2 participants