使用库的 Web 应用程序显示“抱歉,从存储读取时发生服务器错误”。某些用户收到错误代码 NOT_FOUND

发布于 2025-01-16 19:49:11 字数 903 浏览 2 评论 0原文

相同的错误消息,与略有相似,我们很抱歉,从存储读取时发生服务器错误。错误代码 NOT_FOUND (简单的 onOpen 触发器从库调用函数),但就我而言,我有一个 Web 应用程序。 最佳答案中的解决方案(使用版本而不是头部部署)并不适用,因为我的网络应用程序是已设置为使用库版本。对库进行轻微更改后,问题出现了。

  1. 网络应用程序运行良好,但我需要进行更改。
    • 我的网络应用使用全局变量来处理多个设置。
  2. 我对库进行了更改并创建了新版本
    • 这一变化是将文字字符串从一个数组移动到另一个数组。
  3. 我在网络应用程序中更新了库版本号。
  4. 该网络应用程序适用于我的帐户,但不适用于其他帐户。
  • 我查看了清单中的库版本号,一切正常。
  • 使用以前的库版本工作正常

该网络应用程序使用 Google Cloud 标准项目,设置仅供内部使用。该库由其他 Google Apps 脚本项目使用。它有多个命名空间 (var myNamespace = ((ns) => { /** some stuff here */ return ns})({})) 其中大多数都专注于使用单个服务(FormApp、SpreadsheetApp、DriveApp),但只有少数用于 Web 应用程序。

我无法重现该问题,因此我认为这与特定项目有关。禁用 V8 意味着太多的工作,即我使用了很多 constlet 、箭头函数和旧运行时不支持的其他东西。

Same error message and slightly similar to We're sorry, a server error occurred while reading from storage. Error code NOT_FOUND (simple onOpen trigger calling functions from a library), but in my case I had a web application. The solution from the top answer, to use a version instead of the head deployment, doesn't apply as my web app was already set to use a library version. The problem appeared after doing a slight change to the library.

  1. The web app was working fine, but I was required to make a change.
    • My web app uses global variables to handle several settings.
  2. I made a change to the library and created a new version
    • The change was moving a literal string from one array to another array.
  3. I updated the library version number in the web app.
  4. The web app works fine for my account but not for other accounts
  • I reviewed the library version number in the manifest, it was OK.
  • Using previous library versions works fine

The web app uses a Google Cloud Standard Project, set for internal use only. The library is used by other Google Apps Script projects. It has multiple namespaces (var myNamespace = ((ns) => { /** some stuff here */ return ns})({})) most of them are focused on using a single service (FormApp, SpreadsheetApp, DriveApp), but only few are used on the web app.

I wasn't able to reproduce the problem, so I think that it's related to the specific projects. Disabling V8 implies too much work i.e. I used a lot const , let, arrow functions and other stuff unsupported by the old runtime.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若水微香 2025-01-23 19:49:11

两种解决方法解决了该问题,但没有一个是“完美的”。

  1. 用副本替换库(相同的代码,不同的项目 URL / ID 和版本号)
  2. 进行新的 Web 应用程序部署(不同的 Web 应用程序 URL)

第一个的主要问题是我必须使用相同的内容更新其他项目库,后者的主要问题是新部署有不同的 URL,我必须通知 Web 应用程序用户新的 URL,他们可能必须更改他们的书签/更新他们的注释。

最后,我决定使用第二个,因为还有其他项目依赖该库来共享通过库 PropertiesService.getScriptProperties() 共享的解决方案设置。

Two workarounds solved the problem, none of them are "perfect".

  1. Replacing the library by a copy (same code, different project URL / ID and version number)
  2. Making a new web-app deployment (different web-app URL)

The main problem with the first is that I had to update other projects using the same library, the main problem with the later is that the new deployment has a different URL I had to notify the web app users the new URL, the might have to change their bookmarks / update their notes.

Finally I decided to use the second because there are other projects relaying on the library for sharing solutions settings shared through the library PropertiesService.getScriptProperties().

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文