Skip to content

Google 云端硬盘触发器节点常见问题#

¥Google Drive Trigger node common issues

以下是 Google 云端硬盘触发器节点 的一些常见错误和问题,以及解决或故障排除步骤。

¥Here are some common errors and issues with the Google Drive Trigger node and steps to resolve or troubleshoot them.

401 未授权错误#

¥401 unauthorized error

完整的错误文本如下所示:

¥The full text of the error looks like this:

1
401 - {"error":"unauthorized_client","error_description":"Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."}

当你使用的凭据及其作用域或权限存在问题时,会发生此错误。

¥This error occurs when there's an issue with the credential you're using and its scopes or permissions.

解析:

¥To resolve:

  1. 对于 OAuth2 凭据,请确保你已在“API 和服务”>“库”中启用 Google Drive API。有关更多信息,请参阅 Google OAuth2 单服务 - 启用 API

¥For OAuth2 credentials, make sure you've enabled the Google Drive API in APIs & Services > Library. Refer to Google OAuth2 Single Service - Enable APIs for more information. 2. 服务帐号 凭证:

¥For Service Account credentials: 1. 启用域范围委托

1
  ¥[Enable domain-wide delegation](/integrations/builtin/credentials/google/service-account.md#enable-domain-wide-delegation).
  1. 确保将 Google Drive API 添加为域级委托配置的一部分。

    ¥Make sure you add the Google Drive API as part of the domain-wide delegation configuration.

处理多个文件更改#

¥Handling more than one file change

Google 云端硬盘触发器节点会按设定的时间间隔(默认每分钟一次)轮询 Google 云端硬盘的更改。

¥The Google Drive Trigger node polls Google Drive for changes at a set interval (once every minute by default).

如果在轮询间隔期间“监视”条件发生多次更改,则会触发一个包含这些更改项的 Google 云端硬盘触发事件。为了处理这种情况,你的工作流必须考虑到数据可能包含多个项目的情况。

¥If multiple changes to the Watch For criteria occur during the polling interval, a single Google Drive Trigger event occurs containing the changes as items. To handle this, your workflow must account for times when the data might contain more than one item.

你可以使用 if 节点切换节点 来根据 Google 云端硬盘触发器节点中的数据包含单个项目还是多个项目来更改工作流的行为。

¥You can use an if node or a switch node to change your workflow's behavior depending on whether the data from the Google Drive Trigger node contains a single item or multiple items.