【问题标题】:Firebase hosting rewrite mapped to function fails with Internal Error映射到函数的 Firebase 托管重写因内部错误而失败
【发布时间】:2021-08-09 13:17:05
【问题描述】:

我正在使用 Firebase 函数并通过以下 Firebase 托管重写来公开它们:

{
"hosting": {
    "public": "build",
    "headers": [
        {
            "source": "/service-worker.js",
            "headers": [
                {
                    "key": "Cache-Control",
                    "value": "no-cache"
                }
            ]
        }
    ],
    "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
    ],
    "rewrites": [
        // functions
         { "source": "/mappedUrlOne", "function": "functionOne" },
         { "source": "/mappedUrlTwo", "function": "functionTwo" },

        // landing page
        {
            "source": "**",
            "destination": "/index.html"
        }
    ]
}

当对映射的 URL(例如 /mappedUrlOne)运行重复调用时,函数在大约 50% 的时间间歇性地失败并出现 500 Internal Error。丢弃的请求甚至不会在 Firebase 日志中注册,并且会在 200-300 毫秒内失败。

如果我直接调用该函数(例如https://us-central1-my-project-name.cloudfunctions.net/functionOne),一切都会顺利。

这些映射已经部署并工作了一段时间,可能一年多,所以那里没有任何变化。

【问题讨论】:

    标签: firebase google-cloud-platform google-cloud-functions firebase-hosting


    【解决方案1】:

    似乎是 GCP 的问题。几个小时就修好了,没有任何改动。

    【讨论】:

      猜你喜欢
      • 2019-05-05
      • 1970-01-01
      • 2012-10-16
      • 2018-01-07
      • 2020-01-14
      • 2017-11-19
      • 1970-01-01
      • 1970-01-01
      • 2019-05-13
      相关资源
      最近更新 更多