Google Drive Node: Service Accounts do not have storage quota

在 n8n(版本 2.8.3 / 2.9.1)中使用 Google Drive 节点,认证方式为 GCP 服务账号 JSON 密钥文件。用户将该服务账号添加为个人 Google Drive 中某个共享文件夹的“编辑者”,然后执行文件创建、复制或上传操作时触发此错误。节点操作包括 copy 、 cre

Google Drive Node: Service Accounts do not have storage quota

Google Drive Node: Service Accounts do not have storage quota

快速结论:此错误在使用 Google 服务账号(Service Account)通过 n8n 的 Google Drive 节点向个人 Google Drive 共享文件夹中创建、复制或上传文件时触发。优先排查是否使用了 OAuth2 凭证替代服务账号,或是否将文件操作目标切换为共享云端硬盘(Shared Drive)。

问题场景

在 n8n(版本 2.8.3 / 2.9.1)中使用 Google Drive 节点,认证方式为 GCP 服务账号 JSON 密钥文件。用户将该服务账号添加为个人 Google Drive 中某个共享文件夹的“编辑者”,然后执行文件创建、复制或上传操作时触发此错误。节点操作包括 copycreateupload 等。

报错原文

{
  "errorMessage": "Forbidden - perhaps check your credentials?",
  "errorDescription": "Service Accounts do not have storage quota. Leverage shared drives (https://developers.google.com/workspace/drive/api/guides/about-shareddrives), or use OAuth delegation (http://support.google.com/a/answer/7281227) instead.",
  "errorDetails": {
    "rawErrorMessage": [
      "Request failed with status code 403"
    ],
    "httpCode": "403",
    "errorData": {
      "error": {
        "code": 403,
        "message": "Service Accounts do not have storage quota. Leverage shared drives (https://developers.google.com/workspace/drive/api/guides/about-shareddrives), or use OAuth delegation (http://support.google.com/a/answer/7281227) instead.",
        "errors": [
          {
            "message": "Service Accounts do not have storage quota. Leverage shared drives (https://developers.google.com/workspace/drive/api/guides/about-shareddrives), or use OAuth delegation (http://support.google.com/a/answer/7281227) instead.",
            "domain": "usageLimits",
            "reason": "storageQuotaExceeded"
          }
        ]
      }
    }
  }
}

原因分析

这是 Google Drive API 的硬性限制,非 n8n 的 Bug。服务账号(Service Account)没有存储配额,无法拥有文件。当服务账号在个人“我的云端硬盘”(My Drive)中创建文件时,它成为该文件的拥有者,但服务账号本身没有配额,因此操作被拒绝。即使服务账号被授予了共享文件夹的编辑权限,它仍然无法在个人 Drive 内创建新文件。该约束已在 Google Drive API 官方文档中明确说明。

环境排查

  • n8n 版本:2.8.3、2.9.1(自托管)
  • Node.js 版本:24.0.0(在重现环境中所用)
  • 数据库:SQLite(默认)
  • 执行模式:main(默认)
  • 托管方式:Docker
  • 操作系统:Windows(在重现环境中所用)
  • Google Drive 节点版本:3
  • 二进制数据模式:filesystem

解决步骤

  1. 使用 OAuth2 凭证替代服务账号(可优先尝试)
    这是最简单的修复方式,且适用于个人 @gmail.com 账号。在 n8n 中创建 Google Drive OAuth2 凭证进行认证,这样文件归你所有,不存在配额问题。
  2. 使用真实的共享云端硬盘(Shared Drive)
    文件由组织拥有而非个人用户,服务账号可以在其中创建文件。但此方案需要付费的 Google Workspace 套餐。
  3. 使用域范围授权(Domain-wide Delegation)
    让服务账号模拟一个有配额的真实用户来执行操作。n8n 支持在 Google 服务账号凭证中启用“Impersonate a User”开关。但需要付费的 Google Workspace 套餐 + 管理员配置,且只能模拟同一域名内</strong的用户。详细配置可参考 Google 服务账号委托文档

验证方法

完成上述任一解决方案后,重新执行之前失败的 Google Drive 节点操作(如复制、创建或上传文件)。确认操作成功执行,且不再收到 403 报错。同时可在 Google Drive 目标文件夹中验证文件是否已正确创建。

参考来源

n8n-io/n8n #26050

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

celebrityanime
celebrityanime
文章: 11309

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注