question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firebase-tools functions emulator can't bind to port 5000 when binding to a host address (-o)

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 7.12.1

Platform: Ubuntu 18.04

[REQUIRED] Test case

Set up an empty functions project with firebase init and try to serve it with firebase serve --only functions -o [YOUR EXTERNAL IP]

[REQUIRED] Steps to reproduce

Set up a very basic environment with firebase init, make sure you enable functions. Try to run the emulator for functions with the -o argument. `firebase serve --only functions -o [YOUR EXTERNAL IP]

[REQUIRED] Expected behavior

The firebase emulator binds to port 5000 and exposes my function on the IP address I specified.

[REQUIRED] Actual behavior

The emulator fails to start, after 30 seconds.

[2020-01-31T20:42:36.896Z] ----------------------------------------------------------------------
[2020-01-31T20:42:36.900Z] Command:       /usr/bin/node /usr/bin/firebase serve --only functions -o 145.131.4.xxx --debug
[2020-01-31T20:42:36.900Z] CLI Version:   7.12.1
[2020-01-31T20:42:36.900Z] Platform:      linux
[2020-01-31T20:42:36.900Z] Node Version:  v10.18.0
[2020-01-31T20:42:36.901Z] Time:          Fri Jan 31 2020 20:42:36 GMT+0000 (Western European Standard Time)
[2020-01-31T20:42:36.901Z] ----------------------------------------------------------------------
[2020-01-31T20:42:36.901Z] 
[2020-01-31T20:42:36.910Z] > 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"]
[2020-01-31T20:42:36.911Z] > authorizing via signed-in user
[2020-01-31T20:42:36.911Z] [iam] checking project expressradio for permissions ["firebase.projects.get"]
[2020-01-31T20:42:36.914Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/expressradio:testIamPermissions  
 permissions=[firebase.projects.get]
[2020-01-31T20:42:37.688Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 31 Jan 2020 20:42:37 GMT, server=ESF, cache-control=private, x-xss-protection=0, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, server-timing=gfet4t7; dur=668, 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, accept-ranges=none, transfer-encoding=chunked
[2020-01-31T20:42:37.690Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects/expressradio  
 
[2020-01-31T20:42:37.905Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 31 Jan 2020 20:42:37 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, accept-ranges=none, transfer-encoding=chunked
⚠  Your requested "node" version "8" doesn't match your global version "10"

Error: TIMEOUT: Port 5000 on 145.131.4.xxx was not active within 30000ms

Extra notes

I tried running the command as root user and with sudo, both didn’t work. I tried using different ports, which didn’t work Using serve on a hosting project works fine for me The port I used (5000) is opened on my device using UFW, other applications will bind onto it just fine. The port was also not being used by any other applications.

I’ve seen other bug reports which look like the exact same issue, but I was told to file a new one.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
google-oss-botcommented, Feb 1, 2020

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

0reactions
jorikvanveencommented, Feb 4, 2020

Thank you very much! This will speed my workflow up a lot

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase serve error: Port 5000 is not open. Could not start ...
I'm trying to serve firebase functions locally ...
Read more >
Install, configure and integrate Local Emulator Suite - Firebase
Each emulator binds to a different port on your machine with a preferred default value. Emulator, Default Port. Authentication, 9099. Emulator Suite UI,...
Read more >
Set up Android Emulator networking
The emulator provides versatile networking capabilities that you can use to set up complex modeling and testing environments for your app.
Read more >
How to Build a Simple Android App with Flask Backend?
app.run() will host the server on localhost, whereas, app.run(host=”0.0.0.0″) will host the server on machine's IP address · By default port 5000 ......
Read more >
Open port 9000 - Sport Castellano Reports
With this online TCP port scanner you can scan an IP address for open ports. ... This tool is extremely useful toThis opens...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found