1

I've published a private sheets addon for my company, but unfortunately when I try to run it both onInstall and onOpen fail with no execution logs and a 0s execution time in the Apps Script Console. It works fine from the sheet associated with the script project, just not from anywhere else. All I have to go on is an error in the chrome console:

Google Apps Script: We're sorry, a server error occurred while reading from storage. Error code PERMISSION_DENIED.

Here are the relevant functions:

function onInstall(e) {
  onOpen(e);
  Logger.log("Installed")
  // Perform additional setup as needed.
}

function onOpen(e) {
    Logger.log("Opening...")
    var ui = SpreadsheetApp.getUi();
    ui.createAddonMenu()
        .addItem("Launch", "run")
        .addToUi()
    Logger.log("Added menu items")
}

None of the logger messages are actually logged, making me think that the function is never being launched despite the execution showing up in the console.

Console logs

Any tips on how to debug/track down the error would be greatly appreciated!

Edit: I've also tried testing it via the script editor with AuthMode.NONE and AuthMode.LIMITED. Both work fine. I only encounter the error when running after installing via the GSuite Marketplace.

Here is the manifest.json:

{
  "timeZone": "America/New_York",
  "dependencies": {
  },
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8"
}
  • Does this answer your question? [We're sorry, a server error occurred while reading from storage. Error code PERMISSION\_DENIED](https://stackoverflow.com/questions/60230776/were-sorry-a-server-error-occurred-while-reading-from-storage-error-code-perm) – Martin Zeitler Jun 12 '20 at 00:11
  • Unfortunately no, I tried both solutions listed there but no change. – Chain_Reaktion Jun 12 '20 at 02:04
  • The way you write logs to Stack Driver is by using `console.log("Something to log")`. If you use `Logger` class, those logs will only be visible from the editor, and get deleted after each run. And please provide a copy of your "manifest.json" file – Aerials Jun 12 '20 at 07:44

1 Answers1

1

It appears to be working now. I changed the timeZone in manifest.json to America/Los_Angeles (my local tz) and re-published and all errors are gone. Not sure if this change is what made the difference or not, but thanks to Aerials for the nudge to look there.

Edit: This may also have been related to my use of clasp deployments. The problem recurred for me after modifying the script. I created a new deployment via the script editor UI (Publish -> Publish from manifest) and then clicked the "install addon" next to the new version. I also updated the Gsuite marketplace listing to point at the new version, and everything seems to be working.