Google 云端硬盘节点常见问题(Google Drive node common issues)#
这里是一些使用 Google Drive 节点 时常见的错误和问题,以及解决或排查这些问题的步骤。
🌐 Here are some common errors and issues with the Google Drive node and steps to resolve or troubleshoot them.
Google 尚未验证此信息应用(Google hasn't verified this app)#
If using the OAuth authentication method, you might see the warning Google hasn't verified this app. To avoid this:
- If your app User Type is Internal, create OAuth credentials from the same account you want to authenticate.
- If your app User Type is External, you can add your email to the list of testers for the app: go to the Audience page and add the email you're signing in with to the list of Test users.
If you need to use credentials generated by another account (by a developer or another third party), follow the instructions in Google Cloud documentation | Authorization errors: Google hasn't verified this app.
Google Cloud 应用未授权(Google Cloud app becoming unauthorized)#
For Google Cloud apps with Publishing status set to Testing and User type set to External, consent and tokens expire after seven days. Refer to Google Cloud Platform Console Help | Setting up your OAuth consent screen for more information. To resolve this, reconnect the app in the n8n credentials modal.
Google 云端硬盘 OAuth 错误(Google Drive OAuth error)#
如果使用 OAuth 身份验证方法,你可能会看到一条错误信息,提示你无法登录,因为该应用不符合 Google 的安全要求。
🌐 If using the OAuth authentication method, you may see an error indicating that you can't sign in because the app doesn't meet Google's expectations for keeping apps secure.
最常见的情况是,该问题的实际原因是 Google 的 OAuth 配置与 n8n 之间的 URL 不匹配。为避免这种情况,首先查看 Google 错误信息中包含的任何链接。这些链接将包含有关发生的具体错误的详细信息。
🌐 Most often, the actual cause of this issue is that the URLs don't match between Google's OAuth configuration and n8n. To avoid this, start by reviewing any links included in Google's error message. This will contain details about the exact error that occurred.
如果你正在自托管 n8n,请检查用于构建外部 URL 的 n8n 配置项。验证 N8N_EDITOR_BASE_URL 和 WEBHOOK_URL 环境变量是否使用完整的域名。
🌐 If you are self-hostin n8n, check the n8n configuration items used to construct external URLs. Verify that the N8N_EDITOR_BASE_URL and WEBHOOK_URL environment variables use fully qualified domains.
从 Google 云端硬盘获取最近文件(Get recent files from Google Drive)#
要从 Google 云端硬盘中检索最近的文件,你需要按修改时间对文件进行排序。为此,你需要搜索现有文件并获取它们的修改时间。接下来,你可以对文件进行排序,以找到最新的文件,并使用另一个 Google 云端硬盘节点通过 ID 定位该文件。
🌐 To retrieve recent files from Google Drive, you need to sort files by modification time. To do this, you need to search for existing files and retrieve their modification times. Next you can sort the files to find the most recent file and use another Google Drive node target the file by ID.
流程如下所示:
🌐 The process looks like this:
- 在画布上添加一个 Google 云端硬盘 节点。
- 选择 文件/文件夹 资源和 搜索 操作。
- 启用 返回全部 以浏览所有文件。
- 将 搜索内容 过滤器设置为 文件。
- 在选项中,将字段设置为全部。
- 将 Sort 节点连接到 Google Drive 节点的输出。
- 选择 简单 排序类型。
- 在“按字段排序”部分,将“modifiedTime”输入为字段名称。
- 选择 降序 排序。10. 在 Sort 节点的输出端添加一个 Limit 节点。11. 将 最大项 设置为 1 以保留最近的文件。12. 将另一个 Google Drive 节点连接到 Limit 节点的输出端。13. 选择 文件 作为 资源 并选择你想要的操作。14. 在 文件 选择中,选择 按 ID。15. 选择 表达式 并输入
{{ $json.id }}作为表达式。
Workflow preview placeholder.