Skip to content

Unable to provision custom bucket, error "does not have storage.buckets.create access to project ..." #261

Description

@tommed

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Windows 10 (latest updates)
  • Firebase SDK version: 3.18.4 (firebase --version)
  • Library version: 5.12.0 (firebase-admin in packages.json)
  • Firebase Product: storage (via npm package firebase-admin)

Steps to reproduce:

Trying to create a custom bucket via the firebase-admin npm module and even though my service account 100% has the storage.buckets.create permission (I've even created a custom role and explicitly assigned it this along with having the standard Storage Admin permission too).

I get the following error:

firebase-adminsdk-lwphn@XXX.iam.gserviceaccount.com does not have storage.buckets.create access to project 265909605284.

I believe this error is not accurate - or I'm doing something really stupid??

Relevant Code:

constadmin=require('firebase-admin');constserviceAccount=require('./storage-service-account.json');admin.initializeApp({credential: admin.credential.cert(serviceAccount),projectId: serviceAccount.project_id,authDomain: 'XXX.firebaseapp.com',storageBucket: 'XXX.appspot.com',});constbucket=admin.storage().bucket('my.custom.bucket');bucket.create()// OR bucket.get({ autoCreate: true });

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions