Token is not valid

when I try to save something in the piwiki backend I get a message ‘Token is not valid.’

it also doesn’t populate the javascript tracking code box.

this is from a new install straight to 2.2.0.

there’s a couple of prior threads on this subject but doesn’t seem an answer to it.

any ideas? or how I may track the fault down?

couple more notes…

same error in different browsers + it did show the tracking code at setup, when you add the initial site, and it does track visitor data.

maybe it is a problem of javascript files not generated properly.

could you try to delete the folder piwk/tmp/ and try again ?

Also do you see a javascript error in your browser “console” ?

thanks for the reply.

only 1 javascript error, which I get upon logging in:

Error: TypeError: a is undefined
Source File:
Line: 4

this was after loggin out, deleting tmp and logging back in.

no javascript error is generated when I try to save something in the piwik backend, I still get the message 'Token is not valid.'

any ideas? i'll have to try a full reinstall if not.


In Settings > System check, do you see any warning there?

If you don’t see a warning, then try this trick: Piwik reporting UI doesn’t have any css style or, the menu text appears on a white background, or I get JavaScript errors in the Piwik UI. How to fix this display problem? - Analytics Platform - Matomo

I only get optional warnings on mail and load data infile in system settings. the trick did not work, I even tried in different browsers.

by the way, I can clarify the problem even further: it wont save any settings on any page

this is straight after another default install, removing the database and all files of the previous version.

Ok could you please create a ticket on the issue tracker?

Thanks in advance. Also would be great if you could send us access to your piwik server / files so we can debug and find the fix

thanks, both done, including a PM to you with ftp access.

Thanks, see my comment in the ticket: Set Base URL used in the AJAX request to ? instead of index.php? · Issue #5127 · matomo-org/matomo · GitHub

let’s continue the discussion on the ticket!