Google cloud platform 通过云运行下载大型文件时发生500内部服务器错误

Google cloud platform 通过云运行下载大型文件时发生500内部服务器错误,google-cloud-platform,google-cloud-run,Google Cloud Platform,Google Cloud Run,在构建了一个巨大的映像,其中包含一个超过30GB的文件,用于测试目的之后,在将映像部署到Cloud Run中之后,我无法下载相同的文件 作为clar,映像确实是在Cloud Run上构建和运行的,但由于某些原因,特定的大文件不可用 下面是复制此错误的Dockerfile示例: FROM python:3 WORKDIR /app RUN touch test # downloading this file works fine RUN dd if=/dev/urandom of=file bs=

在构建了一个巨大的映像,其中包含一个超过30GB的文件,用于测试目的之后,在将映像部署到Cloud Run中之后,我无法下载相同的文件

作为clar,映像确实是在Cloud Run上构建和运行的,但由于某些原因,特定的大文件不可用

下面是复制此错误的Dockerfile示例:

FROM python:3
WORKDIR /app
RUN touch test # downloading this file works fine
RUN dd if=/dev/urandom of=file bs=1M count=32768 # this one takes a while to build and to deploy, and won't be downloadable later on.
EXPOSE 8080
CMD python -m http.server 8080 --bind 0.0.0.0
尝试通过wget下载文件会返回以下结果:

wget https://cloud-run-link-here.app/file
--2020-03-03 17:19:16--  https://cloud-run-link-here.app/file
Loaded CA certificate '/etc/ssl/certs/ca-certificates.crt'
Resolving cloud-run-link-here.app (bigdocker-7k3mrt42la-uc.a.run.app)... :::::0, 0.0.0.0
Connecting to cloud-run-link-here.app (cloud-run-link-here.app)|:::::0|:443... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2020-03-03 17:19:17 ERROR 500: Internal Server Error.
在本地做同样的事情很好

在Cloud Run的日志中没有有用的信息,如下图所示。

Python标准库中的和HTTP服务器是。很有可能它没有尝试对非常大的请求进行分块,结果失败了

您应该考虑使用生产HTTP服务器来代替。