evbacher / gd2md-html

Convert a Google Doc to Markdown or HTML. This Docs add-on converts a Google Doc to simple Markdown and/or HTML.
Apache License 2.0
654 stars 58 forks source link

drive.google.com refused to connect #76

Open archydeberker opened 4 years ago

archydeberker commented 4 years ago

I'm seeing this error when trying to use the plugin for the first time:

image

Any ideas?

evbacher commented 4 years ago

Apparently, you may see this error if you are logged into more than one Google account. See https://support.google.com/docs/thread/36796708?hl=en for a possible answer. Let me know if that does not solve this issue.

archydeberker commented 4 years ago

That worked like a charm, thanks so much!

evbacher commented 4 years ago

Glad to hear that! Seems like the error message could be a bit more helpful.

codebling commented 4 years ago

The support link posted above no longer exists.

Can someone explain the fix here? Is the fix to open a private window and log into only one account?

codebling commented 4 years ago

Can confirm that opening in a private window and logging into only one Google account fixes the issue.

evbacher commented 4 years ago

@codebling : Although this is a problem for all add-ons, maybe I'll add a note to the Troubleshooting section about this. Thanks for confirming that opening in a private window and logging into only one Google account seems to solve the problem.

evbacher commented 4 years ago

Thanks, added a section about this here: https://github.com/evbacher/gd2md-html/wiki#drivegooglecom-refused-to-connect.

plocket commented 3 years ago

Are addons able to update to the v8 engine to solve this instead? This was the stackoverflow post I found

evbacher commented 3 years ago

I had not heard that before. I've tried using the V8 engine before, but the performance is markedly worse (2x to 4x slower for both Markdown and HTML conversion). We may eventually be forced to use the V8 engine, but for now, I'll stick with the legacy.

Note that this add-on gets about 1.5 million executions per week (or 6 million per month), but in the last 30 days only 134 instances of the "You do not have access to perform that action. Please ask the owner of this item to grant access to you." error, which is how the Drive refused to connect shows up in the error report, I believe. I'm not sure that the V8 engine would solve the underlying authentication bug: https://issuetracker.google.com/issues/69270374.

j9d3it commented 3 years ago

I was getting really frustrated with trying to figure out why none of my addons were working. There are some workarounds suggested in this comment on the issue which could involve showing an error to the user, or running the app a different way.

Specifically:

execute the application functions NOT through google.script.run, but using the Apps Script API and OAuthToken on behalf of the user (uN) running the application.