0

真的可以在这里使用一些帮助。我在标准环境中有一个 GAE NodeJS 应用程序。直到几天前(09/23)它运行得很好,它会按预期响应请求等。

今天,当我尝试向我的 apppot 网址发出任何请求时,该应用程序会以 403 响应。我 100% 确定这不是代码问题,就好像我在另一个项目中将相同的代码部署到 GAE 一样,它工作正常。此外,唯一的防火墙规则是允许所有流量的通配符。

编辑:添加我从项目中看到的唯一相关的日志条目:

  {
    "protoPayload": {
      "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
      "status": {},
      "authenticationInfo": {
        "principalEmail": "address@domain.com"
      },
      "requestMetadata": {
        "callerIp": "x.x.x.x",
        "requestAttributes": {
          "time": "2021-09-23T15:04:05.198927Z",
          "auth": {}
        },
        "destinationAttributes": {}
      },
      "serviceName": "appengine.googleapis.com",
      "methodName": "google.appengine.v1.Services.UpdateService",
      "authorizationInfo": [
        {
          "resource": "apps/my-google-cloud-project-id/services/default",
          "permission": "appengine.services.update",
          "granted": true,
          "resourceAttributes": {}
        }
      ],
      "resourceName": "apps/my-google-cloud-project-id/services/default",
      "serviceData": {
        "@type": "type.googleapis.com/google.appengine.v1.AuditData",
        "updateService": {
          "request": {
            "name": "apps/my-google-cloud-project-id/services/default",
            "service": {
              "networkSettings": {
                "ingressTrafficAllowed": "INGRESS_TRAFFIC_ALLOWED_INTERNAL_AND_LB"
              }
            },
            "updateMask": "networkSettings"
          }
        }
      },
      "resourceLocation": {
        "currentLocations": [
          "us-east1"
        ]
      }
    },
    "insertId": "an-id",
    "resource": {
      "type": "gae_app",
      "labels": {
        "project_id": "my-google-cloud-project-id",
        "zone": "",
        "module_id": "default",
        "version_id": ""
      }
    },
    "timestamp": "2021-09-23T15:04:05.131761Z",
    "severity": "NOTICE",
    "logName": "projects/my-google-cloud-project-id/logs/cloudaudit.googleapis.com%2Factivity",
    "operation": {
      "id": "some-operation-uuid",
      "producer": "appengine.googleapis.com/admin",
      "first": true
    },
    "receiveTimestamp": "2021-09-23T15:04:05.495890906Z"
  }

我不记得做过这个改变,我不确定ingressTrafficAllowed之前的值是多少。

4

1 回答 1

1

不知何故,GAE 服务上的入口设置发生了变化。我相信该问题已通过转到 GCP 控制台 > App Engine > 服务 > 选择受影响的服务 -> 从顶部编辑入口设置并选择适当的值来解决。

我说我相信这解决了这个问题,因为这样做之后我的 apppot url 上仍然出现 403,最终我最终删除并从头开始重新创建项目,这让一切恢复正常。显然,我的项目中某处存在一些错误配置,但 GCP 无法轻松诊断问题可能是什么。

于 2021-09-30T07:15:47.580 回答