-
Notifications
You must be signed in to change notification settings - Fork 373
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
Unable to provision custom bucket, error "does not have storage.buckets.create access to project ..." #261
Comments
Can you try the same directly with the GCS client library?
This will help us localize the error a little bit better. |
Thanks. I still get this: (node:15068) UnhandledPromiseRejectionWarning: ApiError: [email protected] does not have storage.buckets.create access to project 265909605284.
at Object.parseHttpRespBody (C:\Users\Me\Desktop\test-google-storage\node_modules\@google-cloud\common\src\util.js:199:30)
at Object.handleResp (C:\Users\Me\Desktop\test-google-storage\node_modules\@google-cloud\common\src\util.js:137:18)
at C:\Users\Me\Desktop\test-google-storage\node_modules\@google-cloud\common\src\util.js:502:12
at Request.onResponse [as _callback] (C:\Users\Me\Desktop\test-google-storage\node_modules\retry-request\index.js:195:7)
at Request.self.callback (C:\Users\Me\Desktop\test-google-storage\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\Me\Desktop\test-google-storage\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
(node:15068) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15068) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code. |
Ok, I managed to reproduce this error. I believe this happens because the Admin SDK does not specify a project ID when initializing the Storage client. This is good enough to access an existing bucket (whose names are global), but not sufficient to create new buckets. I think there's a simple fix. @tommed can you modify the above code as follows, and see if that works?
If this works out, I can do the same fix in the Firebase Admin SDK. |
Ok thanks!! Next error: |
...Ok so quick update, I tried this with the domain name PS C:\Users\Me\test-google-storage> node .\index.js
(node:12944) UnhandledPromiseRejectionWarning: ApiError: The bucket you tried to create is a domain name owned by another user.
at Object.parseHttpRespBody (C:\Users\Me\test-google-storage\node_modules\@google-cloud\common\src\util.js:199:30)
at Object.handleResp (C:\Users\Me\test-google-storage\node_modules\@google-cloud\common\src\util.js:137:18)
at C:\Users\Me\test-google-storage\node_modules\@google-cloud\common\src\util.js:502:12
at Request.onResponse [as _callback] (C:\Users\Me\test-google-storage\node_modules\retry-request\index.js:195:7)
at Request.self.callback (C:\Users\Me\test-google-storage\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\Me\test-google-storage\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
(node:12944) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:12944) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. In my service account, I am using the project |
I'm not familiar with this issue, and it's not something that can be addressed in the SDK as far as I can tell. Some Googling around revealed this SO post, which suggests verifying the domain and then waiting for 24 hours. In your case you will have to also add your service account as a domain owner. If that doesn't work out please reach out to GCP support. |
Thanks @hiranya911 really helpful links and insight. Feels like I'm getting close now... I have verified ownership of the domain, I then added an owner with the email address The domain I have verified is the main domain Error is still: |
GCP support should be able to help you out. We have limited experience dealing with this particular issue. Firebase users typically use the default bucket associated with the project, which is what's exposed via the Firebase Storage client API. The Cloud Storage Node.js client team might also have a rough idea what's going on here. They can be reached at https://github.com/googleapis/nodejs-storage |
Thanks. I emailed them on the 4th, but had no response yet. Unfortunate as I was really hoping to get a workaround for this for a work project. If you have any way of nudging them about this - I'd be extremely grateful! |
@tommed I filed a bug report internally as well. I'll keep an eye on it. |
[REQUIRED] Step 2: Describe your environment
Steps to reproduce:
Trying to create a custom bucket via the
firebase-admin
npm module and even though my service account 100% has thestorage.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:
I believe this error is not accurate - or I'm doing something really stupid??
Relevant Code:
The text was updated successfully, but these errors were encountered: