firebase / firebase-tools

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

Unable to deploy behind a proxy #155

Closed ymainier closed 6 years ago

ymainier commented 8 years ago

Hi,

I'm following the firebase web tutorial (https://codelabs.developers.google.com/codelabs/firebase-web/). Everything works fine for the 8 first steps, but in step 9 I have a problem : the command firebase deploy hangs indefinitely. I have this behavior while being behind a proxy (http_proxy and https_proxy are set in the env).

Is there a way to deploy behind a proxy ? This seems related to issue #36

Yann


Here is the output of firebase deploy --debug

----------------------------------------------------------------------
Command:      node /Users/ymainier/.nvm/versions/node/v0.12.1/bin/firebase deploy --debug
CLI Version:  3.0.0
Platform:     darwin
Node Version: v0.12.1
Time:         Wed May 25 2016 16:46:59 GMT+0200 (CEST)
----------------------------------------------------------------------

> command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
>>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/friendlychat-dd6a6 
<<< HTTP RESPONSE 200 server=nginx, date=Wed, 25 May 2016 14:47:57 GMT, content-type=application/json; charset=utf-8, content-length=124, 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/friendlychat-dd6a6/tokens 
<<< HTTP RESPONSE 200 server=nginx, date=Wed, 25 May 2016 14:47:57 GMT, content-type=application/json; charset=utf-8, content-length=433, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
mbleigh commented 8 years ago

This is a known issue. We'd like to figure out a workaround, but it may take some time. I'll leave the issue open to track.

summers173 commented 8 years ago

I have the same problem, the firebase team just write me this:

"Not possible at the moment, tracking here: https://github.com/firebase/firebase-tools/issues/155 but no timeline on a fix."

Actually referring me to this page XP

Hope this will be fix soon, since many of us developers use this tools at work

aprice2704 commented 8 years ago

I have the same problem. Makes it hard to eval firebase in many work environments. :( Also, I have a problem via my satellite inet at home (opening separate issue for that) :(_

rohitsuratekar commented 8 years ago

Same Problem here ! Also this problem is there with all firebase functions on android except authentication.

cskiwi commented 8 years ago

Wel I managed to get it working on my work, but I just can't login,

I also tried doing the `firebase login --no-localhost but that gave just a Error: Authentication Error.

yuxizhe commented 8 years ago

same problem ..

echopi commented 8 years ago

I've came to this problem twice ..

sel commented 7 years ago

The timeout occurs when the Firebase node module makes a connection using faye-websockets, which does not make use of http_proxy and associated environment variables.

There is a comment on StackOverflow that describes how to hard-code the proxy config in faye-websockets as a work-around.

Not elegant, but at least I can deploy now :)

xgqfrms-GitHub commented 7 years ago

Firebase login failed
https://github.com/firebase/firebase-tools/issues/250
https://github.com/firebase/firebase-tools/issues/240
https://github.com/firebase/firebase-tools/issues/249

tolgabalci commented 7 years ago

Same issue here. All the other firebase commands seem to work just fine. "firebase deploy" is the only one getting stuck. At the very least a proper error message would be nice.


T:\ng\firebaseutil>firebase deploy --debug
----------------------------------------------------------------------
Command:      C:\Program Files\nodejs\node.exe C:\Users\myusername\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase deploy --debug
CLI Version:  3.2.1
Platform:     win32
Node Version: v7.3.0
Time:         Wed Jan 25 2017 11:04:37 GMT-0500 (Eastern Standard Time)
----------------------------------------------------------------------

> command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"]
>>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/myprojectname-b5558
<<< HTTP RESPONSE 200 via=IG Proxy, date=Wed, 25 Jan 2017 16:04:38 GMT, server=nginx, connection=Close, content-type=application/json; charset=utf-8, cache-control=no-cache, no-store, content-length=103, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains
>>> HTTP REQUEST GET https://admin.firebase.com/v1/database/myprojectname-b5558/tokens
<<< HTTP RESPONSE 200 via=IG Proxy, date=Wed, 25 Jan 2017 16:04:38 GMT, server=nginx, connection=Close, content-type=application/json; charset=utf-8, cache-control=no-cache, no-store, content-length=423, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains```
<<stuck right here>>
yunfengsa commented 7 years ago

when I "firebase login" ,there is the problem..I solved by "firebase login --no-localhost" for now. But "firebase init"and "firebase deploy" I can't fix it. Always "Authentication Error"

chinsyo commented 7 years ago

same problem..

henriquedesousa commented 7 years ago

One year and still no fix?

Come on, evil googol..

Ernesto-Valdes commented 7 years ago

Same issue here. Here is the command I'm calling and get same error:

firebase database:set /object_name
tingxins commented 7 years ago

Same issue here!!!!

"Error: Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth For CI servers and headless environments, generate a new token with firebase login:ci"

enif-lee commented 7 years ago

is there no way to deploy behind proxy?

it is my log

[debug] ----------------------------------------------------------------------
[debug] Command:      C:\Program Files\nodejs\node.exe C:\Users\SDS\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase deploy
[debug] CLI Version:  3.6.1
[debug] Platform:     win32
[debug] Node Version: v7.8.0
[debug] Time:         Mon Apr 17 2017 13:35:27 GMT+0900 (대한민국 표준시)
[debug] ----------------------------------------------------------------------
[debug] 
[debug] > 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] > 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] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '1/cLqub4wdfbPJfm6Rswlzb8L2uA7zXG1SrmTLx17kZ1w',
  client_id: '563584335869-fgrhgmd47bqne........................apps.googleusercontent.com',
  client_secret: 'j9iVZfS8kkCEFU.........',
  grant_type: 'refresh_token',
  scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' } 
 Mon Apr 17 2017 13:35:27 GMT+0900 (대한민국 표준시)
[debug] <<< HTTP RESPONSE 200
[debug] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/sample-b36e9  
 Mon Apr 17 2017 13:35:29 GMT+0900 (대한민국 표준시)
[debug] <<< HTTP RESPONSE 200
[debug] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/sample-b36e9/tokens  
 Mon Apr 17 2017 13:35:30 GMT+0900 (대한민국 표준시)
[debug] <<< HTTP RESPONSE 200

@tingxins hi, did you tried after below command?

set "NODE_TLS_REJECT_UNAUTHORIZED=0"
ChampIsMe commented 7 years ago

Firebase devs please solve this issue, it a serious dev delay up to date.

zakali22 commented 7 years ago

Why is it not solved until now?

oneingfw commented 7 years ago

one year

Symbolk commented 7 years ago

It still happens and keeps bothering me... Maybe I will give up firebase because I am in China...

jmrosdev commented 7 years ago

Same problem...

elpagano commented 7 years ago

Same problem

hardikpthv commented 7 years ago

Same problem...

peterennis commented 7 years ago

Same problem. Working with support for 3 months and no help. Finally got the idea to uninstall CovenantEyes, which must have a proxy, so login did not work. I guess there must be a number of apps that cause this issue.

Finally got the Woohoo!

capture120

Symbolk commented 7 years ago

I figured out one possible solution that works for those Shadowsocks proxy users(Windows 10 Pro).

1, run "firebase logout" under Shadowsocks PAC Mode;

2, run "firebase login" under Shadowsocks PAC Mode;

3, switch to Shadowsocks Global Mode(which redirects all your request to the remote serve);

4, try “firebase list” to see if the Authentication Error appears or not.

This works for me, but I am not sure whether it helps or not for you. Worth a try.

WbTOne commented 7 years ago

##############

SOLUTION

#############

  1. run 'firebase login --interactive' so log in @gmail account.

This Works!!!

peterennis commented 7 years ago

@WbTOne Tried that already. It did not work in my case.

GoldLinPan commented 7 years ago

