{"record":{"id":"c331fe9a75efd353","repo":"infiniflow/ragflow","slug":"failed-to-create-memory","errorCode":null,"errorMessage":"Failed to create memory","messagePattern":"Failed to create memory","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"web/src/pages/memories/hooks.ts","lineNumber":40,"sourceCode":"import {\n  CreateMemoryResponse,\n  DeleteMemoryProps,\n  DeleteMemoryResponse,\n  ICreateMemoryProps,\n  IMemory,\n  IMemoryAppDetailProps,\n  MemoryDetailResponse,\n  MemoryListResponse,\n} from './interface';\n\nexport const useCreateMemory = () => {\n  const { t } = useTranslation();\n\n  const createMemory = useCallback(\n    async (props: ICreateMemoryProps): Promise<CreateMemoryResponse> => {\n      const { data: response } = await memoryService.createMemory(props);\n      if (response.code !== 0) {\n        throw new Error(response.message || 'Failed to create memory');\n      }\n      if (response.code === 0) {\n        message.success(t('message.created'));\n      }\n      return response.data;\n    },\n    [t],\n  );\n\n  return { createMemory };\n};\n\nexport const useFetchMemoryList = () => {\n  const { handleInputChange, searchString, pagination, setPagination } =\n    useHandleSearchChange();\n  const { filterValue, handleFilterSubmit } = useHandleFilterSubmit();\n  const debouncedSearchString = useDebounce(searchString, { wait: 500 });\n","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/web/src/pages/memories/hooks.ts#L22-L58","documentation":"HttpError from the validation call with any status other than 401/403 (400, 404, 429, 5xx…). Message interpolates the status and the raw Google error body, so the embedded text identifies the exact API problem. Wrapped as ConnectorValidationError.","triggerScenarios":"Drive files().list returning 400 (malformed query), 429 quota/rate limit, 500/503 transient Google outages, or the service-account follow-up get_root_folder_id call failing on a shared drive without accessible root.","commonSituations":"Project over quota or rate-limited during bulk validation sweeps, Google API transient 503s, using an API version retired client-side, shared-drive-only service accounts whose My-Drive root is inaccessible.","solutions":["Read the embedded status+body: 429 → back off and retry validation later; 5xx → retry after a short delay","For quota errors, raise per-user rate limits in GCP or spread validation across time","Confirm the credential is not a shared-drive-only service account if get_root_folder_id is the failing call","If persistent, capture the raw HttpError with e.resp and inspect reason in the JSON body"],"exampleFix":"# before: single validation attempt on a 429/503\nvalidate_connector_settings()  # ConnectorValidationError(status=429)\n\n# after: retry with backoff on transient statuses\nimport time\nfor attempt in range(3):\n    try:\n        connector.validate_connector_settings()\n        break\n    except ConnectorValidationError as e:\n        if 'status=429' not in str(e) and 'status=5' not in str(e):\n            raise\n        time.sleep(2 ** attempt)","handlingStrategy":"retry","validationCode":"TRANSIENT = {429, 500, 503}\n\ndef is_transient(status: int | None) -> bool:\n    return status in TRANSIENT","typeGuard":null,"tryCatchPattern":"import time\nfrom common.data_source.exceptions import ConnectorValidationError\n\nlast = None\nfor attempt in range(4):\n    try:\n        connector.validate_connector_settings()\n        break\n    except ConnectorValidationError as e:\n        last = e\n        if not any(f\"status={s}\" in str(e) for s in TRANSIENT):\n            raise\n        time.sleep(2 ** attempt)\nelse:\n    raise last","preventionTips":["Wrap validation in exponential backoff keyed on the interpolated status","Watch GCP quota dashboards when many connectors validate simultaneously","Alert on repeated 429/5xx so quota increases happen before hard failures"],"tags":["google-drive","api-error","quota","transient","http-error"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}