• Resolved nppbc

    (@nppbc)


    I’ve used Jetpack for years. Up until recently am I having issues. I’m getting the typical Cookie noonce error. I’m also having another issue with another plugin where I can’t save or export it’s settings. No error message, it just sits and spins.

    I’ve asked the developers of that plugin for help to which they think the issue is possible server setting related. They’ve basically copied my site to their server and have no issues.

    I’ve asked my hosting then to check out the settings. They can’t find anything wrong. . . .
    They then point me to Jetpack for support.

    I get the “Cookie nonce is invalid” al the time when go into the dashboard of JetPack.

    I get this error when I try to restore connection: “There was an error reconnecting Jetpack. Error: Cookie nonce is invalid”

    I get this error when I try to connect to WordPress: “There was an error disconnecting Jetpack. Error: ApiError: Cookie nonce is invalid (Status 403)”

    When I look at my error log on the server I see this error over and over again: “[06-Feb-2021 13:00:01 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 28672 bytes) in /…/…/…/…/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-manager.php on line 1587” (… used to remove info).

    Any info that you can provide is greatly appreciated. Thank you!

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Dan (a11n)

    (@drawmyface)

    Hi there

    The first step in clearing that cookie nonce error would be to log out of your site and back in again. Assuming you’ve tried that and it didn’t help, there must be something else interfering.

    The memory error could be a problem, so I’d suggest asking your host to increase your site’s memory allocation. If that doesn’t help, I’d try the following:

    – Disable any caching plugins or server side caching. Does that help?
    – Switch to a default theme such as Twenty Twenty. Does that help?
    – Deactivate all plugins except for Jetpack. Does that help? If so, enable them one by one, testing after each one.

    Let us know how that goes.

    Thread Starter nppbc

    (@nppbc)

    Hello!

    Unfortunately, everything you’ve suggested as been done and it made no difference. I’ve even tried several different browsers.

    Something I find odd, the site is still connected and when I visit the WordPress site I’m able to do anything I need to do from there.

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi @nppbc,

    Have you tried to increase your PHP memory limit already? You can do it by editing php.ini. This is not a file that comes with WordPress, so if you are unfamiliar with it you should contact your web host about increasing your memory limit.

    I hope this would solve the issue, since it looks like it’s something related to your server’s settings, given the fact that the error didn’t occur in staging site where your site had been mirrored it

    Let me know what you find out 🤞

    Thread Starter nppbc

    (@nppbc)

    PHP.ini is set to 1000M. I’ve also checked the other areas like WP-Config and it’s set to 128, actually I just added it but it made no difference. Like the WP-Config file there is not mention of limits in it. When I did try to add it I get a 500 error on refresh.

    Here is another thing I just noticed. Jetpack debugging states “Your Jetpack setup looks a-okay!”. However, everywhere else in Jetpack I get the error message at the top like before.

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Like the WP-Config file there is not mention of limits in it. When I did try to add it I get a 500 error on refresh.

    This is interesting, @nppbc. Have you reported this to your host, especially the last bit, just in case they can provide more info and/or fix that?

    I’m asking our tech team meanwhile if they have something to suggest I’m missing out.

    Thread Starter nppbc

    (@nppbc)

    Sorry, my bad. I didn’t input the code correctly into the WP-Config file. It made no difference though and upon looking at my other sites they are missing that code as well.
    I know this is going to be a lot but I wanted to explain in detail for troubleshooting purposes. If I left something out please let me know.

    I’m running WP version: 5.6.1
    PHP version: 7.4.14
    PHP settings: max input, 1000; time limit, 300; memory limit, 1000M; max input, 600; upload filesize, 128M; post max size, 128 M
    Jetpack version: 9.4

    I’m using a plugin called, Health Check & Troubleshooting.
    When I check the health info for my site it tells me one thing that makes me wonder if there might be an issue between my site and Jetpack? It states: Jetpack SSL Verification Bypass: No. I don’t know what that means other than SSL and my site having SSL setup. It does also state that it passes the Connection test for Jetpack.

    WP dashboard shows the Jetpack stats.
    Jetpack dashboard shows the “Cookie nonce is invalid”. Clicking the Restore Connection within that error produces another error, “There was an error reconnecting Jetpack. Error: Cookie nonce is invalid”. Nothing on the dashboard loads, only stating: Loading…
    At the bottom of the Jetpack dashboard under Connections, it states my site is connected to WP and I am the Jetpack owner. When I click the Manage site connections link it asks if I want to disconnect Jetpack and has a “spinning wheel”. If I say yes or disconnect it produces this error: “There was an error disconnecting Jetpack. Error: ApiError: Cookie nonce is invalid (Status 403)”.

    Jetpack debug window
    It states that my Jetpack setup looks a-okay.
    Within that window I selected number 5, disconnect from WordPress. It actually disconnects.
    I reconnect and go thru the proper steps. Once I’m back to my site, the dashboard looks slightly different. The windows now have a pulsating grey bock and they never connect. Still getting the same error messages as before. I log out and log back in and the Jetpack dashboard goes back as before. The grey pulsating boxes are gone and replaced with the “spinning wheel”.

    The other plugin that I’m having the save/import issues with is called, All In One SEO. They are the ones that copied my site to their server to test it.

    Jetpack & AIOSEO are the only two plugins I’m having this type of weird issue with.

    As far as server/site error messages.
    I’m getting this one (again … to mask):
    [10-Feb-2021 13:00:02 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /…/…/…/…/wp-content/plugins/powerpress/powerpress.php on line 3597
    I got this one back on the 6th for Jetpack which is the same as the one from Powerpress. That was the last time I got the Jetpack error. Since then it’s been the Powerpress error.
    [06-Feb-2021 13:00:01 UTC] PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 28672 bytes) in /…/…/…/…/wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-manager.php on line 1587

    Plugin Support Bruce (a11n)

    (@bruceallen)

    Happiness Engineer

    Hi @nppbc

    We definitely appreciate all the details you’ve provided there. A couple ideas from our Devs:

    – The cookie issue can sometimes be caused by caching plugins adding things to the site’s .htaccess file that mess with authentication headers for all API requests like the ones Jetpack does. Even once the caching plugin has been deactivated, those entries can remain in .htaccess so it may be worth checking what’s there. Even WP Super Cache, with some specific settings (the “make known users anonymous” box), can sometimes mess things up there.

    – Some hosts / plugins “tweaks” change all requests’ headers, thus losing X-WP-Nonce that is used as part of the authentication. This often can be solved with a change to.htaccess, like Header add Access-Control-Allow-Headers "x-wp-nonce".

    Can you look in your .htaccess file for the above?

    Thread Starter nppbc

    (@nppbc)

    I just checked my .htaccess file. This is what’s in it (not too detailed). I didn’t know if copy/paste would be a safe thought for public viewing?

    mod_deflate.c
    mod_rewrite.c
    mod_expires.c

    I don’t see anything about x-wp-nonce and the only thing I see about caching is when it expires. There are also no blocks or any mention of the word “header”. I also activated my WP Super Cache just to turn off the “make known users anonymous”. I tried it again and it made no difference. So I deactivated the plugin again since cacheing is a known “issue” during troubleshooting.

    Plugin Support Bruce (a11n)

    (@bruceallen)

    Happiness Engineer

    Hi @nppbc

    So can you add Header add Access-Control-Allow-Headers "x-wp-nonce" to your .htaccess file and see if that helps?

    Thread Starter nppbc

    (@nppbc)

    I just added exactly as you wrote and it made no difference.

    Plugin Contributor Ryan C.

    (@ryancowles)

    Hi @nppbc, thanks for giving that a shot! I’ve relayed the latest information to our developers and asked them for suggested next steps. We’ll let you know once we’ve heard back from them. Thanks again for your help and patience!

    Plugin Contributor Ryan C.

    (@ryancowles)

    Hi @nppbc, can you please use this form to followup with us?:

    https://jetpack.com/contact-support/?rel=support&hpi=1

    Please make sure to include a link to this thread in your message. Thanks!

    Thread Starter nppbc

    (@nppbc)

    Done. Thank you!

    Plugin Contributor Jen H. (a11n)

    (@jenhooks)

    Hey @nppbc,

    I’ve found your ticket in our system, and someone will be in touch with you soon. Since we’re going to continue troubleshooting there, I’m going to go ahead and mark the thread here as resolved.

    Thanks for your patience and persistence here!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Cookie nonce is invalid’ is closed to new replies.