[SOLVED] BUG found, where to post?

slp

New Member
Feb 17, 2021
1
0
1
Germany
Hi, I´ve found a bug in one of the perl format helpers, used by

Bash:
pvesh get /cluster/resources

The file is: /usr/share/perl5/PVE/Format.pm
Line: 75

There is a method render_bytes which expects the second parameter to be INT $precision, but instead receives some STRING "HASH(0x123456789)".
We use the pvesh get to extract information for our monitoring, which results in bad disk space sizes (see attached png).

A FIX for now is, to remove the $precision from sprintf and just use the hardcoded fallback value 2.
 

Attachments

  • photo_2021-02-17_13-36-58.jpg
    photo_2021-02-17_13-36-58.jpg
    6.7 KB · Views: 12
The usual place would be our bugtracker, but in this case it should be a simple fix, as this change was introduced very recently. I'll prepare a patch :)

Edit: As a tip if you use it for monitoring: you can specify --output-format json as a parameter to pvesh to get raw json, might be easier for parsing and also works in the current version.
 
Last edited:
  • Like
Reactions: slp

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!