firebase-tools: 410 HTTP RESPONSE ERROR When deploying firebase hosting

I have been deploying with firebase hosting with no issues then suddenly yesterday I tried to run firebase deploy from my laptop and got the following error.

i  deploying hosting
i  hosting: preparing dist/<project-name> directory for upload...

Error: An unexpected error has occurred.

Update

Thanks everyone! Upgrading fixed the issue.

For people looking for a quick and easy copy paste, try this: npm install -g firebase-tools or npm upgrade -g firebase-tools

Error Log

I checked the firebase-debug.log and this is what I saw:

[debug] [2018-10-25T12:06:52.032Z] <<< HTTP RESPONSE 200
[debug] [2018-10-25T12:06:52.033Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/<project-name>/tokens  
  
 Thu Oct 25 2018 08:06:52 GMT-0400 (EDT)
[debug] [2018-10-25T12:06:52.238Z] <<< HTTP RESPONSE 200
[info] 
[info] === Deploying to '<project-name>'...
[info] 
[info] i  deploying hosting
[info] i  hosting: preparing dist/<project-name> directory for upload...
[debug] [2018-10-25T12:06:52.683Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/<project-name>/uploads/<upload-hash>?fileCount=20&message=  
  
 Thu Oct 25 2018 08:06:52 GMT-0400 (EDT)
[debug] [2018-10-25T12:06:53.978Z] <<< HTTP RESPONSE 410
[debug] [2018-10-25T12:06:53.979Z] <<< HTTP RESPONSE BODY undefined
[debug] [2018-10-25T12:06:53.980Z] TypeError: Cannot read property 'error' of undefined
    at module.exports (/usr/local/lib/node_modules/firebase-tools/lib/responseToError.js:10:13)
    at Request._callback (/usr/local/lib/node_modules/firebase-tools/lib/api.js:45:25)
    at Request.self.callback (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:186:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:1163:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:313:30)
[error] 
[error] Error: An unexpected error has occurred.

Here is my firebase .json:

{
  "hosting": {
    "public": "dist/<project-name>",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

Version info

firebase 3.18.1

Upgrading to firebase 5 may be the first thing I should try but that would be a global install and I don’t want to accidentally break my other firebase projects that are currently working fine.

Also like I said I have not been having any issues with hosting except for this one deployment in this prohect so I think maybe something else is happening.

Platform Information

Os X

Steps to reproduce

Ran firebase deploy

Expected behavior

Actual behavior

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 12
  • Comments: 19 (4 by maintainers)

Most upvoted comments

I had the same issue, upgrading to firebase-tools@5 fixes it.

This command worked for me:

alias firebase="`npm config get prefix`/bin/firebase"

In case it helps anyone, I was updating but getting same version of firebase over and over again, and the issue is I started using nvm some time ago and the -g library was installed before. So I had to:

  1. Find where firebase command was living: which firebase And manually deleting the link and the folder firebase-tools. Then,
  2. npm i -g firebase-tools

Problem solved!

Thanks everyone! Upgrading fixed the issue.

For people looking for a quick and easy copy paste, try this: npm install -g firebase-tools or npm upgrade -g firebase-tools

Yes, you should definitely upgrade your firebase-tools to the latest version to address this issue.

On Thu, Oct 25, 2018, 6:22 AM Craig Mulligan <notifications@github.com wrote:

I had the same issue, upgrading to firebase-tools@5 fixes it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-tools/issues/967#issuecomment-433048430, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAD_pizB2b2uyoVUJmgrfOjzSqkwNQvks5uobsQgaJpZM4X6JZp .

npx firebase deploy

@MrBrownser - how did you go about manually deleting the link? Also, where is the firebase-tools folder stored?

I seem to be on the lastest firebase and firebase-tools version, but seem to still be getting the same error as the one in maganap’s stacktrace above^^.

it was strange, I upgraded firebase, but firebase --version was still showing 4.0.0, I think what fixed it was closing the terminal and opening it again.

FWIW there is supposed to be a friendly deprecation message that looks like this:

Error: HTTP Error: 410, This version of the Firebase CLI is no longer able to deploy to Firebase Hosting. Please upgrade to a newer version (>= 4.1.0). If you have further questions, please reach out to Firebase support.

Some folks aren’t seeing this, and I haven’t been able to reproduce to find out why 😞

for anyone else also running into the same issue as @robert-king and I - trying to upgrade and the terminal is still showing the original version, over and over, even after uninstalling and reinstalling everything - literally the thing that fixed it was closing my terminal and re-opening it 🤦‍♀️