Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Trouble with Statistics and API Registration

Having trouble with statistics. The API Status reports "Problem with credentials." Trying to re-register the API key continues to give the same message.

I have searched the forums and I am aware that curl needs to be installed and working. I have checked and verified that it is.

I am on CentOS 6.4 x86_64 with Vanillaforums 2.0.18.4. I tried the most recent version, 2.0.18.8, with the same results.

I also installed Vanillaforums on a different CentOS 6 x86_64 server at Linode. The API registered okay there. I compared the PHP and server configurations. PHP is the same and the server configuration is very similar. I have also disabled all firewalls.

Where is the API being registered? I am assuming is trying to contact a server somewhere. I have not found much for troubleshooting. Is there any place it would log an error? Besides curl, anything else to check?

Thank you.

Tagged:

Comments

  • Vanilla Statistics are disabled on local hosts. Is this a development environment?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • No, production site.

    I did resolve this. Statistics are time sensitive.

    In /library/core/class.statistics.php there is a section of code that checks time on the server. It allows for time to be off by 24 minutes. If its greater than 24 minutes it fails.

    The comment line in the code says

    // Allow 24* minutes of clock desync, otherwise signature is invalid

    I did not have ntp running. My time was off by 4 hours. So the API credentials were failing to register.

    I started the ntpd daemon. After it synced time I could successfully register the API and statics started working. (Can take a few minutes for ntp to sync time.)

    Also be sure you are set to the correct timezone otherwise your time can still be off.

    Anyway to write a check in the code to display a useful error message to users about their server time?

  • I would suggest forking the plugin on github, write a patch, and submit a pull request.

    Nice work figuring out your issue. Thanks for posting back with your results.

    Welcome to the community!

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.