Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI login fails with an Error to make a request message #4591

Closed
ArcherN9 opened this issue May 27, 2022 · 7 comments
Closed

CLI login fails with an Error to make a request message #4591

ArcherN9 opened this issue May 27, 2022 · 7 comments

Comments

@ArcherN9
Copy link

[REQUIRED] Environment info

firebase-tools: 11.0.1

Platform: macOS {11.6.1 (20G224)}

[REQUIRED] Test case

  • Download firebase-tools or firebase-cli and authenticate from the terminal (Alacritty, default MacOS terminal, ZSH shell)

[REQUIRED] Steps to reproduce

  • Download Firebase-tools or Firebase-cli package from either npm or brew.sh respectively;
  • Execute firebase login, firebase login --reauth, firebase login --no-localhost and basically all versions of authentication available. Including ones with login:ci

[REQUIRED] Expected behavior

  • CLI tool authenticates

[REQUIRED] Actual behavior

The following is the output of firebase login --debug

~ ❯ firebase login --debug
i  Firebase optionally collects CLI usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.

? Allow Firebase to collect CLI usage and error reporting information? (Y/n) [2022-05-27T11:25:42.298Z] FetchError: request to https://firebase-public.firebaseio.com/cli.json failed, reason: unable to get local issuer certificate
    at ClientRequest.<anonymous> (/usr/local/Cellar/firebase-cli/11.0.1/libexec/lib/node_modules/firebase-tools/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:390:28)
    at ClientRequest.emit (node:domain:475:12)
    at TLSSocket.socketErrorListener (node:_http_client:442:9)
    at TLSSocket.emit (node:events:390:28)
    at TLSSocket.emit (node:domain:475:12)
    at emitErrorNT (node:internal/streams/destroy:164:8)
    at emitErrorCloseNT (node:internal/streams/destroy:129:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Error: Failed to make request to https://firebase-public.firebaseio.com/cli.json
~ ❯
@ArcherN9 ArcherN9 added the bug label May 27, 2022
@ArcherN9
Copy link
Author

A temporary fix export NODE_TLS_REJECT_UNAUTHORIZED=0 worked for me.

@bkendall
Copy link
Contributor

  1. I'm unable to support/test the firebase-cli brew package version since it being wrapped in whatever brew does isn't something we control - sorry.
  2. What version of node are you using?
  3. It's very likely that this has something to do with your local setup. From the same machine, do you have any issues curl-ing or opening https://firebase-public.firebaseio.com/cli.json in a browser?

@bkendall bkendall added the Needs: Author Feedback Issues awaiting author feedback label May 31, 2022
@10ndavis
Copy link

10ndavis commented Jun 8, 2022

A temporary fix export NODE_TLS_REJECT_UNAUTHORIZED=0 worked for me.

Worked for me. Thanks @ArcherN9

@ArcherN9
Copy link
Author

ArcherN9 commented Jun 9, 2022

It's very likely that this has something to do with your local setup.

@bkendall Yes, it does appear so. My work laptop has all sorts of proxies/DNS restrictions in place. I recently formatted my system and did not install the proxies - It works as expected now.

What version of node are you using?

v18.2.0

do you have any issues curl-ing or opening https://firebase-public.firebaseio.com/cli.json in a browser?

Nope. That was the weird part - I was able to curl it, wget and open it on a browser. Just not when firebase cli executes it.

I concede there are things beyond what I understand about the whole Firebase CLI/brew system. But perhaps we could add this to the documentation somewhere?

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels Jun 9, 2022
@bkendall
Copy link
Contributor

bkendall commented Jun 9, 2022

Glad it's cleared up!

@bkendall bkendall closed this as completed Jun 9, 2022
@ctrongminh
Copy link

A temporary fix export NODE_TLS_REJECT_UNAUTHORIZED=0 worked for me.

Thank you @ArcherN9 , I have another error related to the self signed certificate and this workaround helped me to run firebase login:ci successfully

firebase login:ci --debug
......
[2023-11-06T03:12:16.990Z] *** [apiv2] error from fetch(https://accounts.google.com/o/oauth2/token, {"headers":{},"method":"POST","body":{"_overheadLength":655,"_valueLength":214,"_valuesToMeasure":[],"writable":false,"readable":true,"dataSize":0,"maxDataSize":2097152,"pauseStreams":true,"_released":true,"_streams":[],"_currentStream":null,"_insideLoop":false,"_pendingNext":false,"_boundary":"--------------------------39405827254123229384288","_events":{},"_eventsCount":1}}): FetchError: request to https://accounts.google.com/o/oauth2/token failed, reason: self signed certificate in certificate chain
......

@abdullahalamodi
Copy link

  1. I'm unable to support/test the firebase-cli brew package version since it being wrapped in whatever brew does isn't something we control - sorry.
  2. What version of node are you using?
  3. It's very likely that this has something to do with your local setup. From the same machine, do you have any issues curl-ing or opening https://firebase-public.firebaseio.com/cli.json in a browser?

I have the same issue and when I open .json with curl this was the response
{"cloudBuildErrorAfter":1594252800000,"cloudBuildWarnAfter":1590019200000,"defaultNode10After":1594252800000,"minVersion":"3.0.5","node8DeploysDisabledAfter":1613390400000,"node8RuntimeDisabledAfter":1615809600000,"node8WarnAfter":1600128000000}

also this not worked for me
export NODE_TLS_REJECT_UNAUTHORIZED=0

firebase version is 13.3.0
on mac os version 14.1

I don't know what should I do if it something related to my network or my device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants