I made a mistake deleting an user service-[project number]#dataflow-service-producer-prod.iam.gserviceaccount.com in Service accounts, I should have deleted another user.
After that, the Dataprep stopped running the jobs.
I've checked all guidelines about dataflow and dataprep: if the API is enable (yes, it is). If there is a proper service account (yes). But I don't know what rules to assign to these accounts.
I tried assigning the "Cloud Dataflow Service Agent" role for this account, but it doesn't appear for me >
I tried too assigning another roles, but didn't work.
It all started when I deleted this account erroneously.
Someone knows how solve this?
PS: I'm working progress with my English, sorry for some mistakes.
If you accidentally deleted the Dataflow service account, disable Dataflow API then re-enable it will create the service account again automatically.
Disabling/Enabling the API is not recommended as associated resources will be impacted. You should rather undelete the default service account in the following 30 days. You would need its ACCOUNT_UNIQUE_ID that can be found in the generated logs when it was deleted. Find details here.
Related
I am trying to add a service account to my cloud run service. However, there is a message that "No service account with required permissions available."
I'm not sure if this is related to my user's credentials, or something else. This project has the default compute service account, as well as additional service accounts.
I can't find anything related in the documentation regarding this.
Would appreciate any insight you have on this issue!
Yes, I think that's probably (!?) what's occurring.
I assume that you're using Cloud Console and trying to Create a Cloud Run service.
I was able to add a minimally-roled user to an existing project and, when trying to create a Cloud Run service, I observe the same behavior that you're seeing.
How do you know that the project contains Service Accounts? I assume that your permissions are similarly restricted in eumerating these.
The permissions required to set a service account are described here. You need service account user permissions on the project or specific service account in order to set it on a deploy.
We have two projects in our GCP account; one for our Dev environment and one for our Test environment at the moment. Terraform manages most of our infrastructure, so we have minimal clicking around the GUI, or CLI commands.
I have assumed we enabled the Pub/Sub API by deploying to it with Terraform in both of our environments, although we may have needed to do this manually. We noticed that Google created a default Pub/Sub service account for us in our Dev environment, but not in our Test environment. This docs page suggests it should make this service account.
Additionally, we have noticed multiple Pub/Sub subscriptions working, apparently without any service account. We believe that the service account is only needed for this particular Subscription because it is a push to an e-mail server. Therefore, it needs a service account with the 'Service Account Token Creator' role.
We've attempted to redeploy the whole infrastructure and disable/re-enable the Pub/Sub API. Neither seemed to kick GCP into creating the Service Account. Further to this, we attempted to make the default service account manually. Still, GCP constrains the name a user can give a service account themselves, so we're unable to create a service account with the name that the Pub/Sub service would expect.
We wonder if there is some configuration of the project we may have missed or if anyone has seen this previously?
Does it not exist or does you not see it?
I'm pretty sure that it exists but without any role granted on it and you don't see it in the UI. Try to grant a role on this default service account, and it will appear in the IAM page!
I'm getting a strange error while trying to create a datalab in GCP. gcloud is up to date, all necessary APIs are enabled. I'm following these instructions https://cloud.google.com/datalab/docs/quickstart
Any ideas on what went wrong here?
This error looks like you've deleted in some wayCompute Engine default service account. Please go to IAM & Admin -> Service Accounts and check if you still have service account with name Compute Engine default service account.
To solve this issue follow instructions Undeleting a service account:
In some cases, you can use the undelete command to undelete a deleted
service account. You can usually undelete a deleted service account if
it meets these criteria:
The service account was deleted less than 30 days ago.
After 30 days, Cloud IAM permanently removes the service account.
Google Cloud cannot recover the service account after it is
permanently removed, even if you file a support request.
Also, you can try to reach Google Cloud Support for further instructions.
When I try to create a job in the GCP Cloud Scheduler I get this error:
{"error":{"code":7,"message":"The principal (user or service account) lacks IAM permission \"iam.serviceAccounts.actAs\" for the resource \"[my service account]\" (or the resource may not exist)."}}
When I enabled the GCP Cloud Scheduler the service account was created (and I can see it in my accounts list). I have verified that it has the "Cloud Scheduler Service Agent" role.
I am logged in as an Owner of our project. It is when I try to create the job that I get this error. I tried to add the "Service Account User" to my principal account, but to no avail.
Does anyone know if I have to add any additional permissions? Or if I have to allow my principal to act (impersonate?) this service account in some way?
Many thanks.
Ben
Ok I figured this out. The documentation is (sort of, in my view) clear if you read it in a certain way / know how GCP IAM works.
You actually need two service accounts. You need one that you set up yourself (can be whatever name you like and doesn't require any special permissions) and you also need the one for Cloud Scheduler itself.
Don't confuse the two. And use the one that you created when specifying the service account to generate the OAuth / OICD tokens.
Some of my service accounts are getting 403 (user not authorized) errors trying to publish/subscribe to PubSub. It appears it's not honoring "Inherited" permissions from Project level IAM.
I have verified the service accounts have IAM permissions to PubSub Subscriber & Viewer; and when I check the topic and subscriptions, they list the service accounts as type "Inherited". If I manually add the service account to the same permission from PubSub Console the UI lists it as "Mixed" and then it works.
Background - It was working before!
What's strange is this was working fine before. I accidentally deleted these same service accounts yesterday. I recreated them the same way, setup permissions the same way and it won't work. Also, the accounts that weren't deleted still work using "Inherited" permissions.
Some other things I've tried:
Created service account with different name from what was deleted - didn't work
Re-created topics/subs after creating service accounts and giving them project-wide permissions- didn't work
Long term I guess I'd prefer to control permissions per Topic/Sub; but I'm still baffled why this isn't working or what I've done wrong.
There currently seems to be a limitation with project-level permissions when a service account is deleted and recreated. The permissions for the newly created service account will not be propagated as expected.
If the service account is created with a different name, inherited permissions should work correctly. Note that permission propagation is not immediate and can have a delay. You may have to wait a few minutes to see the changes reflected.
For further assistance, you may need to contact Cloud Support so they can look into the specifics of your situation.