{"record":{"id":"7fe6653d8cb79bb3","repo":"infiniflow/ragflow","slug":"invalid-or-expired-gitlab-credentials","errorCode":null,"errorMessage":"Invalid or expired GitLab credentials.","messagePattern":"Invalid or expired GitLab credentials\\.","errorType":"validation","errorClass":"CredentialExpiredError","httpStatus":null,"severity":"error","filePath":"common/data_source/gitlab_connector.py","lineNumber":195,"sourceCode":"        self.gitlab_client: gitlab.Gitlab | None = None\n\n    def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:\n        self.gitlab_client = gitlab.Gitlab(credentials[\"gitlab_url\"], private_token=credentials[\"gitlab_access_token\"])\n        return None\n\n    def validate_connector_settings(self) -> None:\n        if self.gitlab_client is None:\n            raise ConnectorMissingCredentialError(\"GitLab\")\n\n        try:\n            self.gitlab_client.auth()\n            self.gitlab_client.projects.get(\n                f\"{self.project_owner}/{self.project_name}\",\n                lazy=True,\n            )\n\n        except gitlab.exceptions.GitlabAuthenticationError as e:\n            raise CredentialExpiredError(\"Invalid or expired GitLab credentials.\") from e\n\n        except gitlab.exceptions.GitlabAuthorizationError as e:\n            raise InsufficientPermissionsError(\"Insufficient permissions to access GitLab resources.\") from e\n\n        except gitlab.exceptions.GitlabGetError as e:\n            raise ConnectorValidationError(\"GitLab project not found or not accessible.\") from e\n\n        except Exception as e:\n            raise UnexpectedValidationError(f\"Unexpected error while validating GitLab settings: {e}\") from e\n\n    def _fetch_from_gitlab(self, start: datetime | None = None, end: datetime | None = None) -> GenerateDocumentsOutput:\n        if self.gitlab_client is None:\n            raise ConnectorMissingCredentialError(\"Gitlab\")\n        project: Project = self.gitlab_client.projects.get(f\"{self.project_owner}/{self.project_name}\")\n\n        start_utc = start.astimezone(timezone.utc) if start else None\n        end_utc = end.astimezone(timezone.utc) if end else None\n","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/gitlab_connector.py#L177-L213","documentation":"Error \"Invalid or expired GitLab credentials.\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at common/data_source/gitlab_connector.py:195 when the library encounters an invalid state.","commonSituations":"The GitLab personal access token is expired or revoked; refreshing the credential prevents this error.","solutions":["Regenerate the GitLab access token and update the connector credentials.","Verify the token has not expired and has api/read_api scope."],"exampleFix":"# GitLab: Settings > Access Tokens > create token with read_api scope","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}