Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

StatsBar::stat JSON Error

Discussion in 'cPanel Developers' started by higherlogic, Jul 15, 2010.

  1. higherlogic

    higherlogic Member

    Joined:
    Mar 5, 2009
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    51
    When using StatsBar::stat via the API, the returned JSON string is invalid, throwing the following error:

    JSON_ERROR_SYNTAX

    An example of the string returned:

    Code:
    {
    	"cpanelresult":
    	{
    		"data":
    		[{
    			"percent10":0,
    			"normalized":1,
    			"percent5":0,
    			"percent20":0,
    			"item":"Disk Usage",
    			"zeroisunlimited":1,
    			"name":"diskusage",
    			"langkey":"INDXDiskUsage",
    			"_maxed":1,
    			"_count":579.99,
    			"units":"MB",
    			"module":"Quota",
    			"_max":unlimited,
    			"percent":0,
    			"count":579.99,
    			"max":"unlimited MB",
    			"id":"diskusage"
    		}],
    		"event":
    		{
    			"result":1
    		},
    		"module":"StatsBar",
    		"apiversion":2,
    		"func":"stat"
    	}
    }
    The error comes from this part:

    Code:
    "_max":unlimited
    Which should be:

    Code:
    "_max":"unlimited"
     
  2. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,480
    Likes Received:
    29
    Trophy Points:
    158
    cPanel Access Level:
    DataCenter Provider
    This is a bug in YAML::Syck/JSON::Syck perl module. We have reported the problem here:

    https://rt.cpan.org/Ticket/Display.html?id=50227

    We will begin shipping a patched version of this module in BETA today. We will continue to do so until this is worked out on CPAN.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice