New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage emulator does not accept multiple storage targets configuration #3390
Comments
Thanks @DennisAlund for the very clear report! |
Good catch, will get a patch out this week! |
Any news on this issue? |
@samtstern @abeisgoat Can you please provide an ETA on this? It's a blocker for deployments. Thanks. |
@samtstern @abeisgoat Is there a ETA on this yet? Currently a blocker for fully using the emulator for us too. Thanks |
@BunFluffpaws E.g. https://gist.github.com/riordanpawley/cd9595cce7a3ee59e35a3b0a5ca62f0b |
@riordanpawley Thanks, I ended up working around this by having both buckets security rules in a single file over using the wildcards, only problem though is this gets deployed to 3 env's so 6 rules for 2 buckets :D but hey. Ive only had a quick read over the code you supplied, does it trick the emulator into only running 1 bucket or do they all still get their security rules applied? |
@BunFluffpaws Can you tell more about your workaround? |
@huyhn310 in your storage.rules have multiple buckets matching in the single rules file, the emulator will use it for all of them in a single file, then you can read/write to those extra buckets you create on the fly though using them in the emulator. Its not nice but it worked for being able to use the emulator. ` //default bucket //next bucket
} |
@abeisgoat is this still being worked on? We're still waiting for fix. |
Dear Jason,
Sorry for the late reply, I missed your email. I am checking on it now.
Thanks & Best Regards,
HuyHN
…On Wed, 6 Oct 2021 at 17:09, Jason Hu ***@***.***> wrote:
@abeisgoat <https://github.com/abeisgoat> is this still being worked on?
We're still waiting for fix.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3390 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANU3OLXA7HOY32TQFBHGQLTUFQN4DANCNFSM45GFWERA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Any other workarounds? |
This is blocking for me too |
same here, blocking |
…e configs are set in the storage emulator firebase#3390
…e configs are set in the storage emulator firebase#3390
I am blocked too. Could you please fix? |
Hi all, thanks for your patience. @tohhsinpei is working on a fix to this issue, it should be included in either our upcoming release or the one following. Stay tuned for updates. |
Hey there, what's the difference between using "storage": [
...
{
"rules": "backup_storage.rules",
"bucket": "backup-bucket"
}
] But it doesn't work because the Storage emulator requires a
|
Hi, thanks for the fix. Since the update, I get the following error given the same previous working code whether it is single or multiple rules configuration:
|
I also get this error if I go back to my default storage rules only (previously working):
Tried to follow this thread with no success https://stackoverflow.com/questions/70052479/firebase-storage-an-unknown-error-occurred-please-check-the-error-payload-for Please, help |
@ittaboba Could you provide the full contents of your |
Here's my
I get permission error on upload on both buckets. I think it's related to this issue #4346 |
Ok, I'll take a look. Thanks for the report. |
Reopening for now until this is resolved |
filed internal bug to track, b/240331248 |
Hey there, I took a look into it and wasn't able to repro this issue using the We recommend upgrading to the latest version of the emulator as we've made a lot of fixes and stability improvements over the past months. Closing out this issue as we believe it's resolved, please feel free to reach out and reopen with a sample app repro-ing the issue on the latest emulator version if you are still encountering it and we'll gladly take look. |
@abhis3 this doesn't seem to work for a storage configuration with multiple buckets like so:
I'm using firebase version 11.6
I took a look at these docs which mention setting up a target using site IDs for hosting, but my firebase project doesn't use hosting at all. |
Hi @paymog please see https://firebase.google.com/docs/cli/targets#set-up-deploy-target-storage-database for examples on how to setup your You'll likely have to have a set up similar to the following:
Set up your targets like so: $ firebase target:apply storage default <default bucket>
# etc |
that worked, thank you for the incredibly quick response! |
I am running firebase-tools version 11.25.2 under Windows and the behavior is exactly the same as described by OP. Already set the target on firebase.json: "storage": [
...
{
"target": "default",
"rules": "<path/to/my/rules>"
} And added the target on firebase tools: |
I am getting this error too... I have tried following the instructions given in Also the while(incorrectly) sending the file to firebase the security rule for 2nd bucket fails, probably it sends incorrect authentication to firebase. |
@akashdeep-sarin i've managed to fix using this tip: https://stackoverflow.com/a/77936073/5724645 In fact, since i use the namespace sdk the code is: firebase.storage().useEmulator('localhost', 9199)
// with modular api is possible to connect to a second bucket https://stackoverflow.com/a/77936073/5724645
// with the namespaced api it's a little different
const waMediaAssetsBucket = 'xxx'
firebase.app().storage(waMediaAssetsBucket).useEmulator('localhost', 9199) |
[REQUIRED] Environment info
firebase-tools: 9.11.0
Platform: macOS 11.3.1
[REQUIRED] Test case
Follow the steps to set up multiple storage targets: https://firebase.google.com/docs/cli/targets#set-up-deploy-target-storage-database
Ensure that the
firebase.json
configuration has an array of storage targets[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
Configuration that is acceptable for regular deployment should be acceptable for emulator.
[REQUIRED] Actual behavior
Get error when starting the emulators with multiple storage targets
Output
Output with debug flags
The text was updated successfully, but these errors were encountered: