Open peteshilling opened 3 months ago
Hey @peteshilling, thanks for the detailed report and for sharing your observations. I was able to reproduce this issue. I’ll notify our engineering team about this so they can take a look.
Thank you, @aalej. It's one of those bugs that isn't a big deal once you know what is happening (just avoid using screenshot files when testing), but at first it looked like a much bigger issue and took some time to narrow down.
Im having the same issue, except its happening when i await bucket.file(filePath).download({ destination: tempFilePath });
within a cloud function. The function is onFinalize of storage object.
[debug] [2024-05-03T04:27:42.785Z] TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Content-Disposition"]
at ServerResponse.setHeader (node:_http_outgoing:651:3)
at sendFileBytes (/X/services/firebase/node_modules/.pnpm/firebase-tools@13.0.3/node_modules/firebase-tools/lib/emulator/storage/apis/shared.js:19:9)
at /X/services/firebase/node_modules/.pnpm/firebase-tools@13.0.3/node_modules/firebase-tools/lib/emulator/storage/apis/gcloud.js:88:47
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[error]
[error] Error: An unexpected error has occurred.
Seeing the exact same thing. Any update on this bug @aalej ? Firebase-tools version 13.7.2
I'm seeing this issue when the client app attempts to download images stored using Firebase Storage while using the emulator.
I'm seeing this issue when the client app attempts to download images stored using Firebase Storage while using the emulator.
I can confirm that. Any news if that gets resolved?
@aalej @joehan this still reproduces in 13.11.4. Filename is "Screenshot 2024-06-23 at 8.35.19 AM.png".
Hey @kylefoley, sorry to hear you’re still encountering this issue and thanks for following up on this. I tried uploading and viewing a file named "Screenshot 2024-06-23 at 8.35.19 AM.png" on the storage emulator, but no errors were raised. Currently using v13.11.4 as well.
I think I may have missed something here, could you provide us with details on how you encountered the issue? Was the error raised when viewing the file via the UI Emulator?
Absolutely, sorry I should have added this to start.
I'm locally running an angular app pointed to emulator cloud functions. When I call admin.storage().bucket(FIREBASE_STORAGE_BUCKET).file(path).getSignedUrl({ action: 'read', expires: Date.now() + 15 * 60 * 1000 }))
on the cloud function side, I get that error and it kills the emulator. Uploading seems to work ok, but getting the signed URL is where it dies.
This cloud function performs just fine when deployed. Let me know if you need any more debug information.
[REQUIRED] Environment info
firebase-tools: 13.4.0
Platform: macOS 14.2.1, M2
[REQUIRED] Test case
This can be reproduced in the emulator UI tool itself without any additional code.
[REQUIRED] Steps to reproduce
firebase emulators:start
[REQUIRED] Expected behavior
You should be able to view a preview of the uploaded image.
[REQUIRED] Actual behavior
After I select the image file the preview image in the right side panel shows a broken image and the emulators crash.
Error log shows this
Upon investigating, it looks like adding the filename to the Content-Disposition header in this commit caused the bug to start occurring.
It took me a while to realize there is something about the automated screenshot filenames that is causing the issue, but as best as I can tell, that's what it is.