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.
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
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"
}
]
}
}
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.
Os X
Ran firebase deploy
I had the same issue, upgrading to firebase-tools@5 fixes it.
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 <[email protected]
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
.
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 😞
I had the same problem and didn't see that message. Upgrading to ^5.0.0 has solved the problem for me.
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
I'm getting Error: HTTP Error: 410, Unknown Error
Have tried firebase-tools@5 and @6.0
have tried npm 5.60 and node 8.9.4 and node 10.1.0
Double check with firebase --version
There is no known circumstance where >= 4.1.0 would give a 410 error.
Please provide debug logs if you are seeing this error on a newer CLI
On Sat, Oct 27, 2018, 1:16 AM robert king @robertkingnz <
[email protected] wrote:
I'm getting Error: HTTP Error: 410, Unknown Error
Have tried firebase-tools@5 and @6.0
have tried npm 5.60 and node 8.9.4 and node 10.1.0—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-tools/issues/967#issuecomment-433601369,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAD_hWV2Z84JUxaSswZGKCznBB7tJBLks5upBZxgaJpZM4X6JZp
.
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.
It's possible that if you're running it as a yarn script it is using a
different version. Add --debug to the deploy command.
On Sat, Oct 27, 2018, 4:52 PM Michael Lustig <[email protected]
wrote:
@mbleigh https://github.com/mbleigh Where can I find logs that will be
of most use to you? I'm encountering the 410 error and have firebase-tools
version 5.1.1[image: image]
https://user-images.githubusercontent.com/6922904/47610381-c1807f80-da21-11e8-8d66-57423690431c.png—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/firebase-tools/issues/967#issuecomment-433664712,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAD_ht4MUP1hH-xYrCUo2T3vXLdSTSdks5upPGvgaJpZM4X6JZp
.
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!
Certainly npm upgrade -g firebase-tools solved the issue here. I went from 4.0.3 to 4.2.1.
@mbleigh In case you're still interested in Error: HTTP Error: 410, Unknown Error, here it is with --debug flag: (macOS 10.13.6)
$ firebase --debug deploy
[2018-10-28T21:26:33.797Z] ----------------------------------------------------------------------
[2018-10-28T21:26:33.802Z] Command: /usr/local/bin/node /usr/local/bin/firebase --debug deploy
[2018-10-28T21:26:33.802Z] CLI Version: 4.0.3
[2018-10-28T21:26:33.802Z] Platform: darwin
[2018-10-28T21:26:33.803Z] Node Version: v8.9.4
[2018-10-28T21:26:33.803Z] Time: Sun Oct 28 2018 22:26:33 GMT+0100 (CET)
[2018-10-28T21:26:33.803Z] ----------------------------------------------------------------------
[2018-10-28T21:26:33.816Z] > 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-10-28T21:26:33.817Z] > authorizing via signed-in user
[2018-10-28T21:26:33.819Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/<<some project here>>
Sun Oct 28 2018 22:26:33 GMT+0100 (CET)
[2018-10-28T21:26:34.517Z] <<< HTTP RESPONSE 200 server=nginx, date=Sun, 28 Oct 2018 21:26:34 GMT, content-type=application/json; charset=utf-8, content-length=162, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-10-28T21:26:34.518Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/<<some project here>>/tokens
Sun Oct 28 2018 22:26:34 GMT+0100 (CET)
[2018-10-28T21:26:35.040Z] <<< HTTP RESPONSE 200 server=nginx, date=Sun, 28 Oct 2018 21:26:34 GMT, content-type=application/json; charset=utf-8, content-length=283, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
=== Deploying to '<<some project here>>'...
i deploying hosting
i hosting: preparing dist directory for upload...
[2018-10-28T21:26:36.389Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/<<some project here>>/uploads/-LPwZZb8X8CUg5mbyd-7?fileCount=54&message=
Sun Oct 28 2018 22:26:36 GMT+0100 (CET)
[2018-10-28T21:26:39.122Z] <<< HTTP RESPONSE 410 server=nginx, date=Sun, 28 Oct 2018 21:26:39 GMT, content-type=application/json; charset=utf-8, content-length=240, connection=close, access-control-allow-origin=*, access-control-allow-methods=GET, PUT, POST, DELETE, OPTIONS, strict-transport-security=max-age=31556926; includeSubDomains; preload
[2018-10-28T21:26:39.122Z] <<< HTTP RESPONSE BODY undefined
Error: HTTP Error: 410, Unknown Error
[2018-10-28T21:26:39.265Z] Error Context: {
"body": {
"error": {
"message": "Unknown Error"
}
},
"response": {
"statusCode": 410,
"headers": {
"server": "nginx",
"date": "Sun, 28 Oct 2018 21:26:39 GMT",
"content-type": "application/json; charset=utf-8",
"content-length": "240",
"connection": "close",
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET, PUT, POST, DELETE, OPTIONS",
"strict-transport-security": "max-age=31556926; includeSubDomains; preload"
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "deploy.firebase.com",
"port": 443,
"hostname": "deploy.firebase.com",
"hash": null,
"search": "?fileCount=54&message=",
"query": "fileCount=54&message=",
"pathname": "/v1/hosting/<<some project here>>/uploads/-LPwZZb8X8CUg5mbyd-7",
"path": "/v1/hosting/<<some project here>>/uploads/-LPwZZb8X8CUg5mbyd-7?fileCount=54&message=",
"href": "https://deploy.firebase.com/v1/hosting/<<some project here>>/uploads/-LPwZZb8X8CUg5mbyd-7?fileCount=54&message="
},
"method": "PUT"
}
}
}
@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^^.
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 🤦♀️
This command worked for me:
alias firebase="`npm config get prefix`/bin/firebase"
thank you @ishbaid. I had the same issue of @robert-king.
If you upgraded your firebase-tools make sure to verify the firebase version.
firebase --version
This command worked for me:
alias firebase="`npm config get prefix`/bin/firebase"
I'm having this issue on a jenkins machine.
I'm not sure I can upgrade node and npm since the machine is building a couple different projects with different dependencies (total newbie on npm and node here, I'm just trying to deploy a firebase app).
+ [email protected]
+ [email protected]
18:32:31 + which node
18:32:31 /usr/bin/node
18:32:31 + node --version
18:32:31 v8.11.3
18:32:31 + which npm
18:32:31 /usr/bin/npm
18:32:31 + npm --version
18:32:31 5.6.0
18:32:31 + which firebase
18:32:31 /usr/bin/firebase
18:32:31 + firebase --version
18:32:32 4.0.3
18:32:32 + firebase deploy --token XXXXXXX --only hosting
18:32:35
18:32:35 === Deploying to ...
18:32:35
18:32:35 i deploying hosting
18:32:35 i hosting: preparing dist directory for upload...
18:32:35
18:32:35 i Progress: [
18:32:37 Error: HTTP Error: 410, Unknown Error
18:32:37 Build step 'Execute shell' marked build as failure
18:32:37 Finished: FAILURE
npx firebase deploy
npx firebase deploy
Do you know why this works? What's the issue here?
maybe this helps I updated firebase-tools but the problem persists and firebase --versions prints previously instaled version, then I closed the terminal and opened a new one and now firebase --versions prints the new version and then deploy worked fine
Most helpful comment
I had the same issue, upgrading to
firebase-tools@5fixes it.