googleapis / googleapis/google-cloud-python

Unsettling error message when performing a bad operation using the bq cli

Abierto
#17,058 3 comentarios 1 reacción 0 asignados Ver en GitHub
type: bug
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

### Determine this is the right repository

- [x] I determined this is the correct repository in which to report this bug.

### Summary of the issue

**Context**
I sometimes make typing mistakes and performing an illegal operation, I get an annoying stack trace rather than a clear error.

**Expected Behavior:**
```bash
$ gcloud version
Google Cloud SDK 564.0.0
alpha 2026.04.03
beta 2026.04.03
bq 2.1.31
bundled-python3-unix 3.13.11
core 2026.04.03
gcloud-crc32c 1.0.0
gsutil 5.36
kubectl 1.34.6
preview 2026.04.03

$ bq show drnick_prod.learner_milestones2
BigQuery error in show operation: Not found: Table data-42next:drnick_prod.learner_milestones2
```

**Actual Behavior:**
```bash
$ gcloud version
Google Cloud SDK 568.0.0
alpha 2026.05.08
beta 2026.05.08
bq 2.1.31
bundled-python3-unix 3.14.4
config-connector 145.0
core 2026.05.08
gcloud-crc32c 1.0.0
gke-gcloud-auth-plugin 0.5.14
gsutil 5.37
kubectl 1.35.3
preview 2026.05.08

$ bq show drnick_prod.learner_milestones2
Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/bq/clients/bigquery_http.py", line 277, in execute
return super().execute(
~~~~~~~~~~~~~~~^
http=http,
^^^^^^^^^^
num_retries=num_retries,
^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/googleapiclient/_helpers.py", line 135, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/googleapiclient/http.py", line 936, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/bq/frontend/bigquery_command.py", line 295, in RunSafely
return_value = self.RunWithArgs(*args, **kwds)
File "/usr/lib/google-cloud-sdk/platform/bq/frontend/command_show.py", line 419, in RunWithArgs
object_info = client_deprecated.get_object_info(
apiclient=client.apiclient,
...<2 lines>...
reference=reference,
)
File "/usr/lib/google-cloud-sdk/platform/bq/clients/client_deprecated.py", line 61, in get_object_info
return apiclient.tables().get(**dict(reference)).execute()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib/google-cloud-sdk/platform/bq/clients/bigquery_http.py", line 285, in execute
bq_client_utils.RaiseErrorFromHttpError(e)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
File "/usr/lib/google-cloud-sdk/platform/bq/clients/utils.py", line 539, in RaiseErrorFromHttpError
RaiseError(content)
~~~~~~~~~~^^^^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/clients/utils.py", line 1222, in RaiseError
raise bq_error.CreateBigqueryError(error, result, [])
utils.bq_error.BigqueryNotFoundError: Not found: Table data-42next:drnick_prod.learner_milestones2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/google-cloud-sdk/platform/bq/bq.py", line 162, in
appcommands.Run()
~~~~~~~~~~~~~~~^^
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/pyglib/appcommands.py", line 837, in Run
return app.run(_CommandsStart, flags_parser=ParseFlagsWithUsage)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/absl/app.py", line 312, in run
_run_main(main, args)
~~~~~~~~~^^^^^^^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/absl/app.py", line 258, in _run_main
sys.exit(main(argv))
~~~~^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/pyglib/appcommands.py", line 821, in _CommandsStart
raise sys.exit(command.CommandRun(GetCommandArgv()))
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/pyglib/appcommands.py", line 331, in CommandRun
ret = self.Run(argv)
File "/usr/lib/google-cloud-sdk/platform/bq/frontend/bigquery_command.py", line 289, in Run
return super(BigqueryCmd, self).Run(argv)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/frontend/bigquery_command.py", line 191, in Run
return self.RunSafely(new_args, new_kwds)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/frontend/bigquery_command.py", line 299, in RunSafely
return bq_error_utils.process_error(e, name=self._command_name)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/google-cloud-sdk/platform/bq/utils/bq_error_utils.py", line 251, in process_error
response_message = flags.text_wrap(response_message)
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/absl/flags/_helpers.py", line 285, in text_wrap
length = get_help_width()
File "/usr/lib/google-cloud-sdk/platform/bq/third_party/absl/flags/_helpers.py", line 194, in get_help_width
data = fcntl.ioctl(sys.stdout, termios.TIOCGWINSZ, '1234')
SystemError: buffer overflow
```

### API client name and version

_No response_

### Reproduction steps: code

### Reproduction steps: supporting files

_No response_

### Reproduction steps: actual results

_No response_

### Reproduction steps: expected results

_No response_

### OS & version + platform

Ubuntu 24.04.4 LTS

### Python environment

3.12.3

### Python dependencies

_No response_

### Additional context

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.