【问题标题】:Google Cloud Function - Python - Unable to decode gzip谷歌云函数 - Python - 无法解码 gzip
【发布时间】:2021-08-26 09:05:39
【问题描述】:

我正在构建一个Google Cloud Function,它将接收来自Google PubSub 主题的消息。

在大量插入消息时,我在函数日志中看到以下错误:

('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check')), retrying in 1 seconds...

这发生了几次不一致:

  1. 大多数消息不会发生
  2. 失败次数不一致 - 从一次到连续 40 次。

我的邮件没有经过 gzip 压缩,并且其中没有“Content-Encoding”属性。

我的函数代码没有执行,这发生在 gcp 函数后端,然后才到达我的函数代码。

该功能确实有效并且消息已执行,但我想调查为什么会出现此问题。

问题

  1. 此问题的原因可能是什么?
  2. 我该如何解决?

【问题讨论】:

标签: google-cloud-platform google-cloud-functions google-cloud-pubsub


【解决方案1】:

当我将 Python 3.7 升级到 3.8 时问题已解决。

这似乎是函数后端或使用的某些库中的错误。

【讨论】:

    猜你喜欢
    • 2019-02-15
    • 1970-01-01
    • 2020-12-12
    • 2020-11-21
    • 2021-01-12
    • 2021-05-09
    • 2015-02-25
    • 1970-01-01
    • 2021-03-04
    相关资源
    最近更新 更多