Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#809 closed Bug (fixed)

SQL errors on new install

Reported by: carcus88 Owned by:
Priority: major Milestone: Piwik 0.4.2
Component: Core Keywords:
Cc: Sensitive:


I install Piwik on Windows / Apache connecting to a CentOS / Mysql 5.0 backend. The install worked fine but the dashboard shows SQL errors because there is no archived data it seems.

The error comes from core/archive/array/IndexedByDate.php in the function getDataTableFromNumeric(). It seems that $archive->getIdArchive(); is returning null and causing a query that looks like this

SELECT value, name, UNIX_TIMESTAMP(date1) as timestamp FROM piwik_archive_numeric_2009_06 WHERE idarchive IN ( ) AND name IN ( 'nb_visits' );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND name IN ( 'nb_visits' )' at line 1

Attachments (1)

ScreenShot.jpg (193.3 KB) - added by carcus88 5 years ago.
Screen shot of the dashboard

Download all attachments as: .zip

Change History (6)

Changed 5 years ago by carcus88

Screen shot of the dashboard

comment:1 Changed 5 years ago by vipsoft (robocoder)

Can you grab a snapshot from svn, and run tests/all_tests.php for your set-up?

comment:2 Changed 5 years ago by vipsoft (robocoder)

Also, what are your versions of Apache, PHP, and MySQL? (major.minor.revision)

comment:3 Changed 5 years ago by vipsoft (robocoder)

Unable to reproduce. Could this be a timezone mismatch between PHP on the Windows/Apache server and the Centos/MySQL server?

comment:4 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [1268]) Quick fixes #809 - guard against empty archive ID list

comment:5 Changed 5 years ago by vipsoft (robocoder)

(In [1323]) refs #809 - alternate fix

Note: See TracTickets for help on using tickets.