Pie charts on dashboard showing incorrect total and used size for Storage nodes



  • Hey, I am running into an odd problem that just popped up the other day when I updated. The piecharts on the dashboard for old nodes that I updated to the newest fog show the maximum hard drive size as 4 GB and have used 2 GB of it. If I click the pie chart to see the specs of the node it shows the correct numbers for hard drive size and usage. Here are a few screenshots of the problem 0_1447424328610_fogscreenshot1.png 0_1447424511618_fogscreenshot2.png

    Also this problem does not occur on a node with a fresh install



  • Ok, I found the reason. My old nodes are all 32-bit (we run fog on recycled hardware basically), my new node is 64-bit. In the freespace.php a recent change (somewhere within the last few months) made calculating $hdtotal and $hdused use intval(). This made them integers which is not a big deal on 64-bit systems in PHP but in 32-bit systems the harddrive space in bits is higher than the maximum size of an integer. If I restore the old freespace.php file it works fine.

    I don’t know a lot about coding in PHP but is there a way to cast the result of the calculation to a double or long for 32-bit compatibility?



  • Oh wait, duh, for some reason it is maxing out on how much memory is assigned to that number (2147483647 maximum for a 32 bit integer). So somewhere there is a memory setting in apache or php that is wrong (on my servers).



  • Yeah it is strange, I looked at the permissions and it seems fine so I started poking around in the freespace.php file a bit. When I type in the page ( http://workingserver/fog/status/freespace.php?path=L2ltYWdlcw== ) I get {“free”:56375885824,“used”:15166595072} but on the one that is stuck (the apache log said it was suing the same path parameter in the code) I get {“free”:2147483647,“used”:2147483647}. I think that in that php file it is trying to get some sort of default path that is set wrong in my php config somewhere? I’ll do some more digging


  • Senior Developer

    @lhovarter I’m unable to replicate.

    Maybe something is blocking access, and hence limiting the viewable elements of the disk?


 

385
Online

41.5k
Users

12.0k
Topics

113.4k
Posts