{"record":{"id":"ca8e213d264d7dff","repo":"apache/seatunnel","slug":"query-collection-list-error","errorCode":"QUERY_COLLECTION_LIST_ERROR","errorMessage":"QUERY_COLLECTION_LIST_ERROR.getDescription()","messagePattern":"QUERY_COLLECTION_LIST_ERROR\\.getDescription\\(\\)","errorType":"error_code","errorClass":"TypesenseConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/client/TypesenseClient.java","lineNumber":168,"sourceCode":"            throw new TypesenseConnectorException(\n                    QUERY_COLLECTION_EXISTS_ERROR, QUERY_COLLECTION_EXISTS_ERROR.getDescription());\n        }\n        return false;\n    }\n\n    public List<String> collectionList() {\n        try {\n            Collections collections = tsClient.collections();\n            CollectionResponse[] collectionResponses = collections.retrieve();\n            List<String> list = new ArrayList<>();\n            for (CollectionResponse collectionRespons : collectionResponses) {\n                String collectionName = collectionRespons.getName();\n                list.add(collectionName);\n            }\n            return list;\n        } catch (Exception e) {\n            log.error(QUERY_COLLECTION_LIST_ERROR.getDescription());\n            throw new TypesenseConnectorException(\n                    QUERY_COLLECTION_LIST_ERROR, QUERY_COLLECTION_LIST_ERROR.getDescription());\n        }\n    }\n\n    public Map<String, String> getField(String collection) {\n        if (collectionExists(collection)) {\n            Map<String, String> fieldMap = new HashMap<>();\n            try {\n                CollectionResponse collectionResponse = tsClient.collections(collection).retrieve();\n                List<Field> fields = collectionResponse.getFields();\n                for (Field field : fields) {\n                    String fieldName = field.getName();\n                    String type = field.getType();\n                    fieldMap.put(fieldName, type);\n                }\n            } catch (Exception e) {\n                log.error(FIELD_TYPE_MAPPING_ERROR.getDescription());\n                throw new TypesenseConnectorException(","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-typesense/src/main/java/org/apache/seatunnel/connectors/seatunnel/typesense/client/TypesenseClient.java#L150-L186","documentation":"TypesenseClient.collectionList() fetches the list of collections from the Typesense server; any failure in that API call is converted to TypesenseConnectorException with the QUERY_COLLECTION_LIST_ERROR code, hiding the root cause.","triggerScenarios":"Calling collectionList() (e.g. during catalog table discovery) when the /collections endpoint returns an error: invalid API key, unreachable server, 5xx from Typesense, or malformed response deserialization.","commonSituations":"Catalog operations listing Typesense collections with wrong credentials; Typesense version upgrade changing the API response shape; proxy/firewall blocking the request.","solutions":["Test the /collections endpoint manually with the configured URL and API key","Confirm the typesense-java client version matches the server's API version","Check auth: the key must have permission to list collections","Rethrow with the cause attached to surface the actual API error"],"exampleFix":"// before\n} catch (Exception e) {\n    log.error(QUERY_COLLECTION_LIST_ERROR.getDescription());\n    throw new TypesenseConnectorException(QUERY_COLLECTION_LIST_ERROR, QUERY_COLLECTION_LIST_ERROR.getDescription());\n}\n// after\n} catch (Exception e) {\n    log.error(QUERY_COLLECTION_LIST_ERROR.getDescription(), e);\n    throw new TypesenseConnectorException(QUERY_COLLECTION_LIST_ERROR, QUERY_COLLECTION_LIST_ERROR.getDescription(), e);\n}","handlingStrategy":"retry","validationCode":"// sanity-check configuration before calling\nif (typesenseUrl == null || typesenseApiKey == null) {\n    throw new IllegalArgumentException(\"Typesense URL/API key must be configured\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    list = client.collectionList();\n} catch (TypesenseConnectorException e) {\n    // exponential backoff retry; abort after N attempts with cause context\n}","preventionTips":["Test /collections endpoint reachability before running the pipeline","Keep typesense-java client version aligned with server version","Use admin-capable API keys for listing operations"],"tags":["typesense","collection-list","api-error"],"backgroundTag":"http-error-response","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}