Firebase deploy stucks / hangs without error message - firebase

The command Firebase deploy always stucks when I run it.
Here is the verbose info:
$ firebase deploy --token "SOMETOKEN" --debug
----------------------------------------------------------------------
Command: /usr/local/bin/node /usr/local/bin/firebase deploy --token SOMETOKEN --debug
CLI Version: 3.0.0
Platform: darwin
Node Version: v5.0.0
Time: Tue May 24 2016 14:25:31 GMT+0800 (CST)
----------------------------------------------------------------------
> command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
> refreshing access token with scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
>>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token refresh_token=SOMETOKEN, client_id=XXXXXX-XXXXXX.apps.googleusercontent.com, client_secret=XXXXXX, grant_type=refresh_token, scope=email openid https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase
<<< HTTP RESPONSE 200 cache-control=no-cache, no-store, max-age=0, must-revalidate, pragma=no-cache, expires=Mon, 01 Jan 1990 00:00:00 GMT, date=Tue, 24 May 2016 06:25:33 GMT, vary=X-Origin, Origin,Accept-Encoding, content-type=application/json; charset=UTF-8, x-content-type-options=nosniff, x-frame-options=SAMEORIGIN, x-xss-protection=1; mode=block, server=GSE, alternate-protocol=443:quic, alt-svc=quic=":443"; ma=2592000; v="34,33,32,31,30,29,28,27,26,25", accept-ranges=none, connection=close
>>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/hackdaychat
<<< HTTP RESPONSE 200 server=nginx, date=Tue, 24 May 2016 06:25:34 GMT, content-type=application/json; charset=utf-8, content-length=109, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
>>> HTTP REQUEST GET https://admin.firebase.com/v1/database/hackdaychat/tokens
<<< HTTP RESPONSE 200 server=nginx, date=Tue, 24 May 2016 06:25:36 GMT, content-type=application/json; charset=utf-8, content-length=423, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
As you can see, I tried it with a token I have created before via firebase login:ci.
Without a token it is the same result.
I have also created the local Firebase project. There was no error during Firebase init.
Firebase --list works fine. FireBase login and Firebase logout works fine.
Some additional info:
$ node -v --> v5.0.0
$ npm -v --> 3.3.6
$ firebase -V --> 3.0.0
OS: OS X 10.11.4
Location: Shanghai, but using Proxy to Singapur.
Access to Firebase website works fine.
I have owner rights on the project I am using
I try to deploy some kind of empty project. Means: My public folder only contains index.html and 404.html.
Anyone got an idea what could go wrong?

I got similar problem
Try
firebase logout
then
firebase login
it's works on my case. Once i logged in it's seem firebase app required extra permissions
also
npm update -g firebase-tools

Same here
firebase login and logout work fine. Same with init.
Also tried with and without a token. Same result as described by Frank.
I am behind a corporate proxy.
node -v --> v4.4.2
firebase --version --> 3.0.1
npm -v --> 2.15.0

Related

Firebase cloud run tutorial Permission denied

