Failed to insert job <JobReference
jobId: 'beam_bq_job_QUERY_XXX'
projectId: 'P'>: HttpError accessing <https://bigquery.googleapis.com/bigquery/v2/projects/P/jobs?alt=json>: response: <{'vary': 'Origin, X-Origin, Referer', 'content-type': 'application/json; charset=UTF-8', 'date': 'Mon, 08 May 2023 07:14:00 GMT', 'server': 'ESF', 'cache-control': 'private', 'x-xss-protection': '0', 'x-frame-options': 'SAMEORIGIN', 'x-content-type-options': 'nosniff', 'transfer-encoding': 'chunked', 'status': '403', 'content-length': '486', '-content-encoding': 'gzip'}>, content <{
"error": {
"code": 403,
"message": "Access Denied: Project P: User does not have bigquery.jobs.create permission in project P.",
"errors": [
{
"message": "Access Denied: Project P: User does not have bigquery.jobs.create permission in project P.",
"domain": "global",
"reason": "accessDenied"
}
],
"status": "PERMISSION_DENIED"
}
}
This step does not fail the pipeline, as size estimation is best effort and can just return
What happened?
Environment
SDK: Python
Runner: Dataflow
Connector: BigQuery
Apache Beam version:
2.45.0, but most likely also present in previous versionsPython version:
3.8.16, but does not seem to matter in this casePreconditions
Reproduction steps
Pipelinethat:apache_beam.io.ReadFromBigQuery),project),service_account),impersonate_service_account).PipelineOptionsdo not take part in size estimation:None.PipelineOptionsare configured properly, the first request for Google Cloud Platform token was made with empty options during BigQuery table size estimation in step 3. Subsequent calls utilize the cache and do not even try to get a token for the impersonated user.Source code
apache_beam/io/gcp/bigquery.py/_CustomBigQuerySource.estimate_size,apache_beam/io/gcp/bigquery_tools.py/BigQueryWrapper.__init__,apache_beam/internal/gcp/auth.py/_Credentials.get_service_credentials.Expected behaviour
The pipeline estimates BigQuery table size and submits the pipeline to Dataflow as user A.
Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
Issue Components