Skip to content

Error: Could not find rules for the following storage targets: rules #6125

Description

@godrays

Hi everyone,

I've been using Firebase for a while now and everything seems great, except for the fact that the storage.rules files can't be found when I attempt to deploy the rules. The firestore.rules files, however, deploy without any problems.

Is this a known problem? I couldn't find a solution for it.

Thank you for the help.

[REQUIRED] Environment info

firebase-tools 12.4.4
firebase 12.4.4
corepack 0.17.0
npm  9.5.1

macOS Ventura 13.4

[REQUIRED] Test case

Not sure what to put here.

[REQUIRED] Steps to reproduce

storage.rules file

rules_version = '2';

service firebase.storage
{
    match /b/{bucket}/o
    {
        match /test/{allPaths=**}
        {
            allow read: if true;
            allow write: if true;
        }
    }
}

firebase.json file

{
  "firestore": {
    "rules": "rules/firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "storage": {
    "rules": "rules/storage.rules"
  },
  ...

Note: I tried to put storage.rules in root folder as well but still didn't work.

rules file location

<project_root>/rules/firestore.rules
<project_root>/rules/storage.rules              

Command to deploy

firebase deploy --only storage:rules

[REQUIRED] Expected behavior

Deploying rules without an error.

[REQUIRED] Actual behavior

$ firebase deploy --only storage:rules

=== Deploying to 'xxxxxxxxxxxxxx'...

i  deploying storage

Error: Could not find rules for the following storage targets: rules

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