Sheet add-on stopped loading after project document was undeleted - google-apps-script

Is there a way I can reach out to someone in the Google Apps team who could help me with an outage?
I accidentally deleted the file that contained the project associated with a Sheets Addon published on the web and having 5000+ users (had a thread here: https://stackoverflow.com/questions/36704711/i-accidentally-deleted-the-google-sheet-that-contained-code-for-my-published-add)
I worked with Google Drive support to undelete the file and now I can access it, and all the code is fine.
However, since then the addon installed by so many users stopped working for everyone. It gives the users the following error:
"We're sorry, a server error occurred. Please wait a bit and try again."
I tried re-publishing a new version of the add-on, but I can't do that either, I'm getting the following error:
Any help would be appreciated.

Was able to fix this by reassigning the sheets addon code to a different Developers Console Project: Resources -> Developer Console Project... -> Change Project.
Just created a new empty project for that.
It looks like the problem was in the addon being linked to a project that for some reason got deleted when I deleted the addon code. And restoring the addon code didn't restore the association with the project.
It's still a mistery to me how a Sheets Addon depends on the Developer Console Project, but reassigning it to a different project fixed the issue. I was also able to publish an updated version of the addon, however creation of the new project triggered a manual review, so it'll take some time before new fixes will become available.

Related

Simple function suddenly throws "An unknown error has occurred, please try again later"

Since today morning, I am getting the below message while trying to run new App scripts on a new Google sheet.
Error An unknown error has occurred, please try again later.
My other App scripts attached to existing Google sheets continue to run fine. But if I create a new sheet and add even a plain simple function as shown below and try to execute this, I get the above error after it attempts to run it for some time and then gives up.
function Mytest()
{
}
I suspect that it is not able to bring the permission box which it use to bring up for any new script created. Till yesterday, once the permissions dialog box comes up and I used to give the permissions, the scripts use to run fine. But today it is not even bringing up the permission dialog box.
It looks like there is a outage going on with Google Apps Script when running new projects. I can see a couple of people reporting it in Google's public issue tracker.
It looks like it is only affecting new projects but most old projects are running fine. In the meantime you can add more info to the report to bring more attention to it. I have made some tests in 4 different accounts from different organizations and I can confirm I am also affected by this.
A couple users are reporting that it started to fix itself, and it looks like clearing cache and cookies from the browser may solve the issue (this is not a definitive solution but may work for you).
Only happens with Apps Script-managed Google Cloud Platform projects. Seems okay if you manually set the GCP project with the id using Resources > Cloud Platform Project...
I tried this because mine started with this error:
We're sorry, there was an unexpected error while creating the Cloud Platform project. Error code DEADLINE_EXCEEDED
I was having the same issue. Adding the script ID to the Library seemed to fix it.
Go to the "settings" option in the left menu of the script editor and copy the script id. Then click the plus icon next to the "Library" option and click "look up". Once the script is found, click "add" and run the script.

Trying to update Google Sheets Addon

I am trying to update a Google Sheets Addon.
I currently face 2 problems:
the new Script Editor does not know anything about versions (so I used the legacy editor and created a new version there)
when I want to deploy the changes (via the G Suite Marketplace SDK) I get an "Project Key is not associated with the current project or the script version doesn't exist." error when I enter the new version.
What should I do?
We have just rolled back to a previous version, can you refresh and try again? Please let me know how it goes.

How can I bypass "Sign in with Google temporarily disabled for this app" in a Google Sheets script?

I'm attempting to use a script in a google sheet I've used in the past, and suddenly while trying to make a new sheet with this code, I'm getting a new error that is seemingly impossible to bypass.
"Sign in with Google temporarily disabled for this app
This app has not been verified yet by Google in order to use Google Sign In."
Normally, or at least every time I have used this script in the past, there has been an "advanced" and "continue anyway" option.
"This app isn't verified yet
"Advanced > Continue to Untitled Project (Unsafe)"
This is the code.gs script [gitlab link], how can I bypass this saftey check, and continue using this script as needed?
And for reference, these are the instructions for the whole project on git lab,
Unfortunately, there's no direct solution for the issue you are encountering.
According to the issue from Issue Tracker, the error you are encountering may be due to this cause:
an external user runs the script with sensitive scopes
A possible solution:
run the script from Incognito Mode and remove the project's permissions from myaccount.google.com/permissions
Ultimately, if this still doesn't solve your issue you can star the issue on Issue Tracker here.

Google Apps Script published add-on stopped working post chnages

I have a published Add-on in web store for Google Docs. I have also been able to make changes to it and re-publish to web store couple of times in past.
But when I made a recent change to add-on, it won't allow me to test as Add-on again. Only error I am getting is:
"There was a problem testing the script as an add-on. Please try again later."
I see in Google's Issue tracker that such problems have been reported but for Add-on for Google Sheet where Sheet being tested was deleted was causing the issue.
https://issuetracker.google.com/issues/36763685
I have used different Apps script projects to test the code before copying it to published Add-on. Now I am not able to get Select Document screen either.
Same Apps-script project if copied and run as Add-on, it works fine, but not published version. Since this is already a web store published add-on, I need to make this version work.
Any pointers will be of great help. Thanks!

My apps script code has seemingly disappeared overnight. How can I recover it?

I was not sure what to the title this, but the title is accurate. My apps script code I spent the last few days working on has up and vanished from the project.
I have a web app that I re-wrote all the javascript for over the last new days, it was working fine and I even deployed it as a new version of the web app. However, upon opening the apps script file today all my changes are no longer there. The published web app still works though, even though all the code no longer exists in the project.
I can recover code from the published web app by just copying elements from the page, but I had made a lot of changes to the app afterwards.
Key Points:
Changes I made were saved, I even deployed a new version of it with some of the new code.
None of the code from the last few days exists in any files in the project, it's as if i never worked on it at all.
How did this happen? How can I recover my "lost" code from a google apps script project?
I figured this out. I was going to delete the question, but thought it would be better to post an answer for anyone else that runs into this.
The Cause:
It looks like I had left a tab open on my work PC with the apps script project open. When changes are made, they don't update on all views like with most Google docs/Sheets. According to the revision history, it looks like it overwrote my project some time in the middle of the night.
The Fix:
You can see this by going to File> See Revision History you can then revert to a previous version of your project.