firebase / firebase/firebase-tools

Specifying custom `host` for Data Connect emulator causes crash

Open
#8,376 11 comments 0 reactions 1 assignee Claimed by @joehan View on GitHub
emulator: dataconnect 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:** 14.0.0

**Platform:** macOS

### [REQUIRED] Test case

N/A

### [REQUIRED] Steps to reproduce

1. Create a firebase project with Data Connect using:

```bash
firebase init dataconnect
```

2. Update the `firebase.json` file to configure port and host:

```json
{
"emulators": {
"dataconnect": {
"dataDir": "dataconnect/.dataconnect/pgliteData",
"port": 9399,
"host": "192.168.1.2" // <- change this to your local IP
}
}
}
```

3. Start the emulator with:

```bash
firebase emulators:start --only dataconnect
```

4. See the error:

```bash
i emulators: Starting emulators: dataconnect
i dataconnect: downloading dataconnect-emulator-2.0.0...
Progress: ===============================================================================================> (100% of 27MB)
i dataconnect: Removing outdated emulator files: dataconnect-emulator-1.8.5
i dataconnect: Data Connect Emulator logging to dataconnect-debug.log
i dataconnect: Started up Postgres server, listening on {"address":"192.168.1.2","family":"IPv4","port":5432}
i emulators: Shutting down emulators.
i dataconnect: Stopping Data Connect Emulator
⚠ Data Connect Emulator has exited upon receiving signal: SIGINT

Error: Data Connect emulator: undefined
```

### [REQUIRED] Expected behavior

The Data Connect emulator should start successfully without any errors on the specified host and port.

### [REQUIRED] Actual behavior

Emulator fails to start when custom (local IP) host is specified in `firebase.json`.

### Additional Info

dataconnect-debug.log

```log
I0327 23:52:07.432635 2723 load.go:37] Reloading schema and connectors...
I0327 23:52:07.465153 2723 control.go:71] [/emulator/dataconnect 9059] UpdateResources(): done
Schema: sources: schema/schema.gql [2088B]
Connector "default": sources: connector/mutations.gql [1233B] connector/queries.gql [1802B]
I0327 23:52:07.489910 2723 collector.go:107] schema extensions wrote into ".../dataconnect/.dataconnect/schema"
Generated sources: prelude.gql [67159B]
I0327 23:52:07.490551 2723 load.go:115] Finished reloading
I0327 23:52:07.494261 2723 dev.go:95] Listening on address (HTTP + gRPC): 192.168.1.2:9399
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.