firebase-tools
firebase-tools copied to clipboard
Emulator export fails for Dataconnect
[REQUIRED] Environment info
firebase-tools: v14.4.0
Platform: macOS
[REQUIRED] Test case
NA
[REQUIRED] Steps to reproduce
-
Create new firebase project with
dataconnectenabled -
Run following command:
firebase emulators:start --export-on-exit=./emulator-data -
Give exit command with
Ctrl + C -
See error while exporting emulator data
[REQUIRED] Expected behavior
All the dataconnect emulator data to be stored inside the emulator-data/dataconnect_export/postgres.tar.gz
[REQUIRED] Actual behavior
i emulators: Received SIGINT (Ctrl-C) for the first time. Starting a clean shutdown.
i emulators: Please wait for a clean shutdown or send the SIGINT (Ctrl-C) signal again to stop right now.
i Automatically exporting data using --export-on-exit "./emulator-data" please wait for the export to finish...
i Found running emulator hub for project development-smileit at http://127.0.0.1:4400
i Exporting data to: /usr/fproject/functions/emulator-data
i emulators: Received export request. Exporting data to /usr/fproject/functions/emulator-data.
⚠ emulators: Export failed: ENOENT: no such file or directory, open '/usr/fproject/firebase-export-1747382123869exTRTX/dataconnect_export/postgres.tar.gz'
⚠ FirebaseError: Export request failed, see emulator logs for more information.
⚠ Automatic export to "./emulator-data" failed, going to exit now...
i emulators: Shutting down emulators.
Hey @OutdatedGuy - could you share the debug logs from this run?
dataconnect-debug.log
I0517 03:25:04.353248 29885 load.go:37] Reloading schema and connectors...
I0517 03:25:04.435751 29885 control.go:73] [/emulator/fdc 7d75] UpdateResources(): done
Schema: sources: schema/schema.gql [1008B]
Connector "default": sources: connector/mutations.gql [890B] connector/queries.gql [908B]
I0517 03:25:04.468504 29885 collector.go:107] schema extensions wrote into "/usr/fproject/dataconnect/.dataconnect/schema"
Generated sources: main/input.gql [15836B] prelude.gql [71531B] main/relation.gql [6179B] main/query.gql [4629B] main/mutation.gql [6678B] main/implicit.gql [282B]
I0517 03:25:04.468670 29885 load.go:115] Finished reloading
I0517 03:25:04.472259 29885 dev.go:95] Listening on address (HTTP + gRPC): [::]:9399
I0517 03:25:07.221120 29885 control.go:73] [/emulator/fdc 0648] UpdateResources(): done
Schema: sources: schema/schema.gql [1008B]
Connector "default": sources: connector/mutations.gql [890B] connector/queries.gql [908B]
@joehan looks like this issue only occurs when the emulator is started using script from package.json or when run from inside the functions directory.
-
Create a firebase project with
functionsanddataconnectenabled withfirebase init -
Add following script inside
functions/package.json:"emulator:export": "firebase emulators:start --export-on-exit=./emulator-data --project=demo-export-issue" -
Run the script with
npm run emulator:export -
Give exit command with
Ctrl + C -
See exporting error
It looks like the cli is searching for postgres.tar.gz from the root of project even if the command was ran from a sub-directory (i.e. functions)
Hi @joehan, still facing the same issue in firebase-tools: 14.18.0, any idea what's going on or any workaround?