![Google HTTP 负载均衡器和 Google Cloud Storage:PUT 请求中出现随机 403](https://linux22.com/image/767631/Google%20HTTP%20%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1%E5%99%A8%E5%92%8C%20Google%20Cloud%20Storage%EF%BC%9APUT%20%E8%AF%B7%E6%B1%82%E4%B8%AD%E5%87%BA%E7%8E%B0%E9%9A%8F%E6%9C%BA%20403.png)
我已经根据以下配置了 Google Cloud Storage 的 CNAME文档,所以基本上我用 Google 负载均衡器来处理请求。使用此配置近 2 年,我没有遇到任何问题(现在流量更高,所以问题可能被混淆了……我不知道这一点)。我正在使用签名 URL。
我已经开始在存储上的 PUT 操作中遇到一些明显随机的 403 响应,因此基本上与文件上传操作有关。 显然是随机的因为它大多数时候都能正常工作(我想是 99%),但是问题在日志查看器中变得明显,当然在来自我们用户的支持请求中也是如此。
以下是一个日志条目(一些细节被混淆了):
{
"insertId": "<id_here>",
"jsonPayload": {
"@type": "type.googleapis.com/google.cloud.loadbalancing.type.LoadBalancerLogEntry",
"statusDetails": "response_sent_by_backend"
},
"httpRequest": {
"requestMethod": "PUT",
"requestUrl": "https://storage.mydomain.it/path/2/2021-06-18/m_808/2_2021-06-18-09-09-24_m808_bdb6b3.png?GoogleAccessId=ocr-account%40mydomain.iam.gserviceaccount.com&Expires=1624000464&Signature=<signature_here>",
"requestSize": "1188472",
"status": 403,
"responseSize": "658",
"userAgent": "Apache-CXF/3.2.5",
"remoteIp": "88.86.183.XXX",
"latency": "0.107676s"
},
"resource": {
"type": "http_load_balancer",
"labels": {
"backend_service_name": "",
"forwarding_rule_name": "mydomain-balancer-1-forwarding-rule-2",
"url_map_name": "mydomain-balancer-1",
"target_proxy_name": "mydomain-balancer-1-target-proxy-2",
"project_id": "my_project_id",
"zone": "global"
}
},
"timestamp": "2021-06-18T07:09:25.037700Z",
"severity": "WARNING",
"logName": "projects/myproject/logs/requests",
"trace": "projects/myproject/traces/cc8123c2a42e70d8d002c84efe15e5de",
"receiveTimestamp": "2021-06-18T07:09:25.668260183Z",
"spanId": "e4b4a200767c9de0"
}
响应由后端发送可能表示存储本身发送了 403 错误。现在,有很多403 错误的可能原因,但日志查看器没有提供任何其他信息。
我该如何处理这个问题才能了解发生了什么?