镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

firebase emulator ui does not respect "emulator.ui.host" field in firebase.json #6222

Closed

Description

@dt665m

[REQUIRED] Environment info

firebase-tools: 12.4.7, 12.4.6, 11.30.0

Platform: macOS (in docker linux/amd64)

[REQUIRED] Test case

FROM node:lts-slim

RUN apt-get update && apt-get install -y autoconf automake bash g++ libtool make openjdk-17-jre-headless python3 && \
    java -version

RUN npm install -g firebase-tools@12.4.7 typescript && \
    npm cache clean --force && \
    firebase setup:emulators:database && \
    firebase setup:emulators:firestore && \
    firebase setup:emulators:pubsub && \
    firebase setup:emulators:storage && \
    firebase setup:emulators:ui

VOLUME /root/.cache
WORKDIR /root/app

EXPOSE 4000 4400 5000 5001 8080 8085 9000 9005 9009 9199
CMD ["sh"]
{
  "emulators": {
    "singleProjectMode": false,
    "auth": {
      "host": "0.0.0.0",
      "port": 9098
    },
    "functions": {
      "host": "0.0.0.0",
      "port": 5001
    },
    "firestore": {
      "host": "0.0.0.0",
      "port": 8080
    },
    "pubsub": {
      "host": "0.0.0.0",
      "port": 8085
    },
    "storage": {
      "host": "0.0.0.0",
      "port": 9199
    },
    "eventarc": {
      "host": "0.0.0.0",
      "port": 9299
    },
    "ui": {
      "host": "0.0.0.0"
    },
    "hub": {
      "host": "0.0.0.0"
    },
    "logging": {
      "host": "0.0.0.0"
    }
  }
}

[REQUIRED] Steps to reproduce

docker build -t fbtest:latest -f Dockerfile
docker run --rm -ti -v $PWD:/root/app /bin/bash

# in container
firebase emulators:start --only auth,firestore --project test

[REQUIRED] Expected behavior

Emulator UI should start on 0.0.0.0 based on the settings in firebase.json

[REQUIRED] Actual behavior

Emulator UI starts on 127.0.0.1. Auth and Firestore both respect the Host option.

Activity

  1. dt665m commented on Aug 7, 2023

    @dt665m
    Author

    After further testing, this is actually working properly. It's just the console output that is not correct
    Screenshot 2023-08-07 at 1 35 11 PM

  2. aalej commented on Aug 7, 2023

    @aalej
    Contributor

    Thanks for the detailed report, @dt665m. I was able to reproduce the behavior you mentioned. Just to make sure we’re on the same page, is your expected behavior for the console to output something similar to:

    ┌─────────────────────────────────────────────────────────────┐
    │ ✔ All emulators ready! It is now safe to connect your app.  │
    │ i View Emulator UI at http://0.0.0.0:4000/                  │
    └─────────────────────────────────────────────────────────────┘
    
    ┌────────────────┬──────────────┬─────────────────────────────────┐
    │ Emulator       │ Host:Port    │ View in Emulator UI             │
    ├────────────────┼──────────────┼─────────────────────────────────┤
    │ Authentication │ 0.0.0.0:9098 │ http://0.0.0.0:4000/auth        │
    ├────────────────┼──────────────┼─────────────────────────────────┤
    │ Firestore      │ 0.0.0.0:8080 │ http://0.0.0.0:4000/firestore   │
    └────────────────┴──────────────┴─────────────────────────────────┘
    Emulator Hub running at 127.0.0.1:4400
    Other reserved ports: 4500, 9150
    
    
  3. dt665m commented on Aug 8, 2023

    @dt665m
    Author

    Thanks for the detailed report, @dt665m. I was able to reproduce the behavior you mentioned. Just to make sure we’re on the same page, is your expected behavior for the console to output something similar to:

    ┌─────────────────────────────────────────────────────────────┐
    │ ✔ All emulators ready! It is now safe to connect your app.  │
    │ i View Emulator UI at http://0.0.0.0:4000/                  │
    └─────────────────────────────────────────────────────────────┘
    
    ┌────────────────┬──────────────┬─────────────────────────────────┐
    │ Emulator       │ Host:Port    │ View in Emulator UI             │
    ├────────────────┼──────────────┼─────────────────────────────────┤
    │ Authentication │ 0.0.0.0:9098 │ http://0.0.0.0:4000/auth        │
    ├────────────────┼──────────────┼─────────────────────────────────┤
    │ Firestore      │ 0.0.0.0:8080 │ http://0.0.0.0:4000/firestore   │
    └────────────────┴──────────────┴─────────────────────────────────┘
    Emulator Hub running at 127.0.0.1:4400
    Other reserved ports: 4500, 9150
    

    @aalej yes, that indicator for the Emulator UI host in the console (along with the one for Emulator Hub) could clear some confusion. Thanks for taking a look at this!

  4. christhompsongoogle commented on Aug 8, 2023

    @christhompsongoogle
    Contributor

    Thanks dt665m, I agree this is unintended behavior. We'll get to this when we can, but in the meantime if anyone would like to take a crack at adjusting the output let me know and I can provide some direction.

  5. gauranshahuja commented on Oct 11, 2026

    @gauranshahuja
    Contributor

    @christhompsongoogle I'd like to take you up on this one if it's still open.

    From reading printEmulatorOverview in emulators-start.ts on main: the table's Host:Port column shows each emulator's listen address through commandUtils.getListenOverview, but the "View Emulator UI at" line is built with EmulatorRegistry.url(Emulators.UI), which goes through getInfo() and connectableHostname(). So with "ui": { "host": "0.0.0.0" } the UI listens on 0.0.0.0 while the banner shows 127.0.0.1, which is what @dt665m saw. The "Emulator Hub host:" line uses getInfo() too, so it has the same mismatch.

    A link to http://0.0.0.0:4000 can't be opened everywhere (it fails on Windows), so I'd keep the link connectable and show the listen address next to it:

    i  View Emulator UI at http://127.0.0.1:4000/ (listening on 0.0.0.0:4000)
    

    and print the Hub's listen address the same way. The per-emulator "View in Emulator UI" links would stay as they are, since they need to be clickable. Does that match what you had in mind, or would you prefer a different output?

  6. christhompsongoogle commented on Oct 29, 2026

    @christhompsongoogle
    Contributor

    Yes this approach looks great

  7. gauranshahuja commented on Nov 1, 2026

    @gauranshahuja
    Contributor

    @christhompsongoogle thanks! The PR is up at #11407, with the startup output from a real run in the description.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions