sanketkheni01 / fire-import

14 stars 3 forks source link

Exporting is not working #8

Open DiegoGonzalezCruz opened 12 months ago

DiegoGonzalezCruz commented 12 months ago

Hello! I wonder if this version is broken? I recently updated my firebase emulator and it is not working anymore. Any ideas?

SEVERE: Exiting due to unexpected exception.
com.google.cloud.datastore.core.exception.DatastoreException: Message missing required fields: kind_info[0].kind
        at com.google.cloud.datastore.util.leveldb.ExportImportUtil.parseBackupFile(ExportImportUtil.java:378)
        at com.google.cloud.datastore.util.leveldb.ExportImportUtil.fetchEntities(ExportImportUtil.java:88)
        at com.google.cloud.datastore.emulator.firestore.CloudFirestore.init(CloudFirestore.java:181)
        at com.google.cloud.datastore.emulator.firestore.CloudFirestore.startLocally(CloudFirestore.java:115)
        at com.google.cloud.datastore.emulator.firestore.CloudFirestore.main(CloudFirestore.java:96)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Message missing required fields: kind_info[0].kind
        at com.google.protobuf.UninitializedMessageException.asInvalidProtocolBufferException(UninitializedMessageException.java:79)
        at com.google.protobuf.AbstractParser.checkMessageInitialized(AbstractParser.java:73)
        at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:91)
        at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:96)
        at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:48)
        at com.google.cloud.datastore.util.leveldb.ExportImportUtil.parseBackupFile(ExportImportUtil.java:376)
        ... 4 more
petrvecera commented 8 months ago

I just run npx fire-import firestore in my project with Node 20 and it worked on it's own

BenJackGill commented 4 months ago

I was also having trouble, not with errors but with it hanging at "Importing data" and not doing anything.

In the end this worked for me: Log in with Firebase and gcloud CLI using firebase login --reauth and gcloud auth login. Then after that I used npx fire-import firestore to export everything and firebase emulators:start --import=./firebaseExport --export-on-exit=./firebaseExport to start the emulators with the data.

sanketkheni01 commented 4 months ago

Sorry for not updating you guys on the issue for a very long time. Lately, I didn't have any time to work on the project. The project itself is very simple. I would really appreciate it if you guys could make a pull request.