The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    1
    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,426
    Likes Received:
    2
    Trophy Points:
    38
    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