I am trying to get the tutorial for firebase and cloud run to work following the instructions here.
In the firebase deploy step I keep getting a permission denied error, here is the error stack:
firebase deploy --debug
i deploying hosting
[2020-12-07T03:52:01.058Z] >>> HTTP REQUEST POST https://firebasehosting.googleapis.com/v1beta1/sites/nubonetics/versions
{"config":{"rewrites":[{"glob":"**","run":{"region":"us-central1","serviceId":"helloworld"}}]},"labels":{"deployment-tool":"cli-firebase"}}
[2020-12-07T03:52:01.524Z] <<< HTTP RESPONSE 403 {"vary":"X-Origin, Referer, Origin,Accept-Encoding","content-type":"application/json; charset=UTF-8","date":"Mon, 07 Dec 2020 03:52:01 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[2020-12-07T03:52:01.525Z] <<< HTTP RESPONSE BODY {"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED"}}
You probably need to set up your permissions on CloudRun.
Check out the "Before you begin" section of the following article:
https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-cloud-run

Export firebase user account emails

I'm having a problem exporting the user account emails from Firebase.
I just revisited an old project I haven't touched in months and I'd like to export the email addresses. I'm in my functions folder, and have done:
npm install -g firebase-tools
then
npm install firebase-functions
and
npm install
No issues here. I then enter:
firebase auth:export save_file.csv --format=csv
and I get the output:
$ firebase auth:export save_file.csv --format=csv
Exporting accounts to save_file.csv
Error: An unexpected error has occurred.
I also read that you can try firebase login --interactive but when I do that I get the error:
Already logged in as ***#gmail.com
How should I go about debugging this/what should I be doing to export the emails? Any ideas?
Thank you.
Edit: I dug into the firebase-debug and the output showed:
[debug] [2020-01-20T21:49:31.847Z] ----------------------------------------------------------------------
[debug] [2020-01-20T21:49:31.849Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Simon K\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js auth:export save_file.csv --format=csv
[debug] [2020-01-20T21:49:31.849Z] CLI Version: 7.12.1
[debug] [2020-01-20T21:49:31.849Z] Platform: win32
[debug] [2020-01-20T21:49:31.849Z] Node Version: v12.7.0
[debug] [2020-01-20T21:49:31.851Z] Time: Mon Jan 20 2020 16:49:31 GMT-0500 (Eastern Standard Time)
[debug] [2020-01-20T21:49:31.851Z] ----------------------------------------------------------------------
[debug] [2020-01-20T21:49:31.851Z]
[debug] [2020-01-20T21:49:31.857Z] > 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"]
[debug] [2020-01-20T21:49:31.858Z] > authorizing via signed-in user
[debug] [2020-01-20T21:49:31.859Z] [iam] checking project anonymous-social for permissions ["firebase.projects.get","firebaseauth.users.get"]
[debug] [2020-01-20T21:49:31.860Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-01-20T21:49:31.860Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-01-20T21:49:32.050Z] <<< HTTP RESPONSE 400
[debug] [2020-01-20T21:49:32.051Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/anonymous-social:testIamPermissions
[debug] [2020-01-20T21:49:32.183Z] <<< HTTP RESPONSE 401
[debug] [2020-01-20T21:49:32.183Z] <<< HTTP RESPONSE BODY
[debug] [2020-01-20T21:49:32.184Z] [iam] error while checking permissions, command may fail: FirebaseError: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[info] Exporting accounts to save_file.csv
[debug] [2020-01-20T21:49:32.185Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-01-20T21:49:32.185Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token
<request body omitted>
[debug] [2020-01-20T21:49:32.332Z] <<< HTTP RESPONSE 400
[debug] [2020-01-20T21:49:32.333Z] >>> HTTP REQUEST POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/downloadAccount
[debug] [2020-01-20T21:49:32.457Z] <<< HTTP RESPONSE 401
[debug] [2020-01-20T21:49:32.457Z] <<< HTTP RESPONSE BODY
[debug] [2020-01-20T21:49:32.614Z] TypeError: Cannot read property 'code' of undefined
at C:\Users\Simon K\AppData\Roaming\npm\node_modules\firebase-tools\lib\accountExporter.js:170:26
at processTicksAndRejections (internal/process/task_queues.js:85:5)
[error]
[error] Error: An unexpected error has occurred.
Does this make sense?
For anyone struggling with the same. I ended up having to logout and relogin to firebase. I think my token had expired or something like that.
firebase logout
firebase login --interactive
I had to login twice for some reason but it worked then!
Did you run firebase use --add?
Or, could you try any following commands?
firebase projects:list
firebase use project_id_or_alias
--project flag.(firebase auth:export save_file.csv --format=csv --project=project_id_or_alias)
See:
https://firebase.google.com/docs/cli

Firebase Hosting : Deploy is not working - it stops & not gives any response

I am Trying to Deploy my one-page website in Firebase Hosting, I was able to successfully initiate and serve the Website on my local system.
After using firebase deploy there is no response from the server. I kept it for more than 12 hours, but it is stuck there only and nothing updated or deployed.
Please Check the log here :
[debug] [2018-08-15T05:41:14.975Z] ----------------------------------------------------------------------
[debug] [2018-08-15T05:41:14.975Z] Command: C:\Program Files\nodejs\node.exe C:\Users\babu\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase deploy
[debug] [2018-08-15T05:41:14.975Z] CLI Version: 3.18.6
[debug] [2018-08-15T05:41:14.975Z] Platform: win32
[debug] [2018-08-15T05:41:14.975Z] Node Version: v9.11.1
[debug] [2018-08-15T05:41:14.975Z] Time: Wed Aug 15 2018 09:41:14 GMT+0400 (Arabian Standard Time)
[debug] [2018-08-15T05:41:14.975Z] ----------------------------------------------------------------------
[debug]
[debug] [2018-08-15T05:41:14.985Z] > 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"]
[debug] [2018-08-15T05:41:14.985Z] > authorizing via signed-in user
[debug] [2018-08-15T05:41:14.994Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/functions-project-97a23
Wed Aug 15 2018 09:41:14 GMT+0400 (Arabian Standard Time)
[debug] [2018-08-15T05:41:16.011Z] <<< HTTP RESPONSE 200
[debug] [2018-08-15T05:41:16.011Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/functions-project-97a23/tokens
Wed Aug 15 2018 09:41:16 GMT+0400 (Arabian Standard Time)
[debug] [2018-08-15T05:41:16.873Z] <<< HTTP RESPONSE 200
I have completed similar task 3 months back, but same procedure is not working now.
Here is My Command line:
E:\Download\Compressed\Extra\GGM>firebase deploy --only hosting
^CTerminate batch job (Y/N)? y
E:\Download\Compressed\Extra\GGM>firebase serve
=== Serving from 'E:\Download\Compressed\Extra\GGM'...
i functions: Preparing to emulate functions.
i hosting: Serving hosting files from: GGMFinal
+ hosting: Local server: http://localhost:5000
Warning: You're using Node.js v9.11.1 but Google Cloud Functions only supports v6.11.5.
i functions: No HTTPS functions found. Use firebase functions:shell if you would like to emulate other types of functions.
Shutting down...
Terminate batch job (Y/N)? y
E:\Download\Compressed\Extra\GGM>firebase functions:shell
i functions: Preparing to emulate functions.
Warning: You're using Node.js v9.11.1 but Google Cloud Functions only supports v6.11.5.
i functions: No functions to emulate.
No functions emulated.
E:\Download\Compressed\Extra\GGM>firebase deploy
^CTerminate batch job (Y/N)? y
E:\Download\Compressed\Extra\GGM>

firebase deploy hangs without error (firebase tools 3.17.2)

I am attempting to deploy a firebase hosting project and I find it hangs and never progresses. The project has just been created with firebase init and only contains the index.html and 404.html files within the public folder.
The debug output from the command is
C:\VSProjects\wearable>firebase deploy --debug
[2018-01-30T12:34:39.086Z] ----------------------------------------------------------------------
[2018-01-30T12:34:39.093Z] CLI Version: 3.17.2
[2018-01-30T12:34:39.093Z] Platform: win32
[2018-01-30T12:34:39.095Z] Node Version: v9.4.0
[2018-01-30T12:34:39.103Z] Time: Tue Jan 30 2018 23:34:39 GMT+1100 (AUS Eastern Daylight Time)
[2018-01-30T12:34:39.103Z] ----------------------------------------------------------------------
[2018-01-30T12:34:39.129Z] > 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-01-30T12:34:39.130Z] > authorizing via signed-in user
[2018-01-30T12:34:39.134Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/[project hidden]
Tue Jan 30 2018 23:34:39 GMT+1100 (AUS Eastern Daylight Time)
[2018-01-30T12:34:40.002Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 30 Jan 2018 12:34:40 GMT, content-type=application/json; charset=utf-8, content-length=111, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store, via=HTTP/1.1 proxy10730
[2018-01-30T12:34:40.005Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/[project hidden]/tokens
Tue Jan 30 2018 23:34:40 GMT+1100 (AUS Eastern Daylight Time)
[2018-01-30T12:34:41.275Z] <<< HTTP RESPONSE 200 server=nginx, date=Tue, 30 Jan 2018 12:34:41 GMT, content-type=application/json; charset=utf-8, content-length=263, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store, via=HTTP/1.1 proxy10730
I have attempted the following:
a) Logout and login
b) return firebase tools 3.17.2
c) Node 9.3.0
Any assistance you can provide would be greatly appreciated.

firebase init gives EPROTO error

Running firebase init command gives an EPROTO error. Same error when I try firebase list. I can successfully use firebase login though. Here is the output of the firebase.debug.log:
[debug] ----------------------------------------------------------------------
[debug] Command: C:\Program Files\nodejs\node.exe C:\Users\andre\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase init
[debug] CLI Version: 3.13.1
[debug] Platform: win32
[debug] Node Version: v8.8.1
[debug] Time: Sat Oct 28 2017 12:35:18 GMT+0100 (GMT Summer Time)
[debug] ----------------------------------------------------------------------
[debug]
[debug] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
[debug] [2017-10-28T11:35:18.899Z] > authorizing via signed-in user
You're about to initialize a Firebase project in this directory:
C:\Users\andre\Documents\cake-poly20-test
[info]
=== Project Setup
[info]
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add,
[info] but for now we'll just set up a default project.
[info]
[debug] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '<token>',
client_id: '<clientid>.apps.googleusercontent.com',
client_secret: '<secret>',
grant_type: 'refresh_token',
scope: 'email https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' }
Sat Oct 28 2017 12:35:25 GMT+0100 (GMT Summer Time)
[debug] <<< HTTP RESPONSE 200
[debug] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
Sat Oct 28 2017 12:35:25 GMT+0100 (GMT Summer Time)
[debug] Error: write EPROTO 101057795:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):openssl\ssl\s23_clnt.c:772:
at _errnoException (util.js:1024:11)
at WriteWrap.afterWrite [as oncomplete] (net.js:870:14)
[error]
[error] Error: Server Error. write EPROTO 101057795:error:140773E8:SSL routines:SSL23_GET_SERVER_HELLO:reason(1000):openssl\ssl\s23_clnt.c:772:
Cause:
Eventually I found that my ISP had updated its so-called Kids Safe security settings and was treating admin.firebase.com as a blocked file sharing site.
Solution:
I updated my settings in the ISPs config, so that access to firebase.com was always allowed. Now firebase init, firebase list etc are working fine.

Resources