firebase-tools: Error in deploying hosting

[REQUIRED] Environment info

firebase-tools: 9.0.1

Platform: macOS

[REQUIRED] Test case

Deploy firebase hosting

[REQUIRED] Steps to reproduce

firebase deploy --only hosting

Adding settings for CloudRun to the rewrite configuration will result in an error.

firebase.json:

        {
          "source": "/**",
          "run": {
            "region": "asia-northeast1",
            "serviceId": "xxx-api"
          }
        }

[REQUIRED] Expected behavior

Deploy completed without errors.

[REQUIRED] Actual behavior

i  deploying hosting

Error: HTTP Error: 400, Precondition check failed.

end of firebase-debug.log:

[debug] [2020-12-17T06:32:50.423Z] <<< HTTP RESPONSE 400 {"vary":"X-Origin, Referer, Origin,Accept-Encoding","content-type":"application/json; charset=UTF-8","date":"Thu, 17 Dec 2020 06:32:50 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2020-12-17T06:32:50.423Z] <<< HTTP RESPONSE BODY {"error":{"code":400,"message":"Precondition check failed.","status":"FAILED_PRECONDITION"}}
[error] 
[error] Error: HTTP Error: 400, Precondition check failed.
[debug] [2020-12-17T06:32:50.663Z] Error Context: {
  "body": {
    "error": {
      "code": 400,
      "message": "Precondition check failed.",
      "status": "FAILED_PRECONDITION"
    }
  },
  "response": {
    "statusCode": 400,
    "body": {
      "error": {
        "code": 400,
        "message": "Precondition check failed.",
        "status": "FAILED_PRECONDITION"
      }
    },
    "headers": {
      "vary": "X-Origin, Referer, Origin,Accept-Encoding",
      "content-type": "application/json; charset=UTF-8",
      "date": "Thu, 17 Dec 2020 06:32:50 GMT",
      "server": "ESF",
      "cache-control": "private",
      "x-xss-protection": "0",
      "x-frame-options": "SAMEORIGIN",
      "x-content-type-options": "nosniff",
      "alt-svc": "h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"",
      "accept-ranges": "none",
      "transfer-encoding": "chunked"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "firebasehosting.googleapis.com",
        "port": 443,
        "hostname": "firebasehosting.googleapis.com",
        "hash": null,
        "search": null,
        "query": null,
        "pathname": "/v1beta1/sites/xxxxx/versions",
        "path": "/v1beta1/sites/xxxxx/versions",
        "href": "https://firebasehosting.googleapis.com/v1beta1/sites/xxxxx/versions"
      },
      "method": "POST"
    }
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 17
  • Comments: 22 (3 by maintainers)

Most upvoted comments

This should be fully mitigated within the next 10 minutes or so. Sorry for the inconvenience, folks. If you’re having issues after that, please comment!

Hey folks, we’re seeing an issue specifically with deploying Cloud Run rewrites to Firebase Hosting at the moment. I’m working on getting something posted to the Firebase status dashboard (I’ll link when it’s there) but just acknowledging a problem that we’re looking into.

@mbleigh Would really appreciate your help in this matter. I am unable to deploy some important changes to production because of this issue.

I just tried it now (18:20 JST) and the result is the same. If I remove the rewrite setting, it succeeds, so that may be the problem. But I don’t know how to solve it.

As of 09 December 2020, 04:52:00 UTC it was successful. The version of firebase-tools at that time was 8.18.0.

If I downgrade to version 8.18.0 now, I get the same result.

Works for me as well 👍

@mbleigh Thanks very very very much for addressing this, it works for me know!