dashed-slug.net › Forums › General discussion › Getting this random error sometimes: SyntaxError: JSON.parse: unexpected char… › Reply To: Getting this random error sometimes: SyntaxError: JSON.parse: unexpected char…
Yes, you would get this error message if the JSON API did not return a JSON response but an HTML. If you follow the URL you gave me you’ll see that it responds with your web page, not JSON.
I cannot know why this happens on first inspection, but here’s some guesses:
1. Check your server cache or caches. First, disable your caching mechanism altogether to see if it makes a difference. Then enable it again. Look at any caching mechanisms you use on your server and try to add to your exclusion list or whitelist URLs that include the GET parameter
__wallets_action. For some popular caching mechanism the plugin will warn you about this.
2. Check your server configuration. It is possible that your apache mod_rewrite rules or your nginx config does not allow for URLs of this type. If unsure, revert to the recommended configs for WordPress and try again. Currently the JSON API endpoint you gave me shows your webpage, while it should be responding with JSON, even if you are not logged in. The plugin will not work until this is fixed.
3. The DB deadlock you report indicates that maybe your MySQL server needs to be restarted. I have seen this type of deadlock before but only occurs while starting my machine, and it’s not something serious. It simply means that the new exchange rates for coins were not saved in this particular instance, but will be saved again in a few minutes.
Hope this helps. Please check the above and let me know if you need further help or if you weren’t able to resolve the issue.