Skip to content

bq CLI command always tries to authenticate which asks for password #423

@vend-pratik

Description

@vend-pratik

Steps:

  1. Installed emulator using docker image
  2. Loaded data into dataset (table_a and table_b)
  3. Created python client and queried data (worked fine)
  4. Tried to query using bq cli command (failed with prompt to re authenticate and password)

Command:
$ bq query --project_id=test "SELECT * FROM dataset1.table_a WHERE id = 1"
Reauthentication required. Please enter your password:

List of tried commands with same error:

  1. export BIGQUERY_EMULATOR_HOST=0.0.0.0:9050 bq query --project_id=test "SELECT * FROM dataset1.table_a WHERE id = 1"
  2. export GOOGLE_APPLICATION_CREDENTIALS="" export BIGQUERY_EMULATOR_HOST=0.0.0.0:9050 bq query --project_id=test "SELECT * FROM dataset1.table_a WHERE id = 1"
  3. export BIGQUERY_EMULATOR_HOST=0.0.0.0:9050 gcloud auth application-default login bq query --project_id=test "SELECT * FROM dataset1.table_a WHERE id = 1"
  4. gcloud iam service-accounts create bq-emulator-sa gcloud iam service-accounts keys create ~/bq-emulator-key.json --iam-account=bq-emulator-sa@your-project.iam.gserviceaccount.com export GOOGLE_APPLICATION_CREDENTIALS=~/bq-emulator-key.json export BIGQUERY_EMULATOR_HOST=0.0.0.0:9050 bq query --project_id=test "SELECT * FROM dataset1.table_a WHERE id = 1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions