Bug #16577
closed
String::to_gb fails to parse "0 Bytes"
Added by Brandon Weeks almost 8 years ago.
Updated about 6 years ago.
Description
On some Ubuntu 14.04 boxes with swap disabled facter returns a value of "0 bytes" for the swapfree fact. This is unparseable by String::to_gb which causes /statistics to show an error.
weeks@host:~$ facter swapfree
0 bytes
weeks@host:~$
Files
Do you by any chance have a back trace or error message? That would help to debug.
Attached!
Minimized test case:
"0 bytes".to_gb
- Status changed from New to Assigned
- Assignee set to Marek Hulán
- Translation missing: en.field_release set to 160
Thanks for the trace, that helped me. It's partly caused by #2314 and partly because we don't recognize Bytes as a unit. Also we have generic rescue which hides the real cause. The fix should be easy.
- Related to Bug #2314: Smaller grains for VM memory/RAM choice needed added
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3854 added
- Translation missing: en.field_release deleted (
160)
There are two parts of this bug. First is thta "Bytes" are not recognized as unit. Second is that the Foreman::SIZE was removed but remained on line which is triggered in this case. If we only fix matching, it will still fail for "0 Bytes" string because of this. If you prefer I can split this into 2 PRs, second would be only replacing the Foreman::SIZE so it would be safe to get it into 1.13.
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
- Translation missing: en.field_release set to 160
Also available in: Atom
PDF