CORS issue after URL change
-
Hi,
I run a wordpress multisite environment with around 75 blogs. A combination of 2 things now prevents me from showing jetpack stats on the dashboard to certain users.
After the latest jetpack update (v4.3.1) it seems as thought the settings for which users can view stats on the WP dashboard were reset to Admin only. Normally I would go to Jetpack > Settings > Engagement > Stats and would simply add the editor role to enable stats for editors. However, I now receive the following error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://oogopnijmegen.nl/wp-json/jetpack/v4/connection/url. (Reason: missing token 'x-wp-nonce' in CORS header 'Access-Control-Allow-Headers' from CORS preflight channel).
This is due to a recent domain change; the domain used to be oogopnijmegen.nl and has now changed to oogopnederland.nl/nijmegen. I changed the domain using the wordpress multisite site settings page.
Now, attempting to change any Jetpack setting whatsoever (not just the stats visibility) results in the above error in my browser console. Even attempting to disconnect from jetpack altogether results in the same error, making it impossible to follow most instructions I found online.
I also attempted to (temporarily) allow all CORS requests, regardless of their origin URL (by adding the correct headers to my apache config), but to no avail.
The only thing that seemed to work was to change the URL back to the original URL, then I could change settings, but I am still not able to connect using the new URL. If I set the old domain, disconnect, change to the new domain, and attempt to reconnect, I again receive CORS errors and failed AJAX requests. It seems as if Jetpack has somehow remembered the original URL and won’t allow it to be changed?
I tried grepping a raw database dump to find instances of the old URL to see if I could manually change it, but I couldn’t find any settings related to Jetpack.
Since this is a production site running 75 blogs, I cannot simply uninstall and reinstall Jetpack as re-configuring everything (it’s not just stats we’re using, also sharing, publicize, etc) would be too time consuming while generating too much feature downtime for the daily users.
Any suggestions on how I can fix this? Any help would be much appreciated!
Some system info:
* Ubuntu 14.04 LTS
* Apache 2.4.7
* WordPress 4.6.1
* Jetpack 4.3.1
- The topic ‘CORS issue after URL change’ is closed to new replies.