firebase deploy --only hosting gives Error: HTTP Error: 410, Unknown Error

Viewed 5380

this is my log :

 [info] === Deploying to 'test-123'...
    [info] 
    [info] i  deploying hosting
    [info] i  hosting: preparing public directory for upload...
    [debug] [2018-10-25T15:39:54.587Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/test-123/uploads/-LPfsRseOoTTgVVj-keR?fileCount=81&message=  

     Thu Oct 25 2018 21:09:54 GMT+0530 (India Standard Time)
    [debug] [2018-10-25T15:40:00.337Z] <<< HTTP RESPONSE 410
    [debug] [2018-10-25T15:40:00.337Z] <<< HTTP RESPONSE BODY undefined
    [debug] [2018-10-25T15:40:00.339Z] TypeError: Cannot read property 'error' of undefined
        at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:10:13)
        at Request._callback (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:47:25)
        at Request.self.callback (C:\Users\user\AppData\Roaming\npm\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> (C:\Users\user\AppData\Roaming\npm\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> (C:\Users\user\AppData\Roaming\npm\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.

till yesterday everything was fine

when i deploy functions one by one or all at the same time everything works fine

please suggest something if someone knows about it

it says HTTPS ERROR 410 which i googled and found out that means the resource has moved

so the url requested might not be working but when i put that in browser its working fine

and i upgraded node, all npm modules still no luck

8 Answers

I found this response from the firebase-community Slack group https://firebase-community.slack.com:

If you are receiving a 410 error, you will likely need to update your cli version (firebase-tools). Updating to the latest version should fix it. You will need to upgrade your CLI version to at least 4.1.0 (>= 5.1.1 is recommended).

I was using firebase-tools: version 3.18.4 previously, and after upgrading to the latest version (5.1.1), I was able to deploy successfully:

npm install -g firebase-tools@5.1.1

For me only installing specific version worked e.g npm install -g firebase-tools@5.1.1

Update global npm "firebase-tools"

Updating firebase tools with npm update -g firebase-tools fixed this for me. I also had to close my terminal session and open a new one to use the new cli version.

My problem was using nvm the version of firebase-tools was mixed, however this npx firebase deploy worked for me.

Credit goes to heydanhey here github issue

After updating firebase I also needed to run this command.

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

Upgrading the dependencies for the project may help

npm install --save firebase-functions@latest

This worked for me:

  1. Upgrade firebase npm update -g firebase-tools
  2. Log out firebase logout
  3. Log back in firebase login
  4. Deploy firebase deploy
Related