firebase / firebase/firebase-tools

Realtime Database viewer making requests to 0.0.0.0 and not displaying contents of Realtime Database.

Open
#6,790 3 comments 0 reactions 0 assignees View on GitHub
emulators: database type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools: 13.3.0

**Platform: ** Linux Docker Container

### [REQUIRED] Test case

Create a docker container with the following Dockerfile

```
FROM node:18-alpine

RUN apk add openjdk11

# Install firebase tools.
RUN npm install -g firebase-tools@13.3.0

RUN firebase setup:emulators:ui

WORKDIR /firebase
CMD firebase --project someProjectId emulators:start --import=/firebase/fixtures --export-on-exit
```
Use the following firebase.json file

```
{
"emulators": {
"singleProjectMode": false,
"firestore": {
"port": 5000,
"host": "0.0.0.0",
"indexes": "firestore-indexes.json"
},
"auth": {
"port": "5001",
"host": "0.0.0.0"
},
"database": {
"port": "5002",
"host": "0.0.0.0"
},
"hub": {
"host": "0.0.0.0"
},
"logging": {
"host": "0.0.0.0"
},
"ui": {
"enabled": true,
"host": "0.0.0.0",
"port": 4000
}
}
}
```
Run container using the following command
```
docker run --rm -v /home/dev/firebase:[Location to above firebase config] -d -it --name firebase -p 9150:9150 -p 5000-5002:5000-5002 -p 4000:4000 -p 4500:4500 firebase:v11
```

### [REQUIRED] Steps to reproduce

Access the above docker container firebase emulator UIfrom another machine through a local network

### [REQUIRED] Expected behavior

The Realtime DB viewer should show the content of the Database

### [REQUIRED] Actual behavior

The browser makes requests to 0.0.0.0 due to some config error in the firebase tooling and the realtime database page does not display the contents

Below is the umatrix extension showing the requests to 0.0.0.0
Screenshot 2024-02-19 at 18 41 29

Below is the network requests from the browser dev tools window.
Screenshot 2024-02-19 at 18 42 09

Below is the realtime database page showing tables but no content
Screenshot 2024-02-19 at 18 45 30

Contributor guide

Open the contributing guide

Research direction

Start with the Dockerfile and firebase.json configuration, then reproduce the emulator UI access from another machine using the published ports. Trace which configured host the Realtime Database viewer uses for its browser requests; done means the viewer contacts a reachable address instead of 0.0.0.0 and displays the database contents.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
databases, devtools, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.