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

Error on deploying through Firebase CLI: Error: Server Error. connect ETIMEDOUT

Open iamaravinds opened this issue 6 years ago • 13 comments

[REQUIRED] Environment info

Firebase version 8.6.0

firebase-tools:

Platform: : Ubuntu

[REQUIRED] Test case

Firebase CLI Issue

I am Trying to deploy the Cloud functions to my Project. I get this Error: Server Error. connect ETIMEDOUT most of the time. Checked with the network from my side, seems stable.

[REQUIRED] Steps to reproduce

  1. Open Terminal
  2. Type firebase deploy

[REQUIRED] Expected behavior

Deploy all the Cloud functions

[REQUIRED] Actual behavior

Error: Server Error. connect ETIMEDOUT <IP>

[debug] [2020-08-10T15:52:04.036Z] ----------------------------------------------------------------------
[debug] [2020-08-10T15:52:04.037Z] Command:       /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js /home/aravind/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase deploy --only functions
[debug] [2020-08-10T15:52:04.037Z] CLI Version:   8.7.0
[debug] [2020-08-10T15:52:04.037Z] Platform:      linux
[debug] [2020-08-10T15:52:04.037Z] Node Version:  v12.18.1
[debug] [2020-08-10T15:52:04.037Z] Time:          Mon Aug 10 2020 21:22:04 GMT+0530 (India Standard Time)
[debug] [2020-08-10T15:52:04.038Z] ----------------------------------------------------------------------
[debug] [2020-08-10T15:52:04.038Z] 
[debug] [2020-08-10T15:52:04.042Z] > 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-08-10T15:52:04.042Z] > authorizing via signed-in user
[debug] [2020-08-10T15:52:04.043Z] [iam] checking project linarc-collaboration-dev for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[debug] [2020-08-10T15:52:04.044Z] > 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-08-10T15:52:04.044Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[debug] [2020-08-10T15:52:12.764Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 10 Aug 2020 15:52:12 GMT","server":"scaffolding on HTTPServer2","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":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"}
[debug] [2020-08-10T15:52:12.776Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/linarc-collaboration-dev:testIamPermissions  
 {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}
[debug] [2020-08-10T15:52:14.016Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Mon, 10 Aug 2020 15:52:13 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=1139","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T050=\":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"}
[debug] [2020-08-10T15:52:14.020Z] >>> HTTP REQUEST POST https://iam.googleapis.com/v1/projects/linarc-collaboration-dev/serviceAccounts/[email protected]:testIamPermissions  
 {"permissions":["iam.serviceAccounts.actAs"]}

iamaravinds avatar Aug 10 '20 16:08 iamaravinds

This Happens across all the projects i own

iamaravinds avatar Aug 10 '20 16:08 iamaravinds

Iam also facing the same issue.

[debug] [2020-08-11T07:20:29.684Z] ----------------------------------------------------------------------
[debug] [2020-08-11T07:20:29.685Z] Command:       /home/raghu/.nvm/versions/node/v10.20.1/bin/node /usr/bin/firebase use linarc-development
[debug] [2020-08-11T07:20:29.686Z] CLI Version:   6.5.2
[debug] [2020-08-11T07:20:29.686Z] Platform:      linux
[debug] [2020-08-11T07:20:29.686Z] Node Version:  v10.20.1
[debug] [2020-08-11T07:20:29.686Z] Time:          Tue Aug 11 2020 12:50:29 GMT+0530 (India Standard Time)
[debug] [2020-08-11T07:20:29.686Z] ----------------------------------------------------------------------
[debug] 
[debug] [2020-08-11T07:20:29.690Z] > 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-08-11T07:20:29.690Z] > authorizing via signed-in user
[debug] [2020-08-11T07:20:29.692Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects  
 
[debug] [2020-08-11T07:22:40.602Z] Error: connect ETIMEDOUT 104.197.85.31:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1107:14)
[error] 
[error] Error: Server Error. connect ETIMEDOUT 104.197.85.31:443

This problem shows up whenever I try to run any of the firebase-cli commands.

yaswankar avatar Aug 11 '20 07:08 yaswankar

@iamaravinds as you can see here, others have experienced ETIMEDOUT issues as well: https://github.com/firebase/firebase-tools/issues?q=is%3Aissue+ETIMEDOUT

In your case I think you can solve it by updating to the latest version of the Firebase CLI. You're running version 6.5.2 which tries to make this request:

HTTP REQUEST GET https://admin.firebase.com/v1/projects

However firebase.com no longer exists. Try updating:

npm install -g firebase-tools@latest

samtstern avatar Aug 11 '20 11:08 samtstern

Hi, I have updated the firebase tools and run it in the latest version. I am still running the same problem. Please have a look at the below logs

[debug] [2020-09-01T09:06:04.941Z] ----------------------------------------------------------------------
[debug] [2020-09-01T09:06:04.943Z] Command:       /usr/local/bin/firebase /home/aravind/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/bin/firebase deploy --only functions:safetylogs
[debug] [2020-09-01T09:06:04.943Z] CLI Version:   8.9.0
[debug] [2020-09-01T09:06:04.943Z] Platform:      linux
[debug] [2020-09-01T09:06:04.943Z] Node Version:  v12.18.1
[debug] [2020-09-01T09:06:04.943Z] Time:          Tue Sep 01 2020 14:36:04 GMT+0530 (India Standard Time)
[debug] [2020-09-01T09:06:04.943Z] ----------------------------------------------------------------------
[debug] [2020-09-01T09:06:04.943Z] 
[debug] [2020-09-01T09:06:04.948Z] > 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-09-01T09:06:04.948Z] > authorizing via signed-in user
[debug] [2020-09-01T09:06:04.948Z] [iam] checking project linarc-development for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]
[debug] [2020-09-01T09:06:04.950Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/linarc-development:testIamPermissions  
 {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get"]}
[debug] [2020-09-01T09:06:06.226Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Tue, 01 Sep 2020 09:06:06 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","server-timing":"gfet4t7; dur=1136","alt-svc":"h3-29=\":443\"; ma=2592000,h3-27=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-T050=\":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"}
[debug] [2020-09-01T09:06:06.229Z] >>> HTTP REQUEST POST https://iam.googleapis.com/v1/projects/linarc-development/serviceAccounts/[email protected]:testIamPermissions  
 {"permissions":["iam.serviceAccounts.actAs"]}
[debug] [2020-09-01T09:06:07.795Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=UTF-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Tue, 01 Sep 2020 09:06:08 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-27=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-T050=\":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"}
[info] 
[info] === Deploying to 'linarc-development'...
[info] 
[info] i  deploying functions 
[debug] [2020-09-01T09:06:09.980Z] > [functions] package.json contents: {
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "serve": "firebase serve --only functions",
    "shell": "firebase experimental:functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log",
    "build": "firebase functions:config:set config=\"$(cat config/index.json)\"",
    "build:local": "firebase functions:config:set config=\"$(cat config/index.local.json)\""
  },
  "dependencies": {
    "@firebase/app": "^0.6.4",
    "@google-cloud/tasks": "^2.0.0",
    "@sendgrid/mail": "^7.1.1",
    "axios": "^0.19.0",
    "bcrypt": "^4.0.1",
    "child-process-promise": "^2.2.0",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "firebase-admin": "^8.12.1",
    "firebase-functions": "^3.11.0",
    "firebase-tools": "^8.1.0",
    "generate-password": "^1.4.0",
    "json2csv": "^5.0.1",
    "lodash.clonedeep": "^4.5.0",
    "lodash.isequal": "^4.5.0",
    "lodash.isobject": "^3.0.2",
    "lodash.transform": "^4.6.0",
    "mkdirp": "^1.0.4",
    "mkdirp-promise": "^5.0.1",
    "pdfmake": "^0.1.38",
    "twilio": "^3.14.0",
    "yarn": "^1.22.4"
  },
  "engines": {
    "node": "10"
  },
  "private": true
}
[info] i  functions: ensuring required API cloudfunctions.googleapis.com is enabled... 
[info] i  functions: ensuring required API cloudbuild.googleapis.com is enabled... 
[debug] [2020-09-01T09:06:11.667Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/linarc-development/services/cloudfunctions.googleapis.com  
 
[debug] [2020-09-01T09:06:11.667Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/linarc-development/services/runtimeconfig.googleapis.com  
 
[debug] [2020-09-01T09:06:11.668Z] >>> HTTP REQUEST GET https://serviceusage.googleapis.com/v1/projects/linarc-development/services/cloudbuild.googleapis.com  
 
[debug] [2020-09-01T09:06:44.149Z] Error: connect ETIMEDOUT 216.58.200.138:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
[error] 
[error] Error: Server Error. connect ETIMEDOUT 216.58.200.138:443

iamaravinds avatar Sep 01 '20 09:09 iamaravinds

@iamaravinds looks like it's the same error code (ETIMEDOUT) but a new error. This has happened to me before when on a very slow or flaky internet connection. Unfortunately the only advice I can give is to retry :-/

samtstern avatar Sep 01 '20 10:09 samtstern

Updating firebase tools worked. Can confirm.

abhishek-sankar avatar Oct 13 '20 05:10 abhishek-sankar

same problem here.. npm install -g firebase-tools@latest doesn´t solve the problem

this is my console output: image

adrielwerlich avatar Oct 13 '20 17:10 adrielwerlich

same problem here.. npm install -g firebase-tools@latest doesn´t solve the problem

this is my console output: image

Same here image

mddarmawan avatar Jan 14 '21 03:01 mddarmawan

me too, i had these :

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. ⚠ functions: Upload Error: Server Error. connect ETIMEDOUT 74.125.24.95:443

Error: Server Error. connect ETIMEDOUT 74.125.24.95:443

CaturViriyananda avatar Jan 14 '21 08:01 CaturViriyananda

My workaround is letting the error message just like that because I see the functions is successfully deployed. And if you also have to use the Firebase Hosting, just deploy it separately:

firebase deploy --only hosting

and

firebase deploy --only functions

Hope this "bug" fixed in the future. Thanks.

mddarmawan avatar Jan 14 '21 23:01 mddarmawan

I did npm uninstall firebase-tools and then npm i firebase-tools -g and then the deploy only failed for one function but the function I needed to deploy succeeded.

What you could also try is to deploy single functions by doing firebase deploy --only "functions:functionName"

pumuckelo avatar Jan 27 '21 22:01 pumuckelo

I did npm uninstall firebase-tools and then npm i firebase-tools -g and then the deploy only failed for one function but the function I needed to deploy succeeded.

What you could also try is to deploy single functions by doing firebase deploy --only "functions:functionName"

not working...

baneeishaque avatar Aug 03 '21 09:08 baneeishaque

Solved, https://github.com/firebase/firebase-tools/issues/386#issuecomment-511347129

baneeishaque avatar Aug 03 '21 09:08 baneeishaque