{"record":{"id":"35552f897be8de0b","repo":"infiniflow/ragflow","slug":"message-compilenotsupported","errorCode":null,"errorMessage":"message.compileNotSupported","messagePattern":"message\\.compileNotSupported","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"web/src/hooks/use-dataset-generate.ts","lineNumber":205,"sourceCode":"  const queryClient = useQueryClient();\n  const { id } = useParams();\n  const { handleUnbindTask } = useUnBindTask();\n  const { t } = useTranslation();\n\n  const {\n    data,\n    isPending: loading,\n    mutateAsync,\n  } = useMutation({\n    mutationKey: [DatasetKey.generate],\n    mutationFn: async ({ type }: { type: GenerateType }) => {\n      // Go/hybrid: dataset compilation is driven automatically by the scheduler\n      // on document completion; there is no manual RunIndex trigger, so a manual\n      // \"generate\" must NOT pretend to succeed. The UI hides/disables the\n      // control; if it is ever invoked, reject loudly so callers don't mistake\n      // it for a real run (plan v4.1 §4.2).\n      if (isGoDatasetBackend()) {\n        throw new Error(t('message.compileNotSupported'));\n      }\n      const { data } = await runIndex(id!, TraceTypeMap[type]);\n      if (data.code === 0) {\n        message.success(t('message.operated'));\n        queryClient.invalidateQueries({\n          queryKey: DatasetGenerateKeys.traceById(type, id),\n        });\n      }\n      return data;\n    },\n  });\n\n  const { mutateAsync: pauseGenerate } = useMutation({\n    mutationKey: [DatasetKey.pauseGenerate],\n    mutationFn: async ({\n      task_id,\n      type,\n    }: {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/web/src/hooks/use-dataset-generate.ts#L187-L223","documentation":"After creds exist, validation requires a primary admin email for delegated Drive API calls; _primary_admin_email is only set inside load_credentials from the credential JSON. None here means creds were loaded through a path that skipped that assignment (or load_credentials never ran to completion).","triggerScenarios":"load_credentials() raised before assigning _primary_admin_email (missing key → ValueError) but a partial state persisted, custom code assigning _creds manually, or a credentials payload where the key mapped to None.","commonSituations":"Custom tests monkey-patching _creds, subclasses overriding load_credentials without setting the admin email, credential dicts built with null values.","solutions":["Re-run the full load_credentials() with a payload containing the primary admin key (see error 627)","If subclassing or patching, set both _creds and _primary_admin_email","Validate the credential JSON shape before handing it to the connector"],"exampleFix":"# before (test hack)\nconnector._creds = mocked_creds\nconnector.validate_connector_settings()  # boom: admin email None\n\n# after\nconnector.load_credentials({**token_payload, \"primary_admin_email\": \"admin@acme.com\"})\nconnector.validate_connector_settings()","handlingStrategy":"validation","validationCode":"def admin_email_loaded(connector) -> bool:\n    return connector._primary_admin_email is not None","typeGuard":null,"tryCatchPattern":"from common.data_source.exceptions import ConnectorValidationError\n\ntry:\n    connector.validate_connector_settings()\nexcept ConnectorValidationError as e:\n    if \"primary_admin_email\" in str(e).lower() or \"DB_CREDENTIALS_PRIMARY_ADMIN_KEY\" in str(e):\n        connector.load_credentials({**raw_creds, \"primary_admin_email\": fetch_admin_email()})\n        connector.validate_connector_settings()","preventionTips":["Don't monkey-patch _creds in tests; go through load_credentials","Assert both _creds and _primary_admin_email in custom subclasses after load","Lint credential payloads for null values before use"],"tags":["google-drive","credentials","validation","configuration"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}