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

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

Closed
jorikvanveen opened this issue Feb 1, 2020 · 6 comments · Fixed by #1954

Comments

@jorikvanveen
Copy link

jorikvanveen commented Feb 1, 2020

[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
�[1m�[33m⚠ �[39m�[22m Your requested "node" version "8" doesn't match your global version "10"

�[1m�[31mError:�[39m�[22m 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.

@google-oss-bot
Copy link
Contributor

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.

@jorikvanveen
Copy link
Author

Done, thank you.

@samtstern
Copy link
Contributor

@jorikvanveen thanks for filing this, the fact that its only a Functions problem narrows it down a lot. So just to be clear, you can do firebase serve --only hosting -o {external_ip} just fine?

@jorikvanveen
Copy link
Author

@samtstern Thank you for replying, firebase serve --only hosting -o {external_ip} works fine.

@samtstern
Copy link
Contributor

Turns out this issue was pretty simple and it will be fixed by PR #1954, thanks for the help!

@jorikvanveen
Copy link
Author

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

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

Successfully merging a pull request may close this issue.

3 participants