AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[google-cloud-platform](server)

Martin Hope
fr di
Asked: 2025-04-07 21:53:56 +0800 CST

Google Cloud MySQL 日志“长度为 0,策略为 1”

  • 5

我检查了 Google Cloud MySQL 日志,发现了以下日志。这种情况每 15 分钟发生一次。这是什么?我可以忽略它吗?MySQL 版本是 8.0.31。

[注意] [MY-000000] [服务器] 长度为 0,策略为 1

我尝试搜索但找不到任何文档。

google-cloud-platform
  • 1 个回答
  • 63 Views
Martin Hope
PowerGnom
Asked: 2025-01-28 23:25:31 +0800 CST

如何使用 Google Cloud CLI (gcloud) 创建带有用户标签的正常运行时间检查

  • 5

我正在尝试使用 gcloud 命令行客户端在 Google Cloud Platform 中创建正常运行时间检查。这是一个示例:

gcloud monitoring uptime create 'example uptime check' --resource-labels=host=...,project_id=... --resource-type=uptime-url --protocol=https --port=443 "--path=..." --request-method=get --validate-ssl=true --status-codes=200 --matcher-type=contains-string "--matcher-content=..." --period=5 --timeout=30 --user-labels=instance-group=production,instance-type=authentication,monitoring-type=uptime

这通常有效,即创建了正常运行时间检查并且没有报告任何错误。但是,我的用户标签被默默忽略了。

我相信我正确地遵循了文档(https://cloud.google.com/sdk/gcloud/reference/monitoring/uptime/create):

    --user-labels=[KEY=VALUE,…]
        List of label KEY=VALUE pairs to add.
        Keys must start with a lowercase character and contain only hyphens (-), 
        underscores (_), lowercase characters, and numbers. Values must contain only 
        hyphens (-), underscores (_), lowercase characters, and numbers.

我已成功向计算实例、磁盘等添加了非常相似的用户标签。

我也尝试通过 向现有的正常运行时间检查中添加用户标签gcloud monitoring uptime update,但这也没有用。

更新:我已按照 Daniel t. 的建议创建了一个错误报告:https://issuetracker.google.com/issues/393989630

google-cloud-platform
  • 1 个回答
  • 35 Views
Martin Hope
nathou
Asked: 2025-01-25 02:19:37 +0800 CST

尝试将服务帐户附加到另一个项目中的资源时出现 403 iam.serviceAccounts.actAs 权限错误

  • 5

我正在测试在 BigQuery 上创建计划查询所需的权限。

[email protected]计划查询将通过我可以模拟的服务帐户 ( ) 以编程方式创建。计划查询将以另一个服务帐户 ( [email protected]) 的身份运行。

我已授予以下角色:

  • BigQuery 管理员已[email protected]开启project1
  • 服务[email protected]帐户用户[email protected]
  • BigQuery 数据编辑器至[email protected]目标数据集 ( test_dataset)
  • BigQuery[email protected]作业用户project1
  • BigQuery Resource Viewer到[email protected]组织(因为查询正在使用该region-us.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION视图)

我在连接到(目标数据集在此项目中)时运行以下命令project1。我也尝试使用 terraform 实现相同功能,但出现相同的错误消息。

gcloud config set auth/impersonate_service_account [email protected]
bq mk \
  --transfer_config \
  --target_dataset=test_dataset \
  --display_name='test bq scheduled query' \
  --params='{"destination_table_template":"test_jobs", "write_disposition":"WRITE_APPEND", "query":"SELECT job_id FROM `region-us.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION` WHERE DATE_TRUNC(creation_time, DAY) = '2025-01-22'"}' \
  --data_source=scheduled_query \
  [email protected]

我得到以下输出:

Updated property [auth/impersonate_service_account].
WARNING: This command is using service account impersonation. All API
calls will be executed as [[email protected]].
BigQuery error in mk operation:
Requesting user [email protected] does not have
iam.serviceAccounts.actAs permission to act as service account
[email protected]

该错误是谎言,因为[email protected]已启用服务帐户用户角色[email protected],并且该角色包含iam.serviceAccounts.actAs权限。

我是不是漏掉了什么?GCP 支持让我抓狂,一点帮助都没有。

(服务帐户、数据集和项目名称已更改)

google-cloud-platform
  • 1 个回答
  • 138 Views
Martin Hope
plotmaster473
Asked: 2024-12-06 06:19:17 +0800 CST

错误:(gcloud.app.create)INVALID_ARGUMENT:该项目必须附加一个结算帐户

  • 5

我正在用 Python 部署一个简单的仪表板 Web 应用程序。有关部署的所有内容与以前有效的部署大致相同。(相同的 YAML、相同的身份验证代码等)

然而,当我部署下一个应用程序时,google cloud CLI 会抛出上述错误gcloud app create。

ERROR: (gcloud.app.create) INVALID_ARGUMENT: The project must have a billing account attached

除了“稍后再试”之外,我在各个论坛上都找不到解决方案。据说这个方法有效。但仍然好奇为什么会出现这个错误/有没有更有经验的建议。

google-cloud-platform
  • 1 个回答
  • 97 Views
Martin Hope
Europa
Asked: 2024-11-26 17:21:36 +0800 CST

Google Cloud VPC 中的组织政策位置限制:google.compute.Subnetwork 默认违反“gcp.resourceLocations”组织政策

  • 5

我正在通过 Google Cloud 中的安全指挥中心,发现以下安全问题:

  • 名称:ORG_POLICY_LOCATION_RESTRICTION
  • 描述:资源位于资源位置限制策略中设置的位置之外
  • 资源显示名称:default
  • 资源全名://compute.googleapis.com/projects/MYPROJECT/regions/us-east5/subnetworks/default
  • 资源类型:google.compute.Subnetwork

后续步骤Next steps

请访问此 Google Cloud Platform 页面,它将帮助您解决影响 google.compute.Subnetwork 资源默认值的位置冲突问题。

请删除此资源以解决与“gcp.resourceLocations”组织政策相关的资源违规问题。

删除

当我去的时候VPC networks我看到很多default网络,但它们无法被删除。

我怎样才能删除它们?

google-cloud-platform
  • 1 个回答
  • 74 Views
Martin Hope
Bender Rodriguez
Asked: 2024-08-07 07:55:05 +0800 CST

每日重启 Google Cloud COS 容器

  • 5
该问题已从 Stack Overflow迁移,因为它可以在 Server Fault 上得到解答。37 分钟前迁移 。

我正在 COS(容器操作系统)实例上部署容器。非常简单。

我希望它每天重启。最好的方法是什么?我可以在虚拟机上设置一个简单的 CRON 选项卡吗?问题是每次重新部署虚拟机时都需要重新执行此操作。

google-cloud-platform
  • 2 个回答
  • 5 Views
Martin Hope
Josh Marcus
Asked: 2024-07-10 13:50:43 +0800 CST

无法触发 Google Cloud Artifact Registry 清理策略的试运行审核日志

  • 5
该问题已从 Stack Overflow迁移,因为它可以在 Server Fault 上得到解答。 已于 39 分钟前迁移 。

遵循 GCP 提供的文档:https ://cloud.google.com/artifact-registry/docs/repositories/cleanup-policy

我在我的工件存储库上设置了清理策略,并启用了试运行选项,但无法使用该命令输出任何审计日志。

gcloud logging read 'protoPayload.serviceName="artifactregistry.googleapis.com" AND protoPayload.request.parent:"projects/gift-service-app-jm/locations/australia-southeast1/repositories/gcf-artifacts" AND protoPayload.request.validateOnly=true' \
    --resource-names="projects/gift-service-app-jm" \
    --project=gift-service-app-jm

我能够确认策略已设置,并且使用命令启用了试运行gcloud artifacts repositories describe gcf-artifacts选项

{
  "cleanupPolicies": {
    "Delete Previous Versions": {
      "action": "DELETE",
      "condition": {
        "olderThan": "864000s",
        "tagState": "UNTAGGED"
      },
      "id": "Delete Previous Versions"
    }
  },
  "cleanupPolicyDryRun": true,
  "createTime": "2023-09-27T05:07:31.256470Z",
  "description": "This repository is created and used by Cloud Functions",
  "format": "DOCKER",
  "labels": {
    "goog-managed-by": "cloudfunctions"
  },
  "mode": "STANDARD_REPOSITORY",
  "name": "projects/gift-service-app-jm/locations/australia-southeast1/repositories/gcf-artifacts",
  "updateTime": "2024-07-10T05:39:56.088672Z"
}

以前有人遇到过这个问题吗?我已将所有者角色应用于我的 IAM 主体,但也尝试明确添加日志查看器和私有日志查看器角色。

google-cloud-platform
  • 1 个回答
  • 3 Views
Martin Hope
Europa
Asked: 2024-06-30 15:49:44 +0800 CST

在 Google Cloud Compute Engine 实例模板启动脚本中使用秘密 API 密钥。它应该存储在哪里以及如何读取该值?

  • 5

我有一个带有启动脚本的 Google Cloud Compute Engine 实例模板。

在启动脚本中,服务器会生成证书。生成证书后,它会向 API 发送一条消息,告知中央系统有关证书的信息。请求如下所示:

curl --location 'https://my-side.com/hello?hostname=$hostname' \
    --header 'Authorization: SUPER_SECRET_API_KEY'

API 密钥以原始文本形式存储在启动脚本中。这样可以吗,还是应该将其移至示例密钥存储?如果可以,那么我该如何读取启动脚本中的 API 密钥?

google-cloud-platform
  • 2 个回答
  • 54 Views
Martin Hope
e741af0d41bc74bf854041f1fbdbf
Asked: 2024-03-22 21:34:29 +0800 CST

如何删除 Google Kubernetes Engine Autopilot 中不健康的节点?

  • 5

我在 GKE Autopilot 上运行的 Kubernetes 集群有一个不健康的节点。该节点有一个Ready状态,但在其上运行的所有 Pod 都有一个CreateContainerError状态,并且似乎在轮询容器映像时陷入困境。

例子:

(正常拉取 101 秒(x1326 超过 4 小时 49 分钟)kubelet 容器映像“gke.gcr.io/cluster-proportional-autoscaler:v1.8.10-gke.3@sha256:274afbfd520aef0933f1fefabddbb33144700982965f9e3632caabb055e912c6 “已经存在于机器上)。

kubernetes 升级时出现问题,因为我的帐户超出了配额(显然 1TB 的计算存储对于小型集群来说是不够的)。我获得了更多配额,但自动驾驶仪集群无法自行修复。

我“封锁”了该节点,将其标记为不可调度,并手动从中删除了我的 pod。新的 Pod 被安排在更健康的节点上,所以还不错。

现在我想打扫卫生。旧的 Pod 被困在Terminating状态中,但强制删除它们会使它们消失。

我无法对kube-system和gke-gmp-system命名空间执行相同的操作。我看到“托管”pod 具有CreateContainerError状态,并且它们正在循环中拉取容器映像。一个人也被某种Terminating地位所困。

我想删除这个节点,显然你需要耗尽该节点并忽略名称空间中的错误kube-system。我耗尽了节点,但它仍然存在。

如何删除不健康的节点?

google-cloud-platform
  • 1 个回答
  • 33 Views
Martin Hope
Julian
Asked: 2024-03-14 13:35:34 +0800 CST

是什么导致 Google Cloud Run 作业失败并出现错误“已终止”?

  • 5

我正在git clone我的 Google Cloud Run 作业中克隆多个存储库(使用 ),其中之一使 Google Cloud 通过 exit 1 杀死容器。请参阅日志:

    {
      insertId: "xxx",
      labels: {
        instanceId: "xxx"
        run.googleapis.com/execution_name: "xxx",
        run.googleapis.com/task_attempt: "0",
        run.googleapis.com/task_index: "0"
      },
      logName: "xxx/run.googleapis.com%2Fstderr",
      receiveTimestamp: "2024-03-13T09:05:28.686787232Z",
      resource: {
        labels: {
          job_name: "xxx",
          location: "xxx",
          project_id: "xxx"
        },
        type: "cloud_run_job"
      },
      textPayload: "Killed",
      timestamp: "2024-03-13T09:05:28.685133Z"
    }

克隆的存储库有 10.828 个文件,大小为 1.8 GB。内存和CPU使用率均未超过50%。它发生在 期间。git clone [email protected]:usr/bad_repo.git

我认为这与限制有关,但我没有找到任何东西。


重现步骤:

  1. 使用 Bash 脚本创建一个 Docker 容器,该脚本克隆存储库,如下所示:
git clone -q --depth 1 --no-tags --filter=blob:limit=100k [email protected]:supabase/supabase.git
  1. 将此 Docker 容器作为Cloud Run 作业运行
  2. 容器将退出,并由 Cloud Run 触发,状态代码为 1

所有日志:

在此输入图像描述

google-cloud-platform
  • 1 个回答
  • 47 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve