WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] Token error (21 posts)

  1. superkekko
    Member
    Posted 3 years ago #

    Hi,

    I have a problem with the connection between piwik and the plugin. Sometimes the plugin return to me this error:

    Please check URL and auth token. You need at least view access to one site.

    When I refill the Token field the plugin restart to work correctly, but at a next access to wordpress I see the same error.

    Thanks,
    Francesco

  2. braekling
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    one user told me his auth token changed suddenly. Are you sure it's the same token you enter each time?

  3. ChemicalSailor
    Member
    Posted 3 years ago #

    Hey,

    Got same/similar problem. Got a new install of piwik on a subdomain and set up a 'wp-piwik' separate user with view access in piwik. Tried putting in the API token in widget and keep getting same error as above. The auth token isn't changing. From what I can see the token isn't getting saved to the database in the options array. However it does stay populated in the form when I navigate away and back to the page (i.e. the value attribute is set). I don't understand how this works if it's not set in the database?

    I've tried using different tokens for different users too, none of them work.

  4. aramsey
    Member
    Posted 3 years ago #

    I had this same issue. It worked fine on older version of Piwik.

  5. aramsey
    Member
    Posted 3 years ago #

    Disregard my issue was resolved with the newest version of piwik by using Ip vs FQDN. Not sure why that worked since they resolve the same, but I've got a convoluted setup with a reverse proxy.

  6. ChemicalSailor
    Member
    Posted 3 years ago #

    I was mistaken in my first post. I checked the database again and the plugin is saving the API token, but still not connecting to piwik installation.

  7. braekling
    Member
    Plugin Author

    Posted 3 years ago #

    1. Check the Piwik URL. Can you access Piwik by copying-&-pasting the URL to your browser?

    2. The auth token is not the user's password. You can get it on Piwik's API site ("full access token") or on Piwik's user management site (regarding to the user's settings).

    3. Try to open the following URL in your browser combining the data used in 1.([YOUR PIWIK URL]) and 2. ([YOUR_AUTH_TOKEN]):
    http://YOUR_PIWIK_URL/index.php?module=API&method=SitesManager.getSitesIdWithAtLeastViewAccess&format=Html&token_auth=YOUR_AUTH_TOKEN

    What's your result?

  8. braekling
    Member
    Plugin Author

    Posted 3 years ago #

    I was able to reproduce this error by installing WP 3.1.1 and updating to 3.1.3. It was fixed by updating to Piwik 1.4. Currently I'm not sure how this happens.

    Please keep sure you are using the latest version of WordPress and Piwik!

  9. ChemicalSailor
    Member
    Posted 3 years ago #

    Hi,

    Thanks for response.

    I'm using Piwik 1.4. Brand new installation.

    Using WP 3.1.3, which has been incrementally updated since 2.8.

    The settings are correct. I've tried prefixing http:// on the url and leaving it off.

    Opening the url in your post gives me a table with value = 1

    As I mentioned before, Piwik is accessed on a subdomain, and wordpress accessed through natural directory structure, i.e.

    analytics.mydomain.com
    mydomain.com/wordpress

  10. braekling
    Member
    Plugin Author

    Posted 3 years ago #

  11. ChemicalSailor
    Member
    Posted 3 years ago #

    Hey,

    Yeah I read those threads before. I've already tired deactivating all my plugins and it doesn't make a difference.

    I've double checked that demo url. There is a slight problem with it. If you make the request without the HTML format specified all the values are returned as expected, just in an XML format, not a table. On my own installation of Piwik the url is case sensitive, it works fine specifying format=html rather than format=Html

    Just updated to wp-piwik 0.8.7

  12. braekling
    Member
    Plugin Author

    Posted 3 years ago #

    I still have no idea about this issue - it works fine for me and most other blogs. If anyone can give me a hint to reproduce this issue please tell me about this.

    The 'check URL and auth token' error should just appear if 'SitesManager.getSitesWithAtLeastViewAccess' answers with an empty result.

    WP-Piwik calls this URL:

    YOUR_URL( + /) + ?module=API&method=SitesManager.getSitesWithAtLeastViewAccess&idSite=&period=&date=&format=PHP&filter_limit=&token_auth=YOUR_TOKEN&expanded=false

    Can anyone try this? Thank you very much!

  13. ChemicalSailor
    Member
    Posted 3 years ago #

    Hi,

    I've checked the call_API function in the plugin and cross checked the URL it generates. It all works fine for me when I copy it into my browser, I get a serialised array returned.
    Did this by emailing the generated url out from the plugin.

    So call_API is working correctly, and my piwik installation is working correctly as it returns the string.

    I checked get_remote_file function and that is where an empty result is being returned causing the error. I'm not sure why this is though. I see that the function should always return an array, even if it contains an error message, but it's not returning anything? Both cURL and fopen is enabled on the server.

    I've tested the fopen method on my local machine and the server. It works fine on my local machine, but I get nothing returned when testing on the server, so my problem is potentially a server issue, but then the plugin tries cURL first. I don't know if the same issue could affect cURL?

    As I said before, my piwik installation is on a subdomain. I don't know why this should make any difference though if the API is accessed using http

    The mystery continues...

  14. TheRingBearer
    Member
    Posted 3 years ago #

    I've got the same issue. Might it be related to some RewriteRule used for https redirection ?

  15. braekling
    Member
    Plugin Author

    Posted 3 years ago #

    I've still no idea. Did anyone try to delete all WP-Piwik settings stored in your database und to reinstall the plugin after this?

    Maybe it's a problem caused by changes in the settings handling.

  16. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Any new results on this? Works still fine here and I still wasn't able to reproduce this issue.

  17. maxasher
    Member
    Posted 2 years ago #

    I have this same issue , suddenly stopped tracking all my domains as of 3 days ago. No fix so far.

  18. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Did you check the tracking code in your site's source code?
    Did you change anything three days ago? (WordPress update, new plugins, Piwik update, Piwik settings, server configuration, ...)

    This topic is 11 months old, maybe you should start a new thread with a full error description.

  19. maxasher
    Member
    Posted 2 years ago #

    Blah, feel like a dunce- HostGator had reset my mod_sec whitelist for some darn reason- it was on their end. Working again. Anyways, thanks for the great plugin.

  20. braekling
    Member
    Plugin Author

    Posted 2 years ago #

    Alright & you're welcome :) Have fun using WP-Piwik!

  21. ChemicalSailor
    Member
    Posted 2 years ago #

    Hey,

    Posts in the last few days got me thinking. The plugin still doesn't work for me, but I think I may know what the issue is.

    For some reason my host doesn't allow the server to make http requests to itself, i.e using open, cURL, wget. I figured this out when troubleshooting wp-cron.

    I doubt there is much the plugin author can do about this, it's not really a plugin issue, but I write this in the hope it helps someone else with the same problem. Now I just have to work out a workaround. Any advice anyone?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags