Services Plugins FAQs

Google Drive plugin, 401 error after some time of working just fine

I’m using the Google Drive plugin and have been able to do everything I want with it-- get files, search files, create folders, upload files, etc. The Oauth2 user agent works great and seems to be set up just fine. However, after some time (maybe a few days?), it just stops authenticating for a given user and gives me the following error when trying to reference the Current User's Google Drive Id:

"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."

If I delete the User from the Bubble App Data entirely, it fixes the problem-- I can sign back up, log back into Google, etc. with no problem. Of course, this is not a solution I can rely on in production. If I had to guess, it seems like maybe a token of some kind isn’t refreshing correctly or something, since it only seems to happen after some time?

Any help you can provide would be greatly appreciated. Thanks!

Hi @white.kate.e, thanks for reaching out.
I’m afraid the provided information is not enough to be able to identify the issue.

Would it be convenient for you to add our support@zeroqode.com as a collaborator of your app? That will allow us to check what’s wrong with your setup and test it out in our workspace.

Enter your Bubble editor page → Settings → “Collaboration” tab → Invite a user (email).

(Note: disregard the warning message regarding the plan, as we are an agency and you can easily add us to your collaborators.)

I will check your setup and do a few tests in an attempt to find the root cause and help you fix it.
In case it is ok for you, please let me know.

P.S. Please also indicate the page (and use case flow, if necessary), where the plugin is used.

Regards,

Thanks for the response. Yes, I will add you as a collaborator.

To give a bit more detail, I did determine that the call that was causing the error was when I was checking when I was checking whether the Current User's Google Drive's Id was empty before attempting to do any Google Drive calls. I’m currently relying on a crummy “workaround” where I removed that check, and instead just call the login if any of the Drive calls throw an error. I don’t love it, but if you have a better way to re-call the login in the case where the token expires or something else with the Google connection goes wrong, I’m all ears!

In the attached screenshot, you can see the check I’m referring for only executing the action if the Google Drive Id is empty. I disabled that workflow for now, in favor of my crummy workaround. But feel free to re-enable it to try to recreate the issue if needed. And also remember that the issue will likely not recreate itself right away. It takes multiple attempts, or maybe a day or so before it occurs.

I hope the additional detail helps. Let me know if you need anything else from me.

Thanks,

Kate

Hi @white.kate.e, thanks for the provided access.
Allow us to analyze it internally and come with a reply asap.

Thank you for understanding :pray:
Regards,

Thanks, Serg. I noticed last night that the issue is occurring regularly now for the white.kate.e@gmail.com user. You should be able to reproduce it for troubleshooting.

Hi @white.kate.e, thanks for provided additional detail.
We’ve checked plugin functionality within your application, with our keys and with yours, and all is working well. The issue might be related to the workflow logic of the new folder creation

To be sure that we totally understand the circumstances, please share (here or through DM) a use case flow, how it should work.

Looking forward to your reply.
Regards,