Search code examples
google-cloud-platformgoogle-cloud-dataflowgoogle-cloud-iam

Error when creating a Job in Dataflow (Current user cannot act as service account)


I'm trying to create a job in Dataflow to export to a text file the data published to a pub/sub topic. When saving the configuration I get a 'Job creation failed' message specifying 'Current user cannot act as service account ...-compute@developer.gserviceaccount.com', as shown in the attached picture.

Following Google's documentation I added the following roles to my user for this project (in addition to the owner role I already have):

  • Compute Viewer
  • Dataflow Admin
  • Dataflow Developer
  • Storage Object Admin
  • Service Account User

However the Controller Service Account mentioned in the message doesn't seem to exist in the list of Account Services of this project (IAM & Admin > Account Services). Is there anything I'm missing here?

Other requirements already checked:

  • I have the Compute Engine API already enabled
  • As owner I have the iam.serviceAccounts.actAs permission

Solution

  • Your best option is to create a custom service account in IAM and use it to build/run your job. if you're using cloud build to deploy and run your template you'll need to set your logging location.

    More details at the below links: