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 and Dev Container: The web page (localhost:5000) never loaded #9842

Closed
RaheutRahwana opened this issue May 3, 2024 · 5 comments
Assignees
Labels
containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster

Comments

@RaheutRahwana
Copy link

  • VSCode Version: 1.89.0 Linux x64 6.1.0-20-amd64 snap
  • Local OS Version: Debian GNU/Linux 12
  • Remote OS Version: Debian GNU/Linux 11
  • Remote Extension/Connection Type: Containers

Steps to Reproduce:

Create a Firebase web project if you don't have one already.

  1. Open VS Code and create a new folder.
  2. Add a Node.js & JavaScript Dev Container configuration file.
  3. Reopen the folder in the container.
  4. Once everything is set up, run the command npm install -g firebase-tools.
  5. Run the command firebase login and follow in browser.
  6. Run the command firebase init and follow the prompts.
  7. Run the command firebase serve.
  8. Follow the URL provided, and you'll notice that the page does not load as expected.

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

@vscodenpa vscodenpa added the containers Issue in vscode-remote containers label May 3, 2024
@chrmarti
Copy link
Contributor

chrmarti commented May 3, 2024

Is firebase running on port 5000? The log shows ECONNREFUSED 127.0.0.1:5000.

What do you get when running netstat -l in the container?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label May 3, 2024
@RaheutRahwana
Copy link
Author

RaheutRahwana commented May 3, 2024

Is firebase running on port 5000? The log shows ECONNREFUSED 127.0.0.1:5000.

Yes, the Firebase Hosting running on port 5000.

What do you get when running netstat -l in the container?

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 localhost:44353         0.0.0.0:*               LISTEN     
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     385573   /home/node/.gnupg/S.gpg-agent
unix  2      [ ACC ]     STREAM     LISTENING     386790   /tmp/vscode-git-bf89df8c55.sock
unix  2      [ ACC ]     STREAM     LISTENING     387077   /tmp/vscode-ipc-ab9ed8a4-62f6-4732-9981-964b4aa436df.sock
unix  2      [ ACC ]     STREAM     LISTENING     383726   /tmp/vscode-remote-containers-ipc-b2bda113-e9ec-4c44-a0b1-899fecbcec1b.sock
unix  2      [ ACC ]     STREAM     LISTENING     385564   /tmp/vscode-ssh-auth-b2bda113-e9ec-4c44-a0b1-899fecbcec1b.sock
unix  2      [ ACC ]     STREAM     LISTENING     385565   /tmp/.X11-unix/X2
unix  2      [ ACC ]     STREAM     LISTENING     385921   /tmp/vscode-ipc-a269198b-db8a-4c76-ba81-9bb66a11879a.sock

The netstat -l result while the firebase serve is running:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 localhost:44353         0.0.0.0:*               LISTEN     
tcp6       0      0 localhost:5000          [::]:*                  LISTEN     
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     385573   /home/node/.gnupg/S.gpg-agent
unix  2      [ ACC ]     STREAM     LISTENING     386790   /tmp/vscode-git-bf89df8c55.sock
unix  2      [ ACC ]     STREAM     LISTENING     387077   /tmp/vscode-ipc-ab9ed8a4-62f6-4732-9981-964b4aa436df.sock
unix  2      [ ACC ]     STREAM     LISTENING     383726   /tmp/vscode-remote-containers-ipc-b2bda113-e9ec-4c44-a0b1-899fecbcec1b.sock
unix  2      [ ACC ]     STREAM     LISTENING     385564   /tmp/vscode-ssh-auth-b2bda113-e9ec-4c44-a0b1-899fecbcec1b.sock
unix  2      [ ACC ]     STREAM     LISTENING     385565   /tmp/.X11-unix/X2
unix  2      [ ACC ]     STREAM     LISTENING     385921   /tmp/vscode-ipc-a269198b-db8a-4c76-ba81-9bb66a11879a.sock
unix  2      [ ACC ]     STREAM     LISTENING     533838   /tmp/vscode-ipc-00b036b2-dfe7-4923-b112-c4b4999102ce.sock

FYI.

the localhost:44353 page was loaded successfully and say Forbidden.

docker network inspect bridge
[
    {
        "Name": "bridge",
        "Id": "e52e11a8aa0190368961a8e1f4a87a9d7ab0666708b29972bbd74bd70b578acd",
        "Created": "2024-05-03T12:40:38.908444676+07:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "d80ebb6c45853203efd8f60855a98168a0026e1b8d34aa1ccfb43e6317486d45": {
                "Name": "elegant_payne",
                "EndpointID": "4300fc1021482b52f73e5499562af14a1807582c70728c2a29a717d1066fe4fd",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

@4llan
Copy link

4llan commented May 5, 2024

Hello. I've had a similar issue related to yours, and the problem is related to the app listening to the IPv6 loopback inside a dev container: #7029 (comment)

Noticing that the output of your netstat -l says that the app is listening to the IPv6 loopback:

tcp6       0      0 localhost:5000          [::]:*

can you test the firebase serve --host 127.0.0.1 (IPv4 loopback) to see if the forwarding works?

@chrmarti chrmarti assigned alexr00 and unassigned chrmarti May 6, 2024
@RaheutRahwana
Copy link
Author

@4llan,
Thanks for the suggestion! I've tried running the Firebase serve command with the IPv4 loopback address (127.0.0.1 and 0.0.0.0), and I can confirm that the forwarding works as expected. So, it seems like using the IPv4 loopback resolved the issue. Appreciate your help!

@alexr00
Copy link
Member

alexr00 commented May 7, 2024

Closing as a duplicate of #7029

@alexr00 alexr00 closed this as completed May 7, 2024
@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label May 7, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s) info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants