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 serve Error: TIMEOUT: Port 5001 on localhost was not active within 5000ms #7091

Closed
RaheutRahwana opened this issue May 2, 2024 · 7 comments · Fixed by #7092
Closed

Comments

@RaheutRahwana
Copy link

RaheutRahwana commented May 2, 2024

[REQUIRED] Environment info

firebase-tools: 13.8.0

Platform: Debian GNU/Linux 12

Node: v20.12.0
NPM: 10.5.0

[REQUIRED] Test case

Execute firebase init with Firestore, Function, Hosting and Storage enabled.

[REQUIRED] Steps to reproduce

  1. Open the command line interface (CLI).
  2. Navigate to the root directory of the Firebase project.
  3. Execute the command firebase serve.

[REQUIRED] Expected behavior

The Firebase development server starts successfully within a reasonable time frame.

[REQUIRED] Actual behavior

[info] i  hosting[foo]: Serving hosting files from: public {"metadata":{"emulator":{"name":"hosting"},"message":"Serving hosting files from: \u001b[1mpublic\u001b[22m"}}
[info] ✔  hosting[foo]: Local server: http://localhost:5000 {"metadata":{"emulator":{"name":"hosting"},"message":"Local server: \u001b[4m\u001b[1mhttp://localhost:5000\u001b[22m\u001b[24m"}}
[error] 
[error] Error: TIMEOUT: Port 5001 on localhost was not active within 5000ms
@jacklj
Copy link

jacklj commented May 2, 2024

We're having the same issue on CI only, when starting the emulators with firebase emulators:exec:

TIMEOUT: Port 9000 on 127.0.0.1 was not active within 5000ms

N.B. setting the host in firebase.json explicitly didn't work, as suggested here: #2379 (comment)

@aalej
Copy link
Contributor

aalej commented May 2, 2024

Hey folks, thanks for reaching out, sorry to hear you encountered this issue. I’m currently working on replicating this but so far I haven’t encountered any errors with starting the emulators.

Could anyone share the emulators section of their firebase.json file so that I can try to reproduce this locally? In addition, to help us narrow what could be causing the issue, could you try downgrading to firebase-tools v13.7.5 to see if you’d be able to run the emulators?

@jacklj
Copy link

jacklj commented May 2, 2024

We've downgraded to 13.7.5 and seems promising so far, just running our test suite again as it could have been a fluke.

From our firebase.json:

 "emulators": {
    "auth": {
      "port": 9099
    },
    "database": {
      "port": 9000
    },
    "storage": {
      "port": 9199
    },
    "ui": {
      "enabled": true
    }
  }

Thanks for your help @aalej :)

@jacklj
Copy link

jacklj commented May 2, 2024

We've downgraded to 13.7.5

Yes that seems to have worked :)

@RaheutRahwana
Copy link
Author

@aalej
Unfortunately, I didn't enable the emulator during firebase init as usual.

@RaheutRahwana
Copy link
Author

Dear @aalej @leemhenson

Upon further investigation, I've encountered a persistent compatibility issue between Firebase Serve and TCP6 in my environment. Specifically, while Firebase Serve listens on TCP6, my environment does not fully support TCP6 connections.

Before utilizing the -o 0.0.0.0 flag, the netstat -l command revealed the following:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp6       0      0 localhost:5001          [::]:*                  LISTEN
tcp6       0      0 localhost:5000          [::]:*                  LISTEN

However, by employing the -o flag and specifying 0.0.0.0, I managed to execute Firebase Serve as a workaround. Nonetheless, it's crucial to acknowledge that this workaround merely masks the issue and does not address the underlying compatibility issue:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:5001            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN

Warm regards.

@stanleyillidge
Copy link

Para mi tambien funciono usar la version npm i -g [email protected] de la CLI, pero tambien tuve que cambiar la variable de sistema JAVA_TOOL_OPTIONS -Xmx10240m

Thanks for your help @aalej :)

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.

4 participants