firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Storage emulator import/export data error

Open rulaman123 opened this issue 4 years ago • 14 comments

Hi, after starting the storage emulator with import the ui only shows a white page and i get that error:

Failed to load resource: the server responded with a status of 404 (Not Found)
2react-dom.production.min.js:225 FirebaseError: Firebase Storage: Object '...' does not exist. (storage/object-not-found)

[REQUIRED] Environment info

firebase-tools: v10.4.0

Platform: Windows

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

Upload image to storage emulator. Export image and close emulator. Open storage emulator with import data. Error.

[REQUIRED] Expected behavior

[REQUIRED] Actual behavior

rulaman123 avatar Mar 17 '22 21:03 rulaman123

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

google-oss-bot avatar Mar 17 '22 21:03 google-oss-bot

same issue for me, I throught it was related to my M1, but it's seams not.

On my old mac (where it's ok) : firebase-cli version is 10.2.1 On my new mac (where it's bugged) : firebase-cli version is 10.4.0

anthony-bernardo avatar Mar 19 '22 16:03 anthony-bernardo

I've been running into the same issue when I went from version 10.2.1 to 10.4.1. I downgraded to version 10.3.1 and found the bug still present. Only when I went back to v10.2.1 did the bug disappear.

ermartinez13 avatar Mar 22 '22 15:03 ermartinez13

Adding some more info:

[REQUIRED] Environment info

I can reproduce this on

  • MB Pro M1 Max
  • MP Pro 2019

[REQUIRED] Steps to reproduce

  1. Start with an empty $FIREBASE_EMULATOR_DATA directory.

  2. Start the emulator with

firebase emulators:start --project myproject -only 'storage' --import $FIREBASE_EMULATOR_DATA --export-on-exit

Now upload, for example, an image myfile.jpg to the bucket (for example by using the web UI). The problem is the same if you upload it via the firebase dart package.

  1. Stop the emulator gracefully and note the "Export complete" log entry indicating that everything went OK.

  2. Start the emulators again

firebase emulators:start --project myproject -only 'storage' --import $FIREBASE_EMULATOR_DATA --export-on-exit

Note the log message

Could not find file "myproject%252Fmyfile.jpg" in storage export.

  1. Verify that the file is indeed missing from the storage emulator.

torstenek avatar Mar 25 '22 11:03 torstenek

The sequence %252F in the filename could be the result of a double URI encoding.

torstenek avatar Mar 27 '22 16:03 torstenek

Potential duplicate of https://github.com/firebase/firebase-tools/issues/4326

tonyjhuang avatar Mar 29 '22 20:03 tonyjhuang

Jumping in here as I'm facing the same issue and have more information to add: After starting the emulator with importing previously exported Storage data, accessing the storage bucket "directory" via the Emulator UI brings me to a white page with an exception in the browser:

FirebaseError: Firebase Storage: Object 'directory/subdirectory/filename' does not exist. (storage/object-not-found)
Not Found

I checked the storage_export\blobs directory in the file system and there, the file seems to be present but in my case the file name looks like this:

my-app.appspot.com%5Cdirectory%5Csubdirectory%5Cfilename

So in my case the %5C are URL encoded backslashes (probably because the export was made on Windows). By the comments above I am unsure if that's also an issue. Shouldn't these be forward slashes (or url encoded forward slashes -> %2F) according to https://github.com/firebase/firebase-tools/issues/4322#issuecomment-1079965782 ? I guess this will also be an issue when going cross-platform.

sceee avatar Mar 31 '22 14:03 sceee

I'm having the same issue of the blank page when I click the storage tab of the emulator UI and error messages:

FirebaseError: Firebase Storage: Object 'filename' does not exist. (storage/object-not-found)
Not Found

Failed to load resource: the server responded with a status of 404 (Not Found) :9199/v0/b/bucketname/filename

with a subsequent

Failed to load resource: the server responded with a status of 404 (Not Found)

I do have URL encoding of the filenames in the exported storage blobs. They're in the following format bucketname%2Ffilename. Is this related to the encoding problems affecting other platforms?

I'm on Mac OS with an Intel chip.

alvinchevolleaux avatar Apr 04 '22 18:04 alvinchevolleaux

I don't see any logs regarding imports to Storage when importing a production backup that uses Storage. The Emulator Suite Storage tab is also empty of files after such an import.

coreform avatar Apr 05 '22 05:04 coreform

Thanks all for the reports. The main issue looks like a duplicate of #4326 and should be fixed in #4358, which was included in yesterday's release. Let me know if the problem persists.

@sceee You're right, there is still an issue with importing/ exporting across platforms. I'll put in a fix sometime this week; will close this once that is in.

tohhsinpei avatar Apr 05 '22 18:04 tohhsinpei

@tohhsinpei thanks. I can confirm that the main issue (Emulator UI crashes on same OS export/import & file not available) is fixed with 10.6.0.

But importing a Windows export on a Mac still makes the emulator UI crash and the file not being available via the API as you wrote. I'm looking forward to the fix, thank you!

sceee avatar Apr 05 '22 18:04 sceee

When attempting to seed the emulators with a production backup with firestore-tools 10.6.0, firestore is populated but there is still no sign of Storage logs or data after: firebase emulators:start --import=../backupFolder/

coreform avatar Apr 06 '22 01:04 coreform

Hi @coreform, can you file a new issue? This seems unrelated to the original comment in this one.

tonyjhuang avatar Apr 06 '22 15:04 tonyjhuang

Can confirm this is working for me now using 10.6.0.

alvinchevolleaux avatar Apr 06 '22 15:04 alvinchevolleaux