Last visits graph - IO ERROR #2032

Ok, I’ve narrowed down the problem to the double backslash escaping the double quotes. It works when there’s a single backslash.

What’s the value of magic_quotes_gpc and magic_quotes_runtime in your php.ini?

[quote=vipsoft @ May 15 2009, 05:24 PM]Ok, I’ve narrowed down the problem to the double backslash escaping the double quotes. It works when there’s a single backslash.

What’s the value of magic_quotes_gpc and magic_quotes_runtime in your php.ini?[/quote]
I have:

magic_quotes_gpc = Off
magic_quotes_runtime = Off

Sorry, I was speculating. That’s not the root cause…

Getting closer…

Please report the output of the following:

<?php
echo json_encode('test("http://localhost")');
?>

(note: this should fail if you’re running anything less than 5.2.0.)

Yep, it failed as you said (I have 5.1.6). But I did:

<?php
require('libs/upgradephp/upgrade.php');
echo json_encode('test("http://localhost")');
?>

and got:

"test(\\"http:\/\/localhost\\")"

I’m still trying to figure out why users with 5.2.6 and 5.2.9 are having problems.

failed for me to. (php 5.2.9-pl2)
it just struck me like a lightning, it can not work because my php build is lacking json support.
recompiling php with json support right now.
i will report the outcome after testing it again with json support.

maybe add a check for json support to the install process?

Ok… but don’t forget the 5.1.6 people ! style_emoticons/<#EMO_DIR#>/tongue.gif

Please test out this patch.

http://dev.piwik.org/trac/changeset/1122

nikosch: if you don’t have json compiled in (i believe you said you’re using 5.2.9), piwik uses the json_encode defined in libs/upgradephp/upgrade.php. This explains why you have the same results as the 5.1.6 users.

[quote=vipsoft @ May 15 2009, 07:09 PM]Please test out this patch.

http://dev.piwik.org/trac/changeset/1122[/quote]

It works!

Thanks style_emoticons/<#EMO_DIR#>/wink.gif

after recompiling php with json support, it works as expected.
Problem solved for me (without your patch).
I believe this happened because it is assumed that the fairly recent php version already is json capable.

keywords for people searching this forum for a solution to this specific problem:
gentoo php json useflag compile json_encode

So the json problem seems to be solved… can someone please go back to the problem that was starting this thread (IO ERROR #2032)?
Does anyone know why i get this error?

It means the open-flash-chart.swf wasn’t able to decode the JSON encoded data stream from the piwik server.

With the patch, the server should be encoding it in a way that OFC won’t choke on it.

this morning (in France :slight_smile: ) after manual update 0.2.37 it works fine

Thanks a lot

No, it is not a problem of parsing the json… i tried to find out whats happening and when calling the widget via the given url i get a 500, in the logs there is only one entry with “Premature end of headers” and nothing else.

i have 5 sites set up in piwik, but there is only one site which shows this problem. when showing the stats of the 4 other sites this widget works perfect.

chricke: and you’re only now sharing that detail?

Is this a problem on your dashboard or when widgetized?

because i host piwik on an managed server i do not have direct access to the logs - so it took some time to get that info.

i always get this error when i try to use this graph regardless the way it’s used. but only on 1 of 5 sites i use piwik for.

chricke: Can you post a URL to your Piwik? Can you try the URL I posted earlier but change the date range to something shorter, e.g., 2009-05-14,2009-05-15?

i called this url

http://tracker.picfu.net/index.php?module=VisitsSummary&action=getEvolutionGraph&columns[]=nb_visits&idSite=2&period=day&date=2009-05-15,2009-05-17&viewDataTable=generateDataChartEvolution

with a shorter date range (15th to 17th) and now it shows some data

{ "elements": [ { "type": "line", "values": [ { "type": "hollow-dot", "value": 1878, "tip": "Fri 15 May
1878 Visits", "on-click": "piwikHelper.redirectToUrl('http:\/\/tracker.picfu.net\/index.php?module=CoreHome&action=index&idSite=2&period=day&date=2009-05-15')" }, { "type": "hollow-dot", "value": 2016, "tip": "Sat 16 May
2016 Visits", "on-click": "piwikHelper.redirectToUrl('http:\/\/tracker.picfu.net\/index.php?module=CoreHome&action=index&idSite=2&period=day&date=2009-05-16')" }, { "type": "hollow-dot", "value": 1279, "tip": "Sun 17 May
1279 Visits", "on-click": "piwikHelper.redirectToUrl('http:\/\/tracker.picfu.net\/index.php?module=CoreHome&action=index&idSite=2&period=day&date=2009-05-17')" } ], "dot-style": { "type": "hollow-dot", "dot-size": 3, "halo-size": 0, "colour": "0x3357A0" }, "text": "Visits", "font-size": 11, "width": 1, "colour": "0x3357A0" } ], "num_decimals": 0, "is_fixed_num_decimals_forced": true, "is_decimal_separator_comma": false, "is_thousand_separator_disabled": false, "x_axis": { "colour": "#596171", "grid-colour": "#E0E1E4", "steps": 7, "labels": { "size": 11, "labels": [ "Fri 15 May", "", "" ], "steps": 2 } }, "y_axis": { "colour": "#ffffff", "grid-colour": "#E0E1E4", "min": 0, "max": 2020, "steps": 1010, "labels": { "text": "#val#" } }, "tooltip": { "shadow": true, "stroke": 1 }, "bg_colour": "#ffffff" }

so maybe some of the collected data is somewhat corrupted?

Prior to 0.2.34, there was a memory issue with archiving, but I’m not aware of it manifesting itself in this way.

Anyway, some data is a good sign. Since your piwik site requires a login, I’m going to suggest that you create 30 URLs, one for each day (e.g., 2009-04-15,2009-04-15 … 2009-04-16,2009-04-16), and see if there’s any particular day (or days) that fails.

Another thing to try is to create 30 URLS, each one expanding the range of days by one (e.g., 2009-04-15,2009-04-15 … 2009-04-15,2009-04-16 … 2009-04-15,2009-04-17 …), and see if it’s a range of days that fails.

Basically, we need to see if a pattern emerges on what days or ranges are failing. Sporadic days might suggest a blob issue. A range of days might indicate you’re hitting a memory limit.

I realize you don’t have direct access to your logs. Can you ask your sysadmins to see if there’s a backtrace in the error.log?