BigQuery Service Account JSON Authentication not working
See original GitHub issueDescribe the bug
Trying to authenticate to BigQuery using Service Account JSON Authentication because I’m running dbt from a docker container. Since storing the creds inside the container is not safe, I am passing each field as environment variable and parsing them in profiles.yml
.
Steps To Reproduce
In profiles.yml
:
keyfile_json:
type: "{{ env_var('BIGQUERY_TYPE') }}"
project_id: "{{ env_var('BIGQUERY_PROJECT_ID') }}"
private_key_id: "{{ env_var('BIGQUERY_PRIVATE_KEY_ID') }}"
private_key: "{{ env_var('BIGQUERY_PRIVATE_KEY') }}"
client_email: "{{ env_var('BIGQUERY_CLIENT_EMAIL') }}"
client_id: "{{ env_var('BIGQUERY_CLIENT_ID') }}"
auth_uri: "{{ env_var('BIGQUERY_AUTH_URI') }}"
token_uri: "{{ env_var('BIGQUERY_TOKEN_URI') }}"
auth_provider_x509_cert_url: "{{ env_var('BIGQUERY_AUTH_PROVIDER_X509_CERT_URL') }}"
client_x509_cert_url: "{{ env_var('BIGQUERY_CLIENT_X509_CERT_URL') }}"
However when trying to run anything I get:
Please log into GCP to continue
Encountered an error:
Got a non-zero returncode running: ['gcloud', 'auth', 'application-default', 'login']
Expected behavior
dbt should run normally
System information
Which database are you using dbt with? bigquery
The output of dbt --version
:
# dbt --version
installed version: 0.16.0
latest version: 0.17.0
Your version of dbt is out of date! You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
The operating system you’re using: python:3.7.4-slim
The output of python --version
: 3.7.4
Additional context
# gcloud --version
Google Cloud SDK 297.0.0
alpha 2020.06.12
beta 2020.06.12
bq 2.0.58
core 2020.06.12
gsutil 4.51
kubectl 2020.06.12
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Authenticating with a service account key file | BigQuery
Manually create and obtain service account credentials to use BigQuery when an application is deployed on premises or to other public clouds.
Read more >BigQuery Service Account JSON Authentication not working
Trying to authenticate to BigQuery using Service Account JSON Authentication because I'm running dbt from a docker container. Since storing the ...
Read more >bigquery authenticating with service account from text\string ...
I have the service account json in string\text, I want to avoid to write it to temporary file due to security reasons. Is...
Read more >Error "Invalid Service Account. To continue, enter a valid ...
When signing in to Google BigQuery using a Service Account (JSON) file in Tableau Desktop, the following error may occur: Authentication failed.
Read more >Google BigQuery - Service Account JSON file contents
Solved: Hey guys. I am trying to connect to Google Bigquery using a Service Account instead of a personal account. I have created...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi,
I dnt remeber exactly how it got fixed but I was facing problem with the key. When I copy paste the key into github env secrets some of the characters got changes automatically and thus I started copying the key with “ in the start and the end like this “Somekey” and then it worked.
On Tue, 2 Nov 2021 at 07:46, Mat Miadlikowski @.***> wrote:
Fixed. It was an issue parsing the private_key