firebase / firebase/firebase-tools

Storage emulator breaks `--export-on-exit`

Open
#5,708 0 comments 2 reactions 0 assignees View on GitHub
emulator-suite emulators: storage type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

Using `--import` and `--export-on-exit` for a project with the storage emulator enabled breaks export for all emulators.

I've tried the below with each individual emulator and with various combinations of them. Whenever the Storage emulator is enabled and run via `emulators:start`, the directory for `--export-on-exit` is ignored, and all other emulators' exports are broken/not in the right place

e.g

This works fine:

`firebase emulators:start --only auth,functions,firestore,hosting,pubsub --import ./emulator --export-on-exit`

This works fine if you have all emulators enabled EXCEPT storage

`firebase emulators:start --import ./emulator --export-on-exit`

These break the export for all emulators, not just storage. Its just the inclusion of storage that causes it:

`firebase emulators:start --only auth,functions,firestore,hosting,pubsub,storage --import ./emulator --export-on-exit`
`firebase emulators:start --only storgage --import ./emulator --export-on-exit`
`firebase emulators:start --import ./emulator --export-on-exit` (if you have storage emulator enabled)

**Update**
Interestingly, if you run these in two separate terminals:

`firebase emulators:start --only auth,functions,firestore,hosting,pubsub --import ./emulator --export-on-exit`
`firebase emulators:start --only storage --import ./emulator --export-on-exit`

When you kill the first one, the second one also exits and seems to export properly. Is this to do with what happens on the shutdown behaviour?

### [REQUIRED] Environment info

**firebase-tools:** 11.28.0

**Platform:** Windows 10

### [REQUIRED] Test case

Create a new firebase project which uses the storage emulator

### [REQUIRED] Steps to reproduce

`firebase emulators:start --import ./emulator --export-on-exit`

### [REQUIRED] Expected behavior

Storage emulator dumps its contents into the `./emulator` folder somehow
All other emulators correctly export their data

### [REQUIRED] Actual behavior

It exports into `./firebase-export-XXXXX`
All other emulators do not export properly

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with `firebase emulators:start --import ./emulator --export-on-exit`, then compare shutdown and export behavior with and without the storage emulator. Investigate the emulator start/export entry points implicated by the command. Done means storage and all other enabled emulators export into `./emulator` rather than a separate `firebase-export-XXXXX` directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.