firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.01k stars 929 forks source link

I Can't Deploy Using firebase deploy #689

Closed shadow1349 closed 5 years ago

shadow1349 commented 6 years ago

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.
zholmes1 commented 6 years ago

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.

progone commented 6 years ago

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.

dysphasia commented 6 years ago

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

mgenti commented 6 years ago

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

mbleigh commented 6 years ago

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 notifications@github.com 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 .

williamgoodhew commented 6 years ago

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

MihailProcudin commented 6 years ago

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

ghost commented 6 years ago

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

uzuhara-ryonosuke commented 6 years ago

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.

ridgekimani commented 6 years ago

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

uzuhara-ryonosuke commented 6 years ago

doesnt seem work

ridgekimani commented 6 years ago

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

uzuhara-ryonosuke commented 5 years ago

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

AbdulmalekAlshugaa commented 5 years ago

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"

jagabs commented 5 years ago

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" },

david-potgieter commented 5 years ago

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

mbleigh commented 5 years ago

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

barberousse commented 5 years ago

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.
bkendall commented 5 years ago

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

radyz commented 4 years ago

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

Nirali-Tech commented 4 years ago

There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.

Error: HTTP Error: 404, Could not find Application "fir-friendlychat-6292b". Pls help guys

pullatjunaid commented 3 years ago

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

Worked for me!