Skip to content

Firebase crashes while starting #3487

Closed

Description

@ayazici-vekend

I was using a local emulator to develop my app, and i was starting the emulator with the following command:

firebase emulators:start --export-on-exit=./saved-data --import=./saved-data

In vscode i tried to write @(Alt + q) symbol but my hand slipped and instead i clicked ctrl + q, and it caused to quit vscode while firebase was still running. And now when i try to start the emulator with the same command it crashes due following reason taken from the debug.log of firestore:

 firestore: Firestore Emulator logging to firestore-debug.log {"metadata":{"emulator":{"name":"firestore"},"message":"Firestore Emulator logging to \u001b[1mfirestore-debug.log\u001b[22m"}}
[2021-06-12T16:40:50.883Z] Exception in thread "main"  {"metadata":{"emulator":{"name":"firestore"},"message":"Exception in thread \"main\" "}}
[2021-06-12T16:40:50.883Z] com.google.cloud.datastore.core.exception.DatastoreException: Failed to parse overall export metadata file
        at com.google.cloud.datastore.emulator.impl.ExportImportUtil.parseOverallMetadataFile(ExportImportUtil.java:229)
        at com.google.cloud.datastore.emulator.impl.ExportImportUtil.fetchEntities(ExportImportUtil.java:56)
        at com.google.cloud.datastore.emulator.firestore.CloudFirestore.main(CloudFirestore.java:89)
Caused by: java.io.FileNotFoundException: /home/ahmet/Documents/project-folder/backend/saved-data/firestore_export/firestore_export.overall_export_metadata (No such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)

Activity

  1. samtstern commented on Jun 14, 2021

    @samtstern
    Contributor

    @ayazici-vekend sounds like you got into a half-corrupted state by quitting the emulators during an export. If you just delete all the contents of the ./saved-data directory I think this will fix the crash on startup.

  2. added
    Needs: Author Feedback
    on Jun 14, 2021
  3. Misal-Ambasta commented on Jun 15, 2021

    @Misal-Ambasta

    I also quit the local emulator in the mid, Now Its keep showing the same error again and again whenever I start my local emulator
    firebase serve --only functions or firebase emulators:start --only functions

    How can I reset my local emulators?

  4. ayazici-vekend commented on Jun 15, 2021

    @ayazici-vekend
    Author

    Thank you very much @samtstern that's what i have guessed too. So I just recovered my previous project from git and it was solved, it seems some files went missing / deleted when quitted in the mid.

  5. added and removed
    Needs: Author Feedback
    on Jun 15, 2021
  6. samtstern commented on Jun 16, 2021

    @samtstern
    Contributor

    @ayazici-vekend thanks for following up! I am going to also make a note for myself to improve this behavior in the future, but for now let's close this because your issue was fixed.

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