Fixed
Status Update
Comments
vi...@google.com <vi...@google.com> #2
Thank you for your report and feedback. We will work on fixing this and update you when it is done.
zj...@google.com <zj...@google.com> #3
Good news–this issue is fixed in Cloud SDK 129.0.0.
be...@zesty.ai <be...@zesty.ai> #4
I'm having a similar issue (but in 2022, on Cloud SDK 383.0.1).
$ bq --project_id "$gcloud_project" --format prettyjson query "SELECT * FROM $bq_dataset.$bq_table"
/home/user/tarballs/google-cloud-sdk/platform/bq/bq.py:41: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
BigQuery error in query operation: Error processing job 'myproject:bqjob_r525eb20069517f0f_0000018086e01d12_1': Not found: Dataset myproject:mydataset was not found in location US
I guess I can work around this with something like:
bq_wrapper() {
# `bq` sometimes prints error messages to stdout.
# This function wraps `bq`, redirecting stdout to stderr if exit code
# is nonzero.
output="$(bq "$@")"
exit_code="$?"
if test "$exit_code" = 0
then printf '%s\n' "$output"
else printf '%s\n' "$output" >&2
fi
return "$exit_code"
}
Some version details:
$ gcloud --version
Google Cloud SDK 383.0.1
bq 2.0.74
core 2022.04.26
gsutil 5.9
$ bq --project_id "$gcloud_project" --format prettyjson query "SELECT * FROM $bq_dataset.$bq_table"
/home/user/tarballs/google-cloud-sdk/platform/bq/bq.py:41: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
BigQuery error in query operation: Error processing job 'myproject:bqjob_r525eb20069517f0f_0000018086e01d12_1': Not found: Dataset myproject:mydataset was not found in location US
I guess I can work around this with something like:
bq_wrapper() {
# `bq` sometimes prints error messages to stdout.
# This function wraps `bq`, redirecting stdout to stderr if exit code
# is nonzero.
output="$(bq "$@")"
exit_code="$?"
if test "$exit_code" = 0
then printf '%s\n' "$output"
else printf '%s\n' "$output" >&2
fi
return "$exit_code"
}
Some version details:
$ gcloud --version
Google Cloud SDK 383.0.1
bq 2.0.74
core 2022.04.26
gsutil 5.9
[Deleted User] <[Deleted User]> #5
+1 same issue yet, on 302
gcloud --version
Google Cloud SDK 392.0.0
bq 2.0.75
core 2022.06.24
gsutil 5.10
gcloud --version
Google Cloud SDK 392.0.0
bq 2.0.75
core 2022.06.24
gsutil 5.10
rg...@screenly.io <rg...@screenly.io> #6
% bq query --headless -sync --format=csv --nouse_legacy_sql 'LOREM IPSUM' 2>/dev/null
Error in query string: Error processing job 'srly-prod:bqjob_r138c824ff6c70a08_00000188480610f8_1': Syntax error: Expected end of input but got identifier "LOREM" at [1:1]
% gcloud --version
Google Cloud SDK 431.0.0
bq 2.0.92
core 2023.05.12
gcloud-crc32c 1.0.0
gke-gcloud-auth-plugin 0.5.3
gsutil 5.23
Error in query string: Error processing job 'srly-prod:bqjob_r138c824ff6c70a08_00000188480610f8_1': Syntax error: Expected end of input but got identifier "LOREM" at [1:1]
% gcloud --version
Google Cloud SDK 431.0.0
bq 2.0.92
core 2023.05.12
gcloud-crc32c 1.0.0
gke-gcloud-auth-plugin 0.5.3
gsutil 5.23
Description
When I run
bg query < query > out
I see no output on stderr. When I look in "out", I find all the progress prompts, as well as the results of the query have gone to stdout.
What is the expected output? What do you see instead?
I expect the progress messages to go to stderr, while the results of the query should go to stdout.
What is the output of 'gcloud info'?
Google Cloud SDK [106.0.0]
Platform: [Mac OS X, x86_64]
Python Version: [2.7.10 (default, May 25 2015, 13:06:17) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]]
Please provide any additional information below.