GKE入口:下载文件时出现502错误 [英] GKE Ingress: 502 error when downloading file

查看:179
本文介绍了GKE入口:下载文件时出现502错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在GKE上部署了集群,并暴露于入口.静态资源和多数或REST请求都可以正常工作.但是我在下载文件请求时收到502服务器错误.错误消息是:The server encountered a temporary error and could not complete your request.Please try again in 30 seconds.

I have cluster deployed at GKE and exposed with Ingress. Static resources and majority or REST requests works fine. But i got 502 Server Error on download file request. Error message is: The server encountered a temporary error and could not complete your request.Please try again in 30 seconds.

没有Ingres,而是使用LoadBalancer时,下载工作正常.我怀疑Ingress不喜欢后端响应.这是成功响应标头(不包含Ingress):

Without Ingres, when LoadBalancer is used instead, download works fine. I suspect Ingress don`t like backend response. Here is success response headers(without Ingress):

HTTP/1.1 200 OK
transfer-encoding: chunked
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE
Access-Control-Max-Age: 3600
Access-Control-Allow-Headers: x-requested-with, authorization, Content-Type, Authorization, credential, X-XSRF-TOKEN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Transfer-Encoding: chunked
Date: Wed, 28 Mar 2018 13:55:39 GMT

我尝试过的:

  1. 将云控制台中的入口转发规则的后端服务超时从默认的30秒增加到100秒
  2. 搜索stackdriver日志-未找到Ingress控制器的任何日志.

为什么此请求无法与Ingress配合使用,如何解决?在哪里可以找到GKE中Ingress的日志?

Why this request don`t work with Ingress, how fix it? Where can i find logs for Ingress in GKE?

推荐答案

当呼叫超过30秒(这是GKE中后端服务的默认超时)时(通过Ingress)对服务器的请求时,我遇到了同样的问题.

I had the same problem when my request to the server (through Ingress) when the call exceeded 30 seconds, which is the default timeout for backend services in GKE.

我知道这是一个老问题,所以我在这里的答案仅供未来的Google员工使用.

I know this is an old issue, so my answer here is just for future Googlers.

您写道,您增加了超时时间,但并未解决该错误. 请注意,后端服务的超时增加确实需要一些时间才能生效.我读过某个地方,可能最多需要20分钟.

You write that you have increased the timeout which did not fixed the bug. Be aware that the timeout increase in the backend services does need some time to take effect. Someplace I read that it could take up to 20 minutes.

因此,如果您仍在通话的30秒时仍然收到502错误,则问题可能仍然是由于GCP中的后端服务达到了超时所致-因此,请等待20分钟,然后重试.

So if you still get the 502 error at exactle 30 seconds into the call, the issue is probably still caused by the backend service in GCP that reaches the timeout - so just wait 20 minutes and try again.

这篇关于GKE入口:下载文件时出现502错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