`tensorflow_io.bigquery` 返回 `Empty update [Op:IO>BigQueryReadSession]` 错误

Posted

技术标签:

【中文标题】`tensorflow_io.bigquery` 返回 `Empty update [Op:IO>BigQueryReadSession]` 错误【英文标题】:`tensorflow_io.bigquery` returns `Empty update [Op:IO>BigQueryReadSession]` error 【发布时间】:2021-05-05 00:30:08 【问题描述】:

我在我的 Mac 笔记本电脑上关注这个 end to end example for BigQuery TensorFlow reader,但是当我运行以下行时

read_session = tensorflow_io_bigquery_client.read_session(...)

我收到以下错误

E0504 17:14:36.436042000 4592741888 ssl_utils.cc:463]                  load_file: "created":"@1620173676.435988000","description":"Failed to load file","file":"external/com_github_grpc_grpc/src/core/lib/iomgr/load_file.cc","file_line":71,"filename":"/usr/share/grpc/roots.pem","referenced_errors":["created":"@1620173676.435986000","description":"No such file or directory","errno":2,"file":"external/com_github_grpc_grpc/src/core/lib/iomgr/load_file.cc","file_line":45,"os_error":"No such file or directory","syscall":"fopen"]
E0504 17:14:36.436075000 4592741888 ssl_security_connector.cc:420]     Could not get default pem root certs.
E0504 17:14:36.436086000 4592741888 secure_channel_create.cc:132]      Failed to create secure subchannel for secure name 'bigquerystorage.googleapis.com'
E0504 17:14:36.436098000 4592741888 secure_channel_create.cc:50]       Failed to create channel args during subchannel creation.
E0504 17:14:36.436142000 4592741888 ssl_security_connector.cc:420]     Could not get default pem root certs.
E0504 17:14:36.436152000 4592741888 secure_channel_create.cc:132]      Failed to create secure subchannel for secure name 'bigquerystorage.googleapis.com'
E0504 17:14:36.436161000 4592741888 secure_channel_create.cc:50]       Failed to create channel args during subchannel creation.
Traceback (most recent call last):
  File "<stdin>", line 32, in <module>
  File "/Users/someuser/.virtualenvs/py36-tf2/lib/python3.6/site-packages/tensorflow_io/bigquery/python/ops/bigquery_api.py", line 134, in read_session
    row_restriction=row_restriction)
  File "<string>", line 1093, in io_big_query_read_session
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.UnavailableError: Error reading from Cloud BigQuery: Empty update [Op:IO>BigQueryReadSession]

如果我在同一台机器上创建一个容器并安装具有相同版本的相同依赖项,则示例代码可以正常运行。任何想法这个错误意味着什么,可能是什么导致它,以及如何解决它?

【问题讨论】:

【参考方案1】:

在幕后,BigQuery 客户端使用 gRPC 流式传输数据。

在 Windows 和 macOS 上,gRPC 需要一个环境变量来查找 SSL 的信任根,这可能已经包含在您构建的容器中。

您可以install the certificate manually解决问题。

【讨论】:

以上是关于`tensorflow_io.bigquery` 返回 `Empty update [Op:IO>BigQueryReadSession]` 错误的主要内容,如果未能解决你的问题,请参考以下文章