3

I'm having a hard time trying to figure out why the Firebase-CLI is outputting this error whenever I try to deploy:

[debug] [2018-01-16T17:05:03.558Z] >>> HTTP REQUEST PUT https://firebaserules.googleapis.com/v1/projects/liberaakademio/releases/firebase.storage/liberaakademio.appspot.com { name: 'projects/liberaakademio/releases/firebase.storage/liberaakademio.appspot.com',
  rulesetName: 'projects/liberaakademio/rulesets/a082eaed-1fac-4661-a7ed-156e18e776e1' } 
 Tue Jan 16 2018 15:05:03 GMT-0200 (-02)
[debug] [2018-01-16T17:05:04.784Z] <<< HTTP RESPONSE 404
[debug] [2018-01-16T17:05:04.784Z] <<< 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>/v1/projects/liberaakademio/releases/firebase.storage/liberaakademio.appspot.com</code> was not found on this server.  <ins>That’s all we know.</ins>

[debug] [2018-01-16T17:05:04.786Z] TypeError: Cannot create property 'error' on string '<!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>/v1/projects/liberaakademio/releases/firebase.storage/liberaakademio.appspot.com</code> was not found on this server.  <ins>That’s all we know.</ins>
'
    at module.exports (/usr/local/lib/node_modules/firebase-tools/lib/responseToError.js:11:16)
    at Request._callback (/usr/local/lib/node_modules/firebase-tools/lib/api.js:43:25)
    at Request.self.callback (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:186:22)
    at Request.emit (events.js:160:13)
    at Request.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:160:13)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:255:19)
    at IncomingMessage.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
[error] 
[error] Error: An unexpected error has occurred.

I already verified my rules documents by testing them on the platform, and they are published just fine.

I suspect the problem has something to do with my firebase.json file, that currently looks like this:

{
  "firestore": {
    "rules": "firebaseRules/firestore.rules",
    "indexes": "firebaseRules/indexes.rules"
  },
  "storage": {
    "rules": "firebaseRules/storage.rules"
  },
  "hosting": {
    "public": "build",
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ],
    "headers": [ {
      "source" : "**",
      "headers" : [ {
        "key" : "Access-Control-Allow-Origin",
        "value" : "https://api.liberaakademio.com"
      } ]
  } ]
  }
}
Rob
  • 14,746
  • 28
  • 47
  • 65
  • If you're having a problem with deployment and getting an error message that doesn't suggest you're doing something wrong, you should contact Firebase support to troubleshoot the problem. There's probably not that much that folks on Stack Overflow can do to help. https://firebase.google.com/support/contact/troubleshooting/ – Doug Stevenson Jan 16 '18 at 18:08
  • Hey, @DougStevenson. Luckily, I was able to solve it myself by trial and error (sort of). But that was good advice. Thank you! – Marcello Salomão Jan 17 '18 at 19:56

1 Answers1

4

Problem solved.

I'm not 100% sure, but I believe updating firebase-tools to the latest version and running firebase login --reauth fixed the error.

  • 1
    I faced the same issue. In my case updating firebase-tools and reauth lead to displaying a new error msg which uncovered an error in my functions. Ty! – yN. Feb 21 '18 at 06:42
  • maybe this and rebuilding before to upload – fpilee Oct 09 '18 at 16:57