invalid nonce error

  • Unknown's avatar

    Hello, I cannot edit some parts of our site nor try to change some settings because I always get this invalid nonce error. Can you help me?

    WP.com: Yes
    Jetpack: Yes
    Correct account: Yes

    The blog I need help with is: (visible only to logged in users)

  • Hi there!

    Could you tell us a bit more about what’s happening? What exactly are you trying to change when you see the error? Can you confirm you’re working on the staging site staging-b71d-bonitotechcom.wpcomstaging.com?

  • Unknown's avatar

    I am having the same issues after syncing my staging site from production to staging. I can access the staging dashboard, but clicking menu items will either show the error invalid nonce or will throw me to the production site equivalent. It’s a WP.com-hosted site, so I can’t seem to try the solutions I found by searching.

  • Unknown's avatar

    Hi there, I was able to fix my issue, however it is a temporary and advanced fix since I need to keep working on content. Details as follows:

    For context, I had created a WP.com production website, then a few weeks later created a staging website. Sometime after this, I made changes to the production site which I wanted to sync to the staging website.

    In the staging site admin, under Hosting Configuration > Staging Site, I chose Production to staging for synchronisation direction and clicked the Synchonize button. After this, I started getting the invalid nonce error.

    Restoring a backup did not work to correct the error, nor did trying the sync from the production site admin and following the same steps.

    Eventually, I identified the problem: In the staging site database, the WP.com production site ID had been copied to the staging site database where the staging site ID should have been maintained. Once I tracked down my staging site’s ID, I opened phpMyAdmin and in the wp_options table, in the option_name jetpack_options I replaced the production site ID with the staging site ID, then saved.

    Back in WP.com staging website admin, I refreshed the page and opened Jetpack > Dashboard, then navigated to some of the pages I’d had trouble accessing, like the All Pages and Installed Plugin pages. The issue seems to have gone, despite not updating all 10 instances of the production site ID I’d found in the staging database.

    jebonito I know this might not be the fix you were after but I hope it means the Happiness Engineers will be able to correct it an update shortly!

  • Unknown's avatar

    This has happened to us too – exactly as leoniecsanki‘s description, using the synchronise Production to Staging function. Yet to try the fix, but its clear something is buggy in this migration tool at the moment.

  • @leoniecsanki – thank you for sharing what you did to troubleshoot your fix. We’ll look into this on our end to pinpoint the cause of this issue.

    @bedshadowboxerco 

    Thanks for confirming your experience with the same issue. We’ll definitely have the devs take a look at this issue. In the meantime, please let us know if the fix @leoniecsanki laid out works for you. Thank you!

  • Unknown's avatar

    In our case its not a multi-site setup, I can’t find for the life of me what our Prod or Staging SiteID is or identify what part of the jetpack_options value in the database contains this, to try the fix 🤔

  • Unknown's avatar

    Followup: saw that the siteID was being passed as a url param in the SSO path that was showing the NONCE error and can confirm this was the same issue. I recovered the proper stating siteID from the backup and on replacing it as per @leoniecsanki  the issue has been resolved.

    So 100% it was the same issue.

    Cheers

  • Unknown's avatar

    Cool happy I could help narrow it down!

    bedshadowboxerco it sounds like you got onto the exact thought train I did to find the site IDs. I later found them in the Admin UI on the Jetpack settings page for each site, but that was once of the pages I couldn’t access while the invalid nonce error still appeared.

  • Accepted answer

    Hi all, thanks for these reports. The invalid_nonce error is a known issue we’re tracking, which occurs intermittently when syncing between staging and production sites. There isn’t anything we can suggest to prevent it at the moment.

    Happiness Engineers can fix this issue on your site if it occurs, so please feel free to reach out to our team if you run into this issue. Making direct database changes is something we’d only suggest for advanced users.

    Hopefully we’ll find a solution soon so no workarounds are needed, and we’ll keep this thread updated. Thanks for your patience in the meantime!

  • Unknown's avatar

    If you simply replace the site_id in the URL parameter and load that URL the page will load correctly without having to mess with the database settings. This is a good temporary workaround until the support team replies if you’re working on a tight deadline.

  • Unknown's avatar

    @leoniecsanki Hi! It seems I am also having this issue for my site. I would love to try out your fix, but I am having trouble finding my site ID. Could you share the steps to getting it ?

  • The topic ‘invalid nonce error’ is closed to new replies.