Error in some Google accounts when trying to get the active presentation

211 views
Skip to first unread message

Rafael Freitas

unread,
May 3, 2021, 10:00:07 AM5/3/21
to Google Apps Script Community
Hello everyone,

I hope you are all well.

I have been working on a Google Slides add on and, as I am new to Apps Script development, it has been a challenge getting used to the environment as I found the amount of material on the subject out there very limited.

I am using this base React project to compile to Apps Script: 

Yesterday, after multiple tests on an Apps Script container, I created a new deploy and saved to the Google Marketplace SDK, and I am running into two issues I wasn't able to resolve until now.

1 - When trying to install the app, when the user is logged in to multiple G accounts,  a "script not found" error will happen and the installation will fail:Screen Shot 2021-05-03 at 10.14.11.png
After some research I found out the url has a different pattern  when multiple users are logged in, for instance "..../u/1/..." on the top of the image attached. Is there any way to avoid this situation and have a consistent installation for every user, regardless being logged in more than one account?

2 - The second issue I had (this is probably the worse as I have no clue where to start looking for the problem) is that after installing successfully,  in some accounts the app works normally and in others it crashes when trying to get the "activePresantation". I used both the Apps Script's function logs and the GCP to try to understand why the error happens for some accounts only but couldn't find a solution yet. The error I am getting is: Exception: Action not allowed at getActivePresentation".

getActivePresentation is a helper function like so:

function getActivePresentation() {
    return  SlidesApp.getActivePresentation()
}

I will truly appreciate if someone who had the same issue or knows the environment better could help me out to find the solutions to this problems.

Thanks in advance,

Rafael

Alan Wells

unread,
May 3, 2021, 11:08:42 AM5/3/21
to Google Apps Script Community
The issue with Apps Script having an error when a user is logged into multiple Google accounts has been a problem for a long time.
There are multiple open bug reports related to authorization errors when a user is logged into multiple Google accounts.
For example:
That issue has been open since  Nov 13, 2017
So, for the error that you are getting when users are logged into multiple Google accounts,
I don't think that there is a workaround.
Because the installation fails completely, there is no opportunity to warn the user to do something else.
You'd need to warn people in the Marketplace add-on description to log out of multiple accounts and log back into
just the account that the add-on should be installed with,
and hope that they read it.
If the add-on is already installed,
then the best that you can probably do is to warn people when they install the add-on that being logged into multiple accounts
will cause an error.
Unfortunately, this is a failure of Google to fix a very important issue.
I don't know what the other issue is.
I can only guess.  If the failures are only in user accounts inside of domains,
then maybe it's something to do with how the admin of the organization blocked something?

Rafael Freitas

unread,
May 3, 2021, 6:27:04 PM5/3/21
to Google Apps Script Community
Thank you for the reply. 

It is a shame the only way we can deal with it is by writing on the add on's description.

Regarding the other issue, it has nothing to do with being logged into multiple accounts. It is a function execution to get the current Slides presentation which fails for some accounts but works for others. I will write a more detailed explanation as soon as I get the chance and will send it here so hopefully someone can help me out.

Rafael Freitas

unread,
May 4, 2021, 7:47:25 AM5/4/21
to Google Apps Script Community
Hello everyone,

I will try to explain the issue I am having for some accounts to hopefully get some help from the community. When you first run the add on I am working on you have an input field where you enter the title to display on the slide and a button to create it. When the user clicks the button the slide is created and the title put into place.  This is the function which creates the slide:

Screen Shot 2021-05-04 at 08.35.17.png                              Screen Shot 2021-05-04 at 08.33.15.png

It uses a helper function, exported from a different file, which deletes all slides before creating the one which the add on will interact with:

Screen Shot 2021-05-04 at 08.34.20.png

In here with have another helper function, called "activePresentation" which is making the app crash for some accounts:

Screen Shot 2021-05-04 at 08.34.31.png

And this is what is being logged in GCP when the error happens:

Screen Shot 2021-05-04 at 08.42.27.png

It says: Exception, Action not allowed.

The weird thing is that for some accounts it works perfectly, when the button is clicked it removes all the slides and creates a new one with the chosen title, but for some it doesn't and this error is given.

This is the line where the error happens in Apps Script:

Screen Shot 2021-05-04 at 08.45.33.png


I am happy to share the code on Github if someone wants to help. I have tried everything I could think of but I am a little clueless at the moment and have no idea what to do next.

Many thanks!

Rafael

Reply all
Reply to author
Forward
0 new messages