google-cloud-platform - MacOS 中的 gcloud 组件更新失败并出现 UnicodeDecodeError

标签 google-cloud-platform google-cloud-sdk

MacOS 中的 gcloud 组件更新失败并出现 UnicodeDecodeError。目前尚不清楚在 MacOS 中导致此问题的原因是什么,它表示“Hotfix for UnicodeDecodeError issues影响日志记录”。我该如何解决这个问题?

这是我当前的配置

gcloud -v
Google Cloud SDK 190.0.0
beta 2017.09.15
bq 2.0.29
core 2018.02.16
gsutil 4.28
Updates are available for some Cloud SDK components.  To install them,
please run:
  $ gcloud components update

这是我得到的错误

  Container Engine
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6: ordinal not in range(128)
Logged from file log.py, line 184
      ▪ Added container/use_v1_api_client property as an alias of
        container/use_v1_api. container/use_v1_api is still supported.

  Kubernetes Engine
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6: ordinal not in range(128)
Logged from file log.py, line 184
      ▪ Added --enable-pod-security-policy flag to enable PodSecurityPolicy
        enforcement in clusters: gcloud <alpha|beta> container clusters
        <create|update> --enable-pod-security-policy

  Stackdriver Debugger
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6: ordinal not in range(128)
Logged from file log.py, line 184
      ▪ Changed gcloud beta source upload command to use the .gcloudignore
        file if present. If not present and .gitignore is, .gitignore will
        still be used. See gcloud topic gcloudignore to learn more.

190.0.1 (2018-02-22)
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 859, in emit
    msg = self.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 732, in format
    return fmt.format(record)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 474, in format
    s = self._fmt % record.__dict__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 6: ordinal not in range(128)
Logged from file log.py, line 184
      ▪ Hotfix for UnicodeDecodeError issue affecting logging.

最佳答案

我可以看到你的Python版本是好的(2.7)。 在尝试更新之前,您可能需要运行 gcloud init

如果问题仍然存在或者您已经运行了上述命令,则 reinstall gcloud 会更快。 Current version was released today (198.0.0)。

关于google-cloud-platform - MacOS 中的 gcloud 组件更新失败并出现 UnicodeDecodeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49839575/

相关文章:

python - 将嵌套数据存储实体转换为 Python 字典的最简单方法是什么?

node.js - 使用带有 bunyan 的 stackdriver 日志记录时,即使在 gcp 的 vm 实例内部也会出现 PERMISSION_DENIED 错误

google-cloud-platform - 谷歌云部署管理器 : add instances to instance group via yaml configuration

c# - 如何在 Google Cloud AutoML 中将数据导入数据集并重新训练自定义模型

android - GCP API com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException

git - 在Windows 10上使用Google Cloud SDK身份验证方法将Git推送到Google Cloud Source Repository的权限被拒绝(公钥)

batch-file - 为什么我不能使用 gcloud 的批处理文件连续运行 2 个命令

google-cloud-sdk - 在 Ubuntu 上安装 Google Cloud SDK 时出错,如何解决?

google-cloud-platform - 是否可以通过 ssh 使用 Google Cloud Shell?

google-cloud-platform - Google 云 SDK 安装错误 : Could not update [/Users/username/. bash_profile]。确保您对此位置有写权限