From 41ca33d8fdd44513232f865856662b2aba585b32 Mon Sep 17 00:00:00 2001 From: livdebus Date: Mon, 16 Nov 2026 15:20:27 +0100 Subject: [PATCH] Fix connector lookup on Onyx 5.0 (paginated indexing-status) Onyx 5.0 paginated /admin/connector/indexing-status to 10 connectors per source per page (default page 1). find_cc_pair_id_by_name read only the first page, so with >10 connectors in a source it missed the existing AIDO SMB connector and provisioning then failed with "Connector by this name already exists, duplicate naming not allowed." Request every connector via the new get_all_connectors flag so the lookup is reliable regardless of connector count. Verified against the v5.0 source and a live v5.0 instance. --- app/onyx_client.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/onyx_client.py b/app/onyx_client.py index 4ba5b88..356d7ed 100644 --- a/app/onyx_client.py +++ b/app/onyx_client.py @@ -133,10 +133,17 @@ class OnyxClient: # -- idempotent connector provisioning ----------------------------------- def find_cc_pair_id_by_name(self, name: str) -> int | None: """Look up an existing connector/credential pair by name so provisioning is - idempotent even if the local state (cached id) was lost.""" + idempotent even if the local state (cached id) was lost. + + Onyx 5.0 paginates this endpoint (10 connectors per source per page) and + defaults to page 1, so without ``get_all_connectors`` a connector beyond + the first page is invisible — the lookup would miss it and provisioning + would then fail with "duplicate naming not allowed". Request every + connector so the match is reliable regardless of how many exist.""" resp = self._request( "POST", "/manage/admin/connector/indexing-status", - json={"secondary_index": False}, auth=self._admin_auth, + json={"secondary_index": False, "get_all_connectors": True}, + auth=self._admin_auth, ) if resp.status_code >= 400: return None @@ -237,4 +244,4 @@ class OnyxClient: def _admin_auth(self) -> tuple[str, str] | None: if self._admin_email and self._admin_password: return (self._admin_email, self._admin_password) - return None + return None \ No newline at end of file