it still doesn't work

jcarlos79t commented 7 years ago

Hasta cuando la solución señores de Firebase

GoldLinPan commented 7 years ago

Hey,upstairs brother,can you speak English ?

giorgiobeggiora commented 7 years ago

waiting for official solution... this issue has CRITICAL PRIORITY

Symbolk commented 7 years ago

I can only count on Good luck when debugging, tired of retrying login again and again, it has seriously delayed my project, I have to build my own server now.

kdepp commented 7 years ago

For me, it works again when I quit Chrome entirely and reopen it again

euroclydon37 commented 7 years ago

I seriously can't believe this isn't fixed in almost a year and a half.

OneLiteCore commented 7 years ago

It is always like this if you are an android developer who is living in China.

I just hope that Google Play will come back one day.

Hr-Mohammadian commented 6 years ago

wanted to say that i have the problem too and this is firebase-debug

[debug] [2017-10-09T17:46:10.778Z] ---------------------------------------------------------------------- [debug] [2017-10-09T17:46:10.780Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Hamidreza\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase list [debug] [2017-10-09T17:46:10.781Z] CLI Version: 3.13.1 [debug] [2017-10-09T17:46:10.781Z] Platform: win32 [debug] [2017-10-09T17:46:10.781Z] Node Version: v6.11.4 [debug] [2017-10-09T17:46:10.781Z] Time: Mon Oct 09 2017 21:16:10 GMT+0330 (Iran Standard Time) [debug] [2017-10-09T17:46:10.781Z] ---------------------------------------------------------------------- [debug] [debug] [2017-10-09T17:46:10.794Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"] [debug] [2017-10-09T17:46:10.795Z] > authorizing via signed-in user [debug] [2017-10-09T17:46:10.797Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"] [debug] [2017-10-09T17:46:10.797Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '1/OU1dLTZhJUpNdtDzicGy1xtthchW9wu84awgkUkEmGU', client_id: '563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com', client_secret: 'j9iVZfS8kkCEFUPaAeJV0sAi', grant_type: 'refresh_token', scope: 'email https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' } Mon Oct 09 2017 21:16:10 GMT+0330 (Iran Standard Time) [debug] [2017-10-09T17:46:11.815Z] <<< HTTP RESPONSE 200 [debug] [2017-10-09T17:46:11.829Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
Mon Oct 09 2017 21:16:11 GMT+0330 (Iran Standard Time) [debug] [2017-10-09T17:46:33.060Z] Error: connect ETIMEDOUT 104.197.85.31:443 at Object.exports._errnoException (util.js:1020:11) at exports._exceptionWithHostPort (util.js:1043:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14) [error] [error] Error: Server Error. connect ETIMEDOUT 104.197.85.31:443 [debug] [2017-10-09T17:46:47.934Z] ---------------------------------------------------------------------- [debug] [2017-10-09T17:46:47.937Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Hamidreza\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase list [debug] [2017-10-09T17:46:47.937Z] CLI Version: 3.13.1 [debug] [2017-10-09T17:46:47.937Z] Platform: win32 [debug] [2017-10-09T17:46:47.937Z] Node Version: v6.11.4 [debug] [2017-10-09T17:46:47.938Z] Time: Mon Oct 09 2017 21:16:47 GMT+0330 (Iran Standard Time) [debug] [2017-10-09T17:46:47.938Z] ---------------------------------------------------------------------- [debug] [debug] [2017-10-09T17:46:47.951Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase"] [debug] [2017-10-09T17:46:47.951Z] > authorizing via signed-in user [debug] [2017-10-09T17:46:47.955Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects
Mon Oct 09 2017 21:16:47 GMT+0330 (Iran Standard Time) [debug] [2017-10-09T17:47:09.030Z] Error: connect ETIMEDOUT 104.197.85.31:443 at Object.exports._errnoException (util.js:1020:11) at exports._exceptionWithHostPort (util.js:1043:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14) [error] [error] Error: Server Error. connect ETIMEDOUT 104.197.85.31:443

SVyatoslavG commented 6 years ago

I have a same issue, please resolve it!

BilalBo commented 6 years ago

Same problem, solve it please, can't connect to firebase when using proxy :(

klem231188 commented 6 years ago

Same issue here. I am forced to deploy at home... :D

mcxinyu commented 6 years ago

I have a same issue, please resolve it!

mcxinyu commented 6 years ago

Use the proxy on the router.(Shadowsocks) My computer is connected to this router.

image

mcxinyu commented 6 years ago

Android Studio login Google account is also available.

image

TinkZhang commented 6 years ago

This P2 bug lives for one and half years.

n1rw4n commented 6 years ago

i have same problem here :(

hmajumdar commented 6 years ago

just encountered the same problem here

Vadworks commented 6 years ago

This worked for me!

set "NODE_TLS_REJECT_UNAUTHORIZED=0"

WeslleyNasRocha commented 6 years ago

Cannot deploy too

[debug] [2017-10-31T15:00:41.884Z] ----------------------------------------------------------------------
[debug] [2017-10-31T15:00:41.884Z] Command:       C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\firebase-tools\bin\firebase deploy
[debug] [2017-10-31T15:00:41.884Z] CLI Version:   3.14.0
[debug] [2017-10-31T15:00:41.884Z] Platform:      win32
[debug] [2017-10-31T15:00:41.884Z] Node Version:  v6.11.4
[debug] [2017-10-31T15:00:41.884Z] Time:          Tue Oct 31 2017 13:00:41 GMT-0200 (Horário brasileiro de verão)
[debug] [2017-10-31T15:00:41.884Z] ----------------------------------------------------------------------
[debug] 
[debug] [2017-10-31T15:00:41.904Z] > 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] [2017-10-31T15:00:41.904Z] > authorizing via signed-in user
[debug] [2017-10-31T15:00:41.904Z] > 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] [2017-10-31T15:00:41.904Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token { refresh_token: '1/*************************************************************************************',
  client_id: '*************************************************************.com',
  client_secret: '*******************************',
  grant_type: 'refresh_token',
  scope: 'email https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/firebase openid' } 
 Tue Oct 31 2017 13:00:41 GMT-0200 (Horário brasileiro de verão)
[debug] [2017-10-31T15:00:42.285Z] <<< HTTP RESPONSE 200
[debug] [2017-10-31T15:00:42.315Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/where2party-51f6a  
 Tue Oct 31 2017 13:00:42 GMT-0200 (Horário brasileiro de verão)
[debug] [2017-10-31T15:00:43.194Z] <<< HTTP RESPONSE 200
[debug] [2017-10-31T15:00:43.194Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/where2party-51f6a/tokens  
 Tue Oct 31 2017 13:00:43 GMT-0200 (Horário brasileiro de verão)
[debug] [2017-10-31T15:00:44.238Z] <<< HTTP RESPONSE 200
WeslleyNasRocha commented 6 years ago

Confirming that this works

namiwang commented 6 years ago

confirmed working solution:

  1. set env var http_proxy since is still needed (and being respected) by request
  2. hack faye-websocket/lib/faye/websocket/client.js:
...
var Client = function(_url, protocols, options) {
  options = options || {};

  options.proxy = {
    origin:  'http://localhost:1087',
  }
...
  1. set NODE_TLS_REJECT_UNAUTHORIZED=0
  2. dont trust issue labels such as p2
klem231188 commented 6 years ago

@namiwang doesn't work for me :(

The main difference is that I use user/password :

var Client = function(_url, protocols, options) {
  options = options || {};

  options.proxy = {
    origin:  'http://user:password@proxy.hostname:port',
  }

And when you say set NODE_TLS_REJECT_UNAUTHORIZED=0, the command on linux is export NODE_TLS_REJECT_UNAUTHORIZED=0, right ?