DSM 6 Adventures: Fixing Piwik
May 15, 2016
I was and still am using Piwik to track my blog’s visits. However, updating to DSM 6 messed with the Piwik installation and I had to tinker a little to get it back running. If you care how I restored Piwik after the DSM 6 update, read on.
Piwik’s Unfinished Update
Once the DSM 6 update finished, I wasn’t able to access the Piwik web interface anymore. When trying to, I was greeted by a file not found (HTTP 404) error page instead. Reason for this was that the https://melo.myds.me/piwik
URL was redirected to another address looking something like this: https://melo.myds.me/piwik/index.php?module=CoreUpdater&attr=
. There is something obviously wrong with that URL and so the 404 error seems legit. Getting around this issue was easy. I simply removed the last, undefined URL parameter and accessed this URL https://melo.myds.me/piwik/index.php?module=CoreUpdater
instead. What this does is start the DB upgrade process. Once this process is done, Piwik is up and running again and can be used through its web interface as usual. However, the GeoIP location provider installed before the DSM update is not installed anymore. Reason being is that the GeoLite database was deleted. So I had to download the GeoLite database file and move it into /volume1/web/piwik/misc/
to get more accurate locations tracked again.
Re-Enable Tracking
The one site I track visits for with Piwik is this very blog. I do so with the use of the WP-Piwik plugin. Although I finished the Piwik update and Piwik itself was running again, tracking my blog visits was still not working. The reason for this is a combination of two things:
- I used Piwik’s js/index.php tracking code (find out more here)
- Synology’s NGINX config does not allow access to
https://melo.myds.me/piwik/js/index.php
After failing to rewrite the NGINX configuration for Piwik myself, I turned to Synology support and got this answer:
After some investigation with our development team, we’ve confirmed it’s a new issue caused by the nginx in current version. We will fix the issue then release the new version of package as soon as possible.
I am still waiting for an update to take care of this issue. As of today (the 15th of May 2016) the problem still persists. As a workaround I had no other option than changing WP-Piwik’s settings and use Piwik’s default tracking code, which uses the tracking code accessed through https://melo.myds.me/piwik/piwik.php
. This way I loose the benefits that come with using the js/index.php approach, but at least I can track my blog visits again!
Update: 10th of June
Synology released updates for both the Web Station and their Piwik package. I do not know which of the two packages actually solves the problem, but after applying these updates I am now able to access piwiks tracking code in js/index.php.
End of Journey
This was the third and final post in my DSM 6 Adventures series. Everything I used to do with my DiskStation on DSM 5.2 is now working again and DSM 6 itself is running without any issues and sports some nice new features. Speaking of new features: In my next post I will describe the use of the new Let’s Encrypt integration for easy certificate creation in combination with the new reverse proxy feature. This allows for easy HTTPS access to your DiskStation, even for your applications running on Tomcat, without the hassle of manual procedures.