Firebase-tools: Error: HTTP Error: 404, Not Found after deploying hosting

Created on 29 Nov 2018  Â·  4Comments  Â·  Source: firebase/firebase-tools

Version info


5.0.1

Platform Information

OS X

Steps to reproduce

firebase deploy --only hosting

Expected behavior

deploying hosting ok

Actual behavior

[2018-11-29T12:15:00.374Z] ----------------------------------------------------------------------
[2018-11-29T12:15:00.377Z] Command:       /usr/local/Cellar/node/11.2.0/bin/node /usr/local/bin/firebase deploy --only hosting --debug
[2018-11-29T12:15:00.377Z] CLI Version:   5.0.1
[2018-11-29T12:15:00.378Z] Platform:      darwin
[2018-11-29T12:15:00.378Z] Node Version:  v11.2.0
[2018-11-29T12:15:00.378Z] Time:          Thu Nov 29 2018 13:15:00 GMT+0100 (Central European Standard Time)
[2018-11-29T12:15:00.379Z] ----------------------------------------------------------------------

[2018-11-29T12:15:00.390Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-11-29T12:15:00.391Z] > authorizing via signed-in user
[2018-11-29T12:15:00.391Z] [iam] checking project komuti-acc for permissions ["firebase.projects.get","firebasehosting.sites.update"]
[2018-11-29T12:15:00.393Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/komuti-acc:testIamPermissions
 permissions=[firebase.projects.get, firebasehosting.sites.update]
[2018-11-29T12:15:01.374Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Thu, 29 Nov 2018 12:15:01 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", accept-ranges=none, connection=close
[2018-11-29T12:15:01.376Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/komuti-acc

[2018-11-29T12:15:02.094Z] <<< HTTP RESPONSE 200 server=nginx, date=Thu, 29 Nov 2018 12:15:02 GMT, content-type=application/json; charset=utf-8, content-length=112, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store

=== Deploying to 'komuti-acc'...

i  deploying hosting
i  hosting[komuti-acc]: beginning deploy...
i  hosting[komuti-acc]: found 0 files in public
[2018-11-29T12:15:04.732Z] [hosting] hash cache [cHVibGlj] not populated
✔  hosting[komuti-acc]: file upload complete
[2018-11-29T12:15:04.733Z] [hosting] deploy completed after 4ms
(node:5404) UnhandledPromiseRejectionWarning: Error
    at new FirebaseError (/usr/local/lib/node_modules/firebase-tools/lib/error.js:11:16)
    at Object.reject (/usr/local/lib/node_modules/firebase-tools/lib/utils.js:135:27)
    at /usr/local/lib/node_modules/firebase-tools/lib/deploy/hosting/prepare.js:59:20
    at arrayEach (/usr/local/lib/node_modules/firebase-tools/node_modules/lodash/lodash.js:516:11)
    at Function.forEach (/usr/local/lib/node_modules/firebase-tools/node_modules/lodash/lodash.js:9344:14)
    at module.exports (/usr/local/lib/node_modules/firebase-tools/lib/deploy/hosting/prepare.js:38:5)
    at _chain (/usr/local/lib/node_modules/firebase-tools/lib/deploy/index.js:26:38)
    at /usr/local/lib/node_modules/firebase-tools/lib/deploy/index.js:83:14
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:5404) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5404) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[2018-11-29T12:15:04.973Z] [
  {
    "config": {
      "public": "public",
      "rewrites": [
        {
          "source": "/api/**",
          "function": "api"
        }
      ],
      "site": "komuti-acc"
    },
    "site": "komuti-acc"
  }
]
i  hosting[komuti-acc]: finalizing version...
[2018-11-29T12:15:04.974Z] >>> HTTP REQUEST PATCH https://firebasehosting.googleapis.com/v1beta1/undefined?updateMask=status
 status=FINALIZED
[2018-11-29T12:15:05.894Z] <<< HTTP RESPONSE 404 date=Thu, 29 Nov 2018 12:15:05 GMT, content-type=text/html; charset=UTF-8, server=ESF, content-length=1596, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic=":443"; ma=2592000; v="44,43,39,35", connection=close
[2018-11-29T12:15:05.894Z] <<< HTTP RESPONSE BODY <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/v1beta1/undefined?updateMask=status</code> was not found on this server.  <ins>That’s all we know.</ins>


Error: HTTP Error: 404, Not Found
[2018-11-29T12:15:06.042Z] Error Context: {
  "body": {
    "error": {
      "message": "Not Found"
    }
  },
  "response": {
    "statusCode": 404,
    "body": "<!DOCTYPE html>\n<html lang=en>\n  <meta charset=utf-8>\n  <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n  <title>Error 404 (Not Found)!!1</title>\n  <style>\n    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n  </style>\n  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n  <p><b>404.</b> <ins>That’s an error.</ins>\n  <p>The requested URL <code>/v1beta1/undefined?updateMask=status</code> was not found on this server.  <ins>That’s all we know.</ins>\n",
    "headers": {
      "date": "Thu, 29 Nov 2018 12:15:05 GMT",
      "content-type": "text/html; charset=UTF-8",
      "server": "ESF",
      "content-length": "1596",
      "x-xss-protection": "1; mode=block",
      "x-frame-options": "SAMEORIGIN",
      "x-content-type-options": "nosniff",
      "alt-svc": "quic=\":443\"; ma=2592000; v=\"44,43,39,35\"",
      "connection": "close"
    },
    "request": {
      "uri": {
        "protocol": "https:",
        "slashes": true,
        "auth": null,
        "host": "firebasehosting.googleapis.com",
        "port": 443,
        "hostname": "firebasehosting.googleapis.com",
        "hash": null,
        "search": "?updateMask=status",
        "query": "updateMask=status",
        "pathname": "/v1beta1/undefined",
        "path": "/v1beta1/undefined?updateMask=status",
        "href": "https://firebasehosting.googleapis.com/v1beta1/undefined?updateMask=status"
      },
      "method": "PATCH"
    }
  }
}

question

Most helpful comment

Had same issue and finally solved it.

firebase login
firebase use --add (Choose the right Project ID)
firebase init (select hosting, than correct Project ID)
if needed (npm run build)
firebase deploy

Solution was number 2 Choosing the right Project ID Because some how firebase commands was refering automatically to a wrong Project ID

Good Luck

All 4 comments

Please update your installation of firebase-tools to the latest via npm i -g firebase-tools. Also note that we are not actively testing or supporting node versions greater than 10 - if you continue having issues, downgrade your version of node to 10 and see if the issue remains.

Thanks you were right, I had locally the latests version but not globally installed and it was picking up the wrong one, thanks for your time and sorry for the mistake.

An error also occurs if you try to update a project that is deleted from the Google developer console, you can delete the configuration files from the folder and place it in a new project

Had same issue and finally solved it.

firebase login
firebase use --add (Choose the right Project ID)
firebase init (select hosting, than correct Project ID)
if needed (npm run build)
firebase deploy

Solution was number 2 Choosing the right Project ID Because some how firebase commands was refering automatically to a wrong Project ID

Good Luck

Was this page helpful?
0 / 5 - 0 ratings