Support » Plugin: HubSpot for Gravity Forms » oAuth for HubSpot keeps resetting and asking for re-validation

  • Resolved mktgessentials


    I am successfully able to authorize my HubSpot account in the HubSpot for Gravity Forms plugin. However, after a couple of hours the oAuth essentially “resets” and says that I need to re-authenticate with HubSpot in order to successfully use the plugin. During that time, any form that is connected to HubSpot breaks. When clicking “submit” I get a 500 error. And then once I reauthorize the account it works again until it happens the next time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Chris Lagasse


    Hey mktgessentials,

    What kind of environment are you running, and I am assuming that you have the latest version of WP and our plugin…

    The only thing I can think of here is that the token that we got from HubSpot is being stored with an incorrect date, or that your server time is wrong… in which the script (which checks every page load if it’s time to refresh the token) is never encountering the date for refreshing.

    I will look into preventing the 500 error, but that won’t solve your particular instance of why your token refresh isn’t working.

    Do you have access to your wp-config.php? Please enable GF_HUBSPOT_DEBUG by adding this line:

    define('GF_HUBSPOT_DEBUG', true);

    next time you authenticate (or next time the token tries to refresh) you will see an entry in your wp-content/uploads/gf-hubspot.log file. This should contain some insight on when your token is due for renewal.


    My site is hosted on and is running PHP 5.6 and the latest version of WordPress.

    I have enabled the debug in the wp-config file and re-authorized. This is what the log shows:
    [2017-10-11 14:34:06] oAuth Token Refreshed
    [2017-10-11 14:34:06] a:4:{s:12:”access_token”;s:67:”CKDpk-nwKxICAQMYnMMcIKjOGiiDyQEyGQClhA4dZdosLQHrawLXv_myF2t2lMNR258″;s:13:”refresh_token”;s:36:”6115fb8d-6537-4b36-b789-c813a40bfb89″;s:13:”hs_expires_in”;i:1507754046;s:14:”bsd_expires_in”;i:1507752246;}

    I did discover this morning that my disabling the other HubSpot plugin (HubSpot for WordPress), the issue seems to go away. It looks like the two plugins may no longer be playing nice. I have instead manually installed the HubSpot tracking code so that I can keep the other plugin deactivated. However, it may be good for you to know in case others are having issues with the two plugins conflicting with each other.

    Plugin Author Big Sea


    Hey mktgessentails,

    “HubSpot for WordPress” is a deprecated plugin that is no longer managed by HubSpot… They have people switched over to using “HubSpot Tracking Code for WordPress” instead, but if there’s a conflict there, I definitely need to take a look.

    Can you confirm the plugin you were using that was conflicting?

    Also, if you went to Forms > Settings > HubSpot you could’ve enabled the tracking code via there, instead of manually entering it.

    Thanks for the update. I will have to take a look and see if those plugins have new conflicts.


    I wanted to join in on this thread. We’ve been experiencing this on and off over the last few months as well. It seems to happen once a month or so and Hubspot will reset itself and ask to be re-authenticated. During the period of time until somebody sees the message in wp-admin, frontend visitors are thrown 500 errors.

    We do not have the any other Hubspot plugins installed.

    I’ve enabled GF_HUBSPOT_DEBUG so we’ll see what happens next time there is an issue.

    Just wanted to put it out there as it may be an ongoing problem that needs a resolution…I’ll update this thread if I get any more info.

    Same thing as @cabbage27 mentioned happened to us as well. I have enabled debugging as well, but won’t know what the issue is until it happens again, but it seems like after a while a month or so the access_token is not refreshing properly. I did find a thread on it that dated back to August 2017 of people mentioning getting a bad_refresh_token –

    Which sounds very similar to what’s happening here, but can’t be sure until I see what happens. Just thought I would post to keep this on the lookout.

    Although now that I think about this, I am going to create a new thread on this mostly because the issue explained in this thread was due to a plugin conflict and this is a different issue.

    • This reply was modified 2 years, 9 months ago by gorillatyler.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘oAuth for HubSpot keeps resetting and asking for re-validation’ is closed to new replies.