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.
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"
}