infiniflow/ragflow · error · Error

message.compileNotSupported

Error message

message.compileNotSupported

What it means

The validation Drive call returned HttpError 403. Unlike a generic scope problem, this branch indicates the Drive API itself refused the app: required scopes not granted to the token, Drive API/Drive apps disabled for the domain, or the service account not domain-wide-delegated. Mapped to InsufficientPermissionsError.

Source

Thrown at web/src/hooks/use-knowledge-request.ts:991

};

export const useRunArtifactIndex = (kind: string) => {
  const knowledgeBaseId = useKnowledgeBaseId();
  const queryClient = useQueryClient();

  const {
    data,
    isPending: loading,
    mutateAsync,
  } = useMutation({
    mutationKey: [KnowledgeApiAction.RunArtifactIndex],
    mutationFn: async () => {
      // Go/hybrid: wiki compilation is auto-driven by the scheduler; there is no
      // legacy RunIndex endpoint. Reject instead of reporting success so a wiki
      // update can't be mistaken for a real re-merge (the UI hides/disables the
      // update control — plan v4.1 §4.2).
      if (isGoDatasetBackend()) {
        throw new Error(i18n.t('message.compileNotSupported'));
      }
      const { data } = await runIndex(knowledgeBaseId, 'wiki');
      if (data?.code === 0) {
        message.success(i18n.t('message.operated'));
        queryClient.invalidateQueries({
          queryKey: ArtifactAlterationKeys.detail(knowledgeBaseId, kind),
        });
        queryClient.invalidateQueries({
          queryKey: ArtifactKeys.listByDataset(knowledgeBaseId),
        });
        queryClient.invalidateQueries({
          queryKey: ArtifactTopicKeys.listByDataset(knowledgeBaseId),
        });
        queryClient.invalidateQueries({
          queryKey: DatasetGenerateKeys.traceById(
            GenerateType.Artifact,
            knowledgeBaseId,
          ),

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Check GCP > APIs & Services > Library and enable the Google Drive API for the project
  2. Redo the OAuth flow with the full requested scope set so consent covers them (or set GOOGLE_OAUTH_SCOPE_OVERRIDE to scopes you are allowed to request)
  3. For Workspace: Admin console > Security > API controls > Domain-wide delegation — add the client ID with the Drive + Admin Directory scopes
  4. Verify Workspace hasn't blocked the app: Admin console > Apps > Drive apps / Access tokens

Example fix

# before: token only has drive.file scope → files().list 403
creds.scopes  # ['https://www.googleapis.com/auth/drive.file']

# after: mint token with the connector's required scope set
export GOOGLE_OAUTH_SCOPE_OVERRIDE="https://www.googleapis.com/auth/drive.readonly.metadata,https://www.googleapis.com/auth/admin.directory.user.readonly"
# then re-run the OAuth flow so consent includes both scopes
Defensive patterns

Strategy: try-catch

Validate before calling

REQUIRED_SCOPES = {
    "https://www.googleapis.com/auth/drive.readonly.metadata",
    "https://www.googleapis.com/auth/admin.directory.user.readonly",
}

def token_covers_required_scopes(creds) -> bool:
    return REQUIRED_SCOPES <= set(creds.scopes or [])

Try / catch

from common.data_source.exceptions import InsufficientPermissionsError

try:
    connector.validate_connector_settings()
except InsufficientPermissionsError as e:
    if "403" in str(e):
        run_admin_checklist(e)  # enable Drive API, domain-wide delegation, consent-screen scopes
        # then re-mint token and retry once
        connector.load_credentials(reissue_oauth_with_full_scopes())
        connector.validate_connector_settings()

Prevention

When it happens

Trigger: Token minted with fewer scopes than GOOGLE_SCOPES requires (e.g. missing drive.readonly.metadata or admin directory scope), Workspace admin has disabled Drive apps, or a service account without domain-wide delegation with admin impersonation (sub=user@domain).

Common situations: Scope list changed between app versions and old tokens lack new scopes, Workspace 'Restrict Google Drive' policy, GCP project's Drive API disabled, service account delegated at the wrong client ID.

Related errors


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/a0c5895b58140930. Report an issue: GitHub.