首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ansible gcp_storage_object_module: UnicodeDecodeError:'utf-8‘编解码器无法在位置解码字节0x87

Ansible gcp_storage_object_module: UnicodeDecodeError:'utf-8‘编解码器无法在位置解码字节0x87
EN

Stack Overflow用户
提问于 2021-12-08 13:22:01
回答 1查看 395关注 0票数 0

云位置需要URL编码,包括斜杠。如何将URL编码的位置保存在ansible中。

不可接受的任务:

代码语言:javascript
复制
  - name: Push artifacts to GCS
    google.cloud.gcp_storage_object:
      action: upload
      bucket: "{{ bucket }}"
      src: "/tmp/jars/CounterWebApp.war"
      dest: "~/CounterWebApp.war"
      project: "{{ project }}"
      auth_kind: serviceaccount
      service_account_file: "sa.json"

错误:

代码语言:javascript
复制
"module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1638969252.5433185-299097-261667259852506/AnsiballZ_gcp_storage_object.py\", line 102, in <module>\r\n    _ansiballz_main()\r\n  File \"/root/.ansible/tmp/ansible-tmp-1638969252.5433185-299097-261667259852506/AnsiballZ_gcp_storage_object.py\", line 94, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/root/.ansible/tmp/ansible-tmp-1638969252.5433185-299097-261667259852506/AnsiballZ_gcp_storage_object.py\", line 40, in invoke_module\r\n    runpy.run_module(mod_name='ansible_collections.google.cloud.plugins.modules.gcp_storage_object', init_globals=None, run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_google.cloud.gcp_storage_object_payload_m676xefz/ansible_google.cloud.gcp_storage_object_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_storage_object.py\", line 301, in <module>\r\n  File \"/tmp/ansible_google.cloud.gcp_storage_object_payload_m676xefz/ansible_google.cloud.gcp_storage_object_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_storage_object.py\", line 232, in main\r\n  File \"/tmp/ansible_google.cloud.gcp_storage_object_payload_m676xefz/ansible_google.cloud.gcp_storage_object_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_storage_object.py\", line 255, in upload_file\r\n  File \"/usr/local/lib/python3.6/site-packages/google/cloud/storage/blob.py\", line 2594, in upload_from_file\r\n    retry=retry,\r\n  File \"/usr/local/lib/python3.6/site-packages/google/cloud/storage/blob.py\", line 2412, in _do_upload\r\n    retry=retry,\r\n  File \"/usr/local/lib/python3.6/site-packages/google/cloud/storage/blob.py\", line 2242, in _do_resumable_upload\r\n    response = upload.transmit_next_chunk(transport, timeout=timeout)\r\n  File \"/usr/local/lib/python3.6/site-packages/google/resumable_media/requests/upload.py\", line 503, in transmit_next_chunk\r\n    method, url, payload, headers = self._prepare_request()\r\n  File \"/usr/local/lib/python3.6/site-packages/google/resumable_media/_upload.py\", line 605, in _prepare_request\r\n    self._stream, self._chunk_size, self._total_bytes\r\n  File \"/usr/local/lib/python3.6/site-packages/google/resumable_media/_upload.py\", line 963, in get_next_chunk\r\n    payload = stream.read(chunk_size)\r\n  File \"/usr/lib64/python3.6/codecs.py\", line 321, in decode\r\n    (result, consumed) = self._buffer_decode(data, self.errors, final)\r\nUnicodeDecodeError: 'utf-8' codec can't decode byte 0x87 in position 12: invalid start byte\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1

}

EN

回答 1

Stack Overflow用户

发布于 2021-12-08 16:27:33

它似乎是一个已知问题,有一个合并修复,但它还没有进入最近发布的任何。必须将该集合的“主”版本添加到您的评论索赔中的requirements.yml,以获取未释放的一个字符更改:-(

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70275724

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档