Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    4

    Default StatsBar::stat JSON Error

    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. #2
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,597

    Default

    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.
    -Nick
    cPanel Inc.

    Need support? Submit a request here. Complimentary support is available to all license holders regardless of where you purchased your license.
    Need a complimentary support account? Create one here.

Similar Threads & Tags
Similar threads

  1. JSON parsed error email accounts client
    By diego.rodrigues in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-25-2011, 11:54 AM
  2. API2 and JSON
    By mpuk in forum cPanel Developers
    Replies: 1
    Last Post: 04-12-2011, 07:17 AM
  3. XML or JSON API?
    By Azavia in forum cPanel Developers
    Replies: 3
    Last Post: 05-21-2010, 12:16 PM
  4. x3mail theme statsbar
    By Brandonm in forum Themes and Branding
    Replies: 10
    Last Post: 07-15-2009, 02:31 PM
  5. Php-json
    By gahelm in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 09-28-2006, 03:38 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube