Ensure Database is set in Tracker #4603

Closed
anonymous-piwik-user opened this Issue Jan 31, 2014 · 3 comments

2 participants

@anonymous-piwik-user

When using 2.0.3 and an token_auth for bulk tracking, as well as have PIWIK_TRACKER_MODE set to true.

On every valid bulk request submission I had the following error,

PHP Fatal error: Call to a member function fetchAll() on a non-object in ... /piwik/core/Db.php on line 164

I found that fetchAll() retrieved it's db object from get(), which was calling Tracker::getDatabase(), which was returning null.

I've submitted a fix/pull request here:

#215

Upon adding my check, everything worked.

Please note that if I set PIWIK_TRACKER_MODE to false, then Piwik stops accepting my token_auth key.

I want my fix to be applied upstream, and it was suggested that a bug report needed to be submitted first.
Keywords: buk tracking

@mattab
Piwik Open Source Analytics member

Thanks for the report. So bulk request as explained here:

http://developer.piwik.org/api-reference/tracking-api#bulk-tracking

does not work for you in 2.0.3?

@mattab
Piwik Open Source Analytics member

In 74c865d: Adding integration test for the Bulk Tracking API, it FAILS at present! refs #4603
Thanks for the report, we didn't catch this failure as it wasn't properly continuously tested!

@mattab
Piwik Open Source Analytics member

In a6e4884: Fixes #4603 Adding lazy DB connection call

@anonymous-piwik-user anonymous-piwik-user added this to the 2.1 - Piwik 2.1 milestone Jul 8, 2014
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@mattab mattab Adding integration test for the Bulk Tracking API, it FAILS at presen…
…t! refs #4603

Thanks for the report, we didn't catch this failure as it wasn't properly continuously tested!
74c865d
@sabl0r sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
@mattab mattab Fixes #4603 Adding lazy DB connection call a6e4884
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment