firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

I Can't Deploy Using firebase deploy

Open shadow1349 opened this issue 8 years ago • 22 comments

Version info

Firebase Version: 3.17.4

Platform Information

OS X and Linux

Steps to reproduce

What I did was create a CI token using the firebase cli by doing firebase login:ci

Now I can't deploy without a token, even though I've logged out and logged back in multiple times, I have also tried going to https://myaccount.google.com/permissions and removed permission then logged in again.

Expected behavior

When I run firebase deploy for my functions I should be able to deploy them.

Actual behavior

firebase deploy --only functions
Error: An unexpected error has occurred.

[debug] [2018-03-07T07:26:18.988Z] Error: Firebase.authWithCustomToken failed: First argument must be a valid credential (a string).
    at ng (/usr/local/lib/node_modules/firebase-tools/node_modules/firebase/lib/firebase-node.js:129:313)
    at X.gg (/usr/local/lib/node_modules/firebase-tools/node_modules/firebase/lib/firebase-node.js:266:131)
    at /usr/local/lib/node_modules/firebase-tools/lib/acquireRefs.js:19:19
    at initializePromise (/usr/local/lib/node_modules/firebase-tools/node_modules/rsvp/dist/rsvp.js:567:5)
    at new Promise (/usr/local/lib/node_modules/firebase-tools/node_modules/rsvp/dist/rsvp.js:1039:33)
    at /usr/local/lib/node_modules/firebase-tools/lib/acquireRefs.js:12:12
    at tryCatch (/usr/local/lib/node_modules/firebase-tools/node_modules/rsvp/dist/rsvp.js:525:12)
    at invokeCallback (/usr/local/lib/node_modules/firebase-tools/node_modules/rsvp/dist/rsvp.js:538:13)
    at publish (/usr/local/lib/node_modules/firebase-tools/node_modules/rsvp/dist/rsvp.js:508:7)
    at flush (/usr/local/lib/node_modules/firebase-tools/node_modules/rsvp/dist/rsvp.js:2415:5)
[error] 
[error] Error: An unexpected error has occurred.

shadow1349 avatar Mar 07 '18 07:03 shadow1349

Same exact issue here. Can't deploy Functions.

Error: Firebase.authWithCustomToken failed: First argument must be a valid credential (a string).

firebase-tools 3.17.4 node 9.3.0

@shadow1349 FYI: Rollback to firebase-tools 3.17.0 worked for me.

zholmes1 avatar Mar 07 '18 14:03 zholmes1

If you are having the same error I once had. Go into Firebase Console, check your usage under hosting, usage. I was over my free 1gb. Are you over the limit?

Once I changed my plan; the token error went away.

progone avatar Mar 07 '18 15:03 progone

I've been having this same issue since Monday. Occasionally it has worked but with an extremely long delay.

@shadow1349 Rolling back to 3.17.0 did not resolve the issue for me

@progone I am on a blaze plan and only using 55 MB of storage so I don't believe that is the issue

dysphasia avatar Mar 07 '18 16:03 dysphasia

Just had the same issue but a firebase login --reauth made it start working again for me

mgenti avatar Mar 07 '18 17:03 mgenti

Anyone experiencing this issue persistently (on a Mac/Linux device), please try the following:

  1. Run firebase deploy, ensure the error is still happening
  2. Run cat ~/.config/configstore/firebase-tools.json
  3. Copy the "access_token" from the "tokens" field of the JSON file
  4. Run curl -i --header "Authorization: Bearer <TOKEN>" https://admin.firebase.com/v1/database/<PROJECT_ID>/tokens
  5. Send the response you get to my email directly (DO NOT reply to the whole group).

Thanks!

On Wed, Mar 7, 2018 at 9:02 AM Mark Guagenti [email protected] wrote:

Just had the same issue but a firebase login --reauth made it start working again for me

— 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/689#issuecomment-371207668, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAD_nH-Y53cDegkH1-6Kir8_q3_lWm1ks5tcBKJgaJpZM4Sf_ol .

mbleigh avatar Mar 07 '18 18:03 mbleigh

I am trying to deploy on firebase.

I have deployed in the past and it was working fine.

I tried to deploy a few days ago and I am told the deployment is complete, I am getting no errors, however, when I go to the Hosting URL my old website was there. I have connected it to a custom domain.

I then deleted the old version via the firebase hosting console, now I am just left with 'Welcome Firebase Hosting Setup Complete' screen on the hosting URL.

this has been going on for a few days now. I have tried firebase login --reauth with no luck.

firebase version 3.17.7 osx

Note: the deployments are showing up in the console but not via either my custom domian or the firebase hosting url thanks

williamgoodhew avatar Apr 26 '18 09:04 williamgoodhew

after command firebase deploy it stuck on hosting section. what to do ??

MihailProcudin avatar May 06 '18 11:05 MihailProcudin

Am having the same problem --reauth doesn't seem to work

ghost avatar Sep 12 '18 21:09 ghost

i just had the following error and have tried deploy over and over but doesn't work at all. please let me have some solutions.. === Deploying to 'firendlychat-d1c40'...

i deploying database, storage, functions, hosting

Error: An unexpected error has occurred.

uzuhara-ryonosuke avatar Sep 18 '18 15:09 uzuhara-ryonosuke

Make sure you are running the latest version of firebase tools. You can do that by re-installing firebase tools. npm install -g firebase-tools

ridgekimani avatar Sep 19 '18 10:09 ridgekimani

doesnt seem work

uzuhara-ryonosuke avatar Sep 19 '18 14:09 uzuhara-ryonosuke

If you are on free plan, you can check if the storage is exhausted. From there you can select a plan.

ridgekimani avatar Sep 19 '18 20:09 ridgekimani

Have my prob done finally. the cause is,i jsut put database-rules.json and storage.json on another directory...

uzuhara-ryonosuke avatar Sep 20 '18 13:09 uzuhara-ryonosuke

Just change the funications.json to this line of codes and everything will work pretty fine "npm --prefix functions run lint", "npm --prefix functions run build"

AbdulmalekAlshugaa avatar Sep 20 '18 19:09 AbdulmalekAlshugaa

Error: HTTP Error: 500, Internal error encountered. firebase-tools 6.3.1

"body": { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" } }, "response": { "statusCode": 500, "body": { "error": { "code": 500, "message": "Internal error encountered.", "status": "INTERNAL" } }, "headers": { "vary": "X-Origin, Referer, Origin,Accept-Encoding", "content-type": "application/json; charset=UTF-8", "date": "Wed, 06 Feb 2019 10:03:15 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"", "accept-ranges": "none", "transfer-encoding": "chunked" },

jagabs avatar Feb 06 '19 10:02 jagabs

@jagabs - There is a status on the issue: https://status.firebase.google.com/incident/Hosting/19006 - so it's being looked at.

david-potgieter avatar Feb 06 '19 12:02 david-potgieter

The issue should be resolved as of a couple of hours ago. Sorry for the inconvenience, folks.

mbleigh avatar Feb 06 '19 17:02 mbleigh

I am getting a 410 in response to uploading the project public directory

[2019-03-04T18:46:08.016Z] <<< HTTP RESPONSE 410 server=nginx, date=Mon, 04 Mar 2019 18:46:07 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
[2019-03-04T18:46:08.017Z] <<< HTTP RESPONSE BODY undefined
[2019-03-04T18:46:08.019Z] TypeError: Cannot read property 'error' of undefined
    at module.exports (/Users/user/Repos/stlvl/node_modules/firebase-tools/lib/responseToError.js:10:13)
    at Request._callback (/Users/user/Repos/stlvl/node_modules/firebase-tools/lib/api.js:47:25)
    at Request.self.callback (/Users/user/Repos/stlvl/node_modules/request/request.js:185:22)
    at Request.emit (events.js:197:13)
    at Request.EventEmitter.emit (domain.js:446:20)
    at Request.<anonymous> (/Users/user/Repos/stlvl/node_modules/request/request.js:1157:10)
    at Request.emit (events.js:197:13)
    at Request.EventEmitter.emit (domain.js:446:20)
    at IncomingMessage.<anonymous> (/Users/user/Repos/stlvl/node_modules/request/request.js:1079:12)
    at Object.onceWrapper (events.js:285:13)

Error: An unexpected error has occurred.

ghost avatar Mar 04 '19 18:03 ghost

@barberousse please open a new issue with all the relevant information.

bkendall avatar Mar 04 '19 19:03 bkendall

I just started to get this error without any detail to debug possible causes


[2020-04-14T21:26:32.028Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Tue, 14 Apr 2020 21:26:34 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-04-14T21:26:34.032Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/Y29udmVyc2lvbm9taWNzLTUtZGV2ZWxvcG1lbnQvdXMtY2VudHJhbDEvZmFjZWJvb2stY3hVcGRhdGVMb2FkLzB1b0kyUnpTQlZF

[2020-04-14T21:26:34.464Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Tue, 14 Apr 2020 21:26:36 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-04-14T21:26:36.468Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/Y29udmVyc2lvbm9taWNzLTUtZGV2ZWxvcG1lbnQvdXMtY2VudHJhbDEvZmFjZWJvb2stY3hVcGRhdGVMb2FkLzB1b0kyUnpTQlZF

[2020-04-14T21:26:37.858Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Tue, 14 Apr 2020 21:26:39 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-04-14T21:26:39.864Z] >>> HTTP REQUEST GET https://cloudfunctions.googleapis.com/v1/operations/Y29udmVyc2lvbm9taWNzLTUtZGV2ZWxvcG1lbnQvdXMtY2VudHJhbDEvZmFjZWJvb2stY3hVcGRhdGVMb2FkLzB1b0kyUnpTQlZF

[2020-04-14T21:26:40.408Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Tue, 14 Apr 2020 21:26:42 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"quic=\":443\"; ma=2592000; v=\"46,43\",h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000","accept-ranges":"none","transfer-encoding":"chunked"}
⚠  functions[fn-name(us-central1)]: Deployment error.
Build failed: Build error details not available

I've updated firebase cli to 8.0.3 with no luck. I've enabled Google Cloud Build due to an email where starting from April 20, 2020 it would be required, no luck either

radyz avatar Apr 14 '20 21:04 radyz