can you explain the difference between syncronius ...
# ask-ai
h
can you explain the difference between syncronius and asyncronius request types while creating custom builders?
k
Certainly! In Airbyte's Connector Builder UI, you can create two types of streams: Synchronous Request and Asynchronous Job. Here’s how they differ: ### Synchronous Streams - How they work: The connector sends a request to an API endpoint and receives the data immediately in the response. The connector then processes and returns this data in the same operation. - When to use: This is the standard approach for most APIs that can return data instantly, without any waiting or background processing. - Example use case: Fetching a list of users from an API where the response is immediate. ### Asynchronous Streams - How they work: Data extraction happens in multiple steps: 1. Creation: You send a request to start a job (e.g., to generate a report). 2. Polling: You periodically check the job status to see if it’s complete. 3. Download: Once the job is finished, you download the results. - When to use: This is necessary for APIs that process large datasets or require significant server-side computation, making it impossible to return data in a single, immediate response. - Example use case: Exporting a large set of contacts from SendGrid, where you must first request the export, wait for processing, and then download the result once ready. Summary Table: | Type | Request/Response Pattern | Use Case Example | |--------------|---------------------------------|-----------------------------------------| | Synchronous | Single request, immediate data | Fetching a list of users | | Asynchronous | Multi-step: create, poll, fetch | Exporting large reports or data exports | Use asynchronous streams when the API requires job creation and waiting, or when handling large or complex data operations. Use synchronous streams for simple, immediate data retrieval scenarios. For more details, see the official documentation: [Asynchronous Job streams](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams)
h
@kapa.ai can you convert my syncronyus yml to async type?
k
A message from kapa.ai
To convert a synchronous YAML configuration to an asynchronous type in Airbyte, you need to change the retriever type from a standard (synchronous) retriever to an
AsyncRetriever
and configure the required components for asynchronous jobs. This involves specifying how to create the job, poll for its status, extract the download URL, and finally download the results. Key steps and fields to update: 1. Change the retriever type to
AsyncRetriever
.
2. Add or update the following fields: - `creation_requester`: How to create the async job. - `polling_requester`: How to poll for job status. - `status_extractor`: How to extract the job status from the polling response. - `status_mapping`: Map API-specific status values to Airbyte statuses. - `download_target_extractor`: How to extract the download URL or identifier. - `download_extractor`: How to extract records from the downloaded data. - `polling_job_timeout`: (Optional) Timeout for the async job. Example structure for an async retriever (YAML):
Copy code
yaml retriever:   type: AsyncRetriever   creation_requester:     # Configuration for job creation request (e.g., POST endpoint, headers, body)   polling_requester:     # Configuration for polling request (e.g., GET endpoint, headers)   status_extractor:     # Path to extract status from polling response   status_mapping:     completed: [ready]     failed: [failed]     running: [pending]     timeout: [timeout]   download_target_extractor:     # Path to extract download URL from polling response   download_extractor:     # How to extract records from the downloaded file/response   polling_job_timeout: 30 # (in minutes, example)   record_selector:     # How to extract records from the final data
You will need to fill in the details for each section based on your API's requirements and your current synchronous YAML. Note: If you provide your current synchronous YAML, I can help you convert it to the asynchronous format with more specific details. For more information, see the [AsyncRetriever YAML reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever) and [Asynchronous Job streams documentation](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream).
h
@kapa.ai version: 6.48.15 type: DeclarativeSource check: type: CheckStream stream_names: - indicator_values definitions: streams: indicator_values: type: DeclarativeStream name: indicator_values retriever: type: SimpleRetriever decoder: type: JsonDecoder requester: $ref: "#/definitions/base_requester" path: https://***.*.gov.et/api/analytics http_method: GET request_parameters: dimension: >- dx:{{ stream_partition['dx'] }},pe201701;201702;201703;201704,ou{{ stream_partition['ou'] }} record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: [] partition_router: - type: ListPartitionRouter values: - wqURG81DbhS - TQZa6RHFdsh cursor_field: ou - type: ListPartitionRouter values: - EM02m2HPZG6 - PePmfAnKV3c cursor_field: dx - type: ListPartitionRouter values: - 201701;201702;201703 - 201704;201705;201706 - 201707;201708;201709 - 201710;201711;201712 cursor_field: pe schema_loader: type: InlineSchemaLoader schema: $ref: "#/schemas/indicator_values" base_requester: type: HttpRequester url_base: https://***.*.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator password: "{{ config[\"password_2\"] }}" username: "{{ config[\"username_2\"] }}" streams: - $ref: "#/definitions/streams/indicator_values" spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - username_2 properties: password_2: type: string order: 1 title: Password always_show: true airbyte_secret: true username_2: type: string order: 0 title: Username additionalProperties: true metadata: assist: {} testedStreams: indicator_values: hasRecords: true streamHash: 15240667d4046e618331bb9c66b1c935e3248e21 hasResponse: true primaryKeysAreUnique: true primaryKeysArePresent: true responsesAreSuccessful: true autoImportSchema: indicator_values: false schemas: indicator_values: type: object properties: dx: type: string description: Indicator ID ou: type: string description: Org Unit ID pe: type: string description: Period (YYYYMM) value: type: string description: Indicator Value additionalProperties: true please conver this to async request type
k
A message from kapa.ai
To convert your synchronous YAML (using
SimpleRetriever
) to an asynchronous request type (using
AsyncRetriever
), you need to replace the
SimpleRetriever
with
AsyncRetriever
and define the required async job components:
creation_requester
,
polling_requester
,
status_extractor
,
status_mapping
,
download_target_extractor
, and
download_extractor
. Below is a template for how your YAML would look after conversion. You must fill in the details for your specific API (such as endpoints, status fields, and download logic), as these are not provided in your original YAML and the knowledge sources do not provide a one-size-fits-all mapping.
Copy code
yaml version: 6.48.15  type: DeclarativeSource  check:   type: CheckStream   stream_names:     - indicator_values  definitions:   streams:     indicator_values:       type: DeclarativeStream       name: indicator_values       retriever:         type: AsyncRetriever         creation_requester:           $ref: "#/definitions/base_requester"           path: https://***.***.gov.et/api/analytics/job # <-- Replace with your job creation endpoint           http_method: POST           request_body_json:             dimension: "dx:{{ stream_partition['dx'] }},pe:201701;201702;201703;201704,ou:{{ stream_partition['ou'] }}"         polling_requester:           $ref: "#/definitions/base_requester"           path: https://***.***.gov.et/api/analytics/job/{{ job_id }} # <-- Replace with your job status endpoint           http_method: GET         status_extractor:           type: DpathExtractor           field_path: ["status"] # <-- Replace with the actual path to the status field in the polling response         status_mapping:           completed: ["completed", "ready"] # <-- Replace with your API's completed status values           failed: ["failed", "error"]           running: ["pending", "processing"]         download_target_extractor:           type: DpathExtractor           field_path: ["result", "download_url"] # <-- Replace with the actual path to the download URL         download_extractor:           type: RecordSelector           extractor:             type: DpathExtractor             field_path: [] # <-- Adjust as needed for your download response         polling_job_timeout: 30 # (optional, in minutes)         record_selector:           type: RecordSelector           extractor:             type: DpathExtractor             field_path: []         partition_router:           - type: ListPartitionRouter             values:               - wqURG81DbhS               - TQZa6RHFdsh             cursor_field: ou           - type: ListPartitionRouter             values:               - EM02m2HPZG6               - PePmfAnKV3c             cursor_field: dx           - type: ListPartitionRouter             values:               - 201701;201702;201703               - 201704;201705;201706               - 201707;201708;201709               - 201710;201711;201712             cursor_field: pe       schema_loader:         type: InlineSchemaLoader         schema:           $ref: "#/schemas/indicator_values"   base_requester:     type: HttpRequester     url_base: https://***.***.gov.et/api/analytics     authenticator:       type: BasicHttpAuthenticator       password: "{{ config[\"password_2\"] }}"       username: "{{ config[\"username_2\"] }}"  streams:   - $ref: "#/definitions/streams/indicator_values"  spec:   type: Spec   connection_specification:     type: object     $schema: http://json-schema.org/draft-07/schema#     required:       - username_2     properties:       password_2:         type: string         order: 1         title: Password         always_show: true         airbyte_secret: true       username_2:         type: string         order: 0         title: Username     additionalProperties: true  metadata:   assist: {}   testedStreams:     indicator_values:       hasRecords: true       streamHash: 15240667d4046e618331bb9c66b1c935e3248e21       hasResponse: true       primaryKeysAreUnique: true       primaryKeysArePresent: true       responsesAreSuccessful: true   autoImportSchema:     indicator_values: false  schemas:   indicator_values:     type: object     properties:       dx:         type: string         description: Indicator ID       ou:         type: string         description: Org Unit ID       pe:         type: string         description: Period (YYYYMM)       value:         type: string         description: Indicator Value     additionalProperties: true
Important notes: - The actual field paths, endpoints, and status values must be adapted to your API's async job model. - The knowledge sources provide the structure and required fields for
AsyncRetriever
, but do not provide your API's specific async job details, so placeholders are used above. - For more details, see the [AsyncRetriever YAML reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever) and [Async streams documentation](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream). If you provide the specifics of your API's async job flow, I can help you further refine this template.
h
@kapa.ai version: 6.48.15 type: DeclarativeSource check: type: CheckStream stream_names: - indicator_values definitions: streams: indicator_values: type: DeclarativeStream name: indicator_values retriever: type: AsyncRetriever record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: [] status_mapping: completed: - Completed failed: - Failed running: - Running timeout: - Timeout status_extractor: type: DpathExtractor field_path: [] download_target_extractor: type: DpathExtractor field_path: [] partition_router: - type: ListPartitionRouter values: - wqURG81DbhS - TQZa6RHFdsh cursor_field: ou - type: ListPartitionRouter values: - EM02m2HPZG6 - PePmfAnKV3c cursor_field: dx - type: ListPartitionRouter values: - 201710;201709 cursor_field: pe decoder: type: JsonDecoder creation_requester: type: HttpRequester url_base: https://***.*.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator username: "{{ config[\"username\"] }}" password: "{{ config[\"password\"] }}" http_method: GET polling_requester: type: HttpRequester url_base: https://***.*.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator username: "{{ config[\"username\"] }}" password: "{{ config[\"password\"] }}" http_method: GET polling_job_timeout: 10 download_requester: type: HttpRequester url_base: https://dhisanalytics.moh.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator username: "{{ config[\"username\"] }}" password: "{{ config[\"password\"] }}" http_method: GET download_decoder: type: JsonDecoder schema_loader: type: InlineSchemaLoader schema: $ref: "#/schemas/indicator_values" base_requester: type: HttpRequester url_base: https://dhisanalytics.moh.gov.et/api/analytics streams: - $ref: "#/definitions/streams/indicator_values" spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - username properties: username: type: string title: Username order: 0 password: type: string title: Password always_show: true airbyte_secret: true order: 1 additionalProperties: true metadata: autoImportSchema: indicator_values: true testedStreams: indicator_values: streamHash: 851540ce5fa08a401c848d0cb5018bb61aa9377c hasResponse: false responsesAreSuccessful: false hasRecords: false primaryKeysArePresent: false primaryKeysAreUnique: false assist: {} schemas: indicator_values: type: object $schema: http://json-schema.org/draft-07/schema# additionalProperties: true properties: {} can you look at the above yml file its not working
k
A message from kapa.ai
Your YAML configuration for the async stream is missing several required details and has some placeholders or empty fields that are likely causing it not to work. Here are the main issues based on Airbyte's documentation: ### 1. Empty
field_path
Values
- The
status_extractor
,
download_target_extractor
, and
record_selector
all have
field_path: []
. These should point to the actual fields in your API responses where the job status, download URL, and records are found. If these are empty, Airbyte cannot extract the necessary information to proceed through the async job stages [[AsyncRetriever YAML Reference]](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever). ### 2. Missing or Incorrect Endpoints - The
creation_requester
,
polling_requester
, and
download_requester
all use the same or similar URLs and HTTP methods (
GET
). In a typical async job flow: -
creation_requester
should point to the endpoint that starts the async job (often a
POST
). -
polling_requester
should point to the endpoint that checks the job status (often a
GET
with a job ID). -
download_requester
should point to the endpoint that downloads the results (often a
GET
with a download URL or job ID). - If your API does not follow this pattern, you must adjust accordingly, but using the same endpoint and method for all three is rarely correct [[Configuring an Asynchronous Stream]](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream). ### 3. Status Mapping and Extractors - The
status_mapping
values (
Completed
,
Failed
,
Running
,
Timeout
) must match the actual status values returned by your API. If your API returns different status strings, you need to update these accordingly [[Polling Tab]](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/async-streams#polling-tab). ### 4. Partition Router - Your partition router appears correct if you intend to partition by
ou
,
dx
, and
pe
, but ensure these fields are actually used in your API requests. ### 5. Schema - Your schema for
indicator_values
is empty. If you expect to extract records, you should define the expected properties. --- ## How to Fix 1. Update the
field_path
for all extractors
to match your API's response structure. 2. Ensure each requester points to the correct endpoint and uses the correct HTTP method. 3. Set the correct status values in
status_mapping
. 4. Define the schema for your records. ### Example (with placeholders to fill in):
Copy code
yaml status_extractor:   type: DpathExtractor   field_path: ["status"]  # <-- Replace with actual path  download_target_extractor:   type: DpathExtractor   field_path: ["result", "download_url"]  # <-- Replace with actual path  record_selector:   type: RecordSelector   extractor:     type: DpathExtractor     field_path: ["data"]  # <-- Replace with actual path  status_mapping:   completed: ["ready"]  # <-- Replace with actual status values   failed: ["failed"]   running: ["pending"]   timeout: ["timeout"]
You must check your API documentation or sample responses to fill in the correct field paths and status values. --- If you provide a sample of your API's async job responses (creation, polling, and download), I can help you fill in the exact values. Otherwise, please review your API's documentation and update the YAML accordingly. For more guidance, see the official docs: - [AsyncRetriever YAML Reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever) - [Configuring an Asynchronous Stream](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream)
h
@kapa.ai plese send me the whole updated yml file
k
A message from kapa.ai
I'm sorry, but I cannot provide a fully working YAML file without knowing the exact structure of your API's asynchronous job responses. The knowledge sources and your provided YAML do not contain enough information about: - The actual endpoints and HTTP methods for job creation, polling, and downloading. - The structure of the API responses (i.e., where to extract the job status, download URL, and records). - The exact status values your API returns. To create a working async YAML, you must: 1. Inspect your API's responses for job creation, polling, and download. 2. Fill in the correct
field_path
values for
status_extractor
,
download_target_extractor
, and
record_selector
. 3. Set the correct
status_mapping
values to match your API. Here is a template you can use, but you must fill in the placeholders (
<-- FILL THIS IN
) with the correct values from your API:
Copy code
yaml version: 6.48.15  type: DeclarativeSource  check:   type: CheckStream   stream_names:     - indicator_values  definitions:   streams:     indicator_values:       type: DeclarativeStream       name: indicator_values       retriever:         type: AsyncRetriever         record_selector:           type: RecordSelector           extractor:             type: DpathExtractor             field_path: [data] # <-- FILL THIS IN with the path to your records in the download response         status_mapping:           completed:             - ready # <-- FILL THIS IN with your API's completed status value(s)           failed:             - failed # <-- FILL THIS IN           running:             - pending # <-- FILL THIS IN           timeout:             - timeout # <-- FILL THIS IN         status_extractor:           type: DpathExtractor           field_path: [status] # <-- FILL THIS IN with the path to the status field in the polling response         download_target_extractor:           type: DpathExtractor           field_path: [result, download_url] # <-- FILL THIS IN with the path to the download URL in the polling response         partition_router:           - type: ListPartitionRouter             values:               - wqURG81DbhS               - TQZa6RHFdsh             cursor_field: ou           - type: ListPartitionRouter             values:               - EM02m2HPZG6               - PePmfAnKV3c             cursor_field: dx           - type: ListPartitionRouter             values:               - 201710;201709             cursor_field: pe         decoder:           type: JsonDecoder         creation_requester:           type: HttpRequester           url_base: https://***.***.gov.et/api/analytics # <-- FILL THIS IN with your job creation endpoint           authenticator:             type: BasicHttpAuthenticator             username: "{{ config[\"username\"] }}"             password: "{{ config[\"password\"] }}"           http_method: POST # <-- FILL THIS IN if your API uses POST for job creation         polling_requester:           type: HttpRequester           url_base: https://***.***.gov.et/api/analytics # <-- FILL THIS IN with your polling endpoint           authenticator:             type: BasicHttpAuthenticator             username: "{{ config[\"username\"] }}"             password: "{{ config[\"password\"] }}"           http_method: GET         polling_job_timeout: 10         download_requester:           type: HttpRequester           url_base: https://***.***.gov.et/api/analytics # <-- FILL THIS IN with your download endpoint           authenticator:             type: BasicHttpAuthenticator             username: "{{ config[\"username\"] }}"             password: "{{ config[\"password\"] }}"           http_method: GET         download_decoder:           type: JsonDecoder       schema_loader:         type: InlineSchemaLoader         schema:           $ref: "#/schemas/indicator_values"   base_requester:     type: HttpRequester     url_base: https://***.***.gov.et/api/analytics  streams:   - $ref: "#/definitions/streams/indicator_values"  spec:   type: Spec   connection_specification:     type: object     $schema: http://json-schema.org/draft-07/schema#     required:       - username     properties:       username:         type: string         title: Username         order: 0       password:         type: string         title: Password         always_show: true         airbyte_secret: true         order: 1     additionalProperties: true  metadata:   autoImportSchema:     indicator_values: true   testedStreams:     indicator_values:       streamHash: 851540ce5fa08a401c848d0cb5018bb61aa9377c       hasResponse: false       responsesAreSuccessful: false       hasRecords: false       primaryKeysArePresent: false       primaryKeysAreUnique: false   assist: {}  schemas:   indicator_values:     type: object     $schema: http://json-schema.org/draft-07/schema#     additionalProperties: true     properties: {}
You must update all the
<-- FILL THIS IN
comments with the correct values from your API.
If you provide sample API responses for job creation, polling, and download, I can help you fill in these details more precisely. For more guidance, see the [AsyncRetriever YAML Reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/AsyncRetriever) and [Configuring an Asynchronous Stream](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream).
h
@kapa.ai
Copy code
airbyte_cdk.utils.traced_exception.AirbyteTracedException: AirbyteTracedException("At least one job could not be completed for slice {'pe': '201710;201709', 'dx': 'EM02m2HPZG6', 'ou': 'wqURG81DbhS'}. Job statuses were: {'35a5e379-69cf-4f79-8520-b17a797c2cb0 - Job that could not start': <AsyncJobStatus.FAILED: ('FAILED', True)>}. See warning logs for more information.")
AirbyteTracedException("At least one job could not be completed for slice {'pe': '201710;201709', 'dx': 'PePmfAnKV3c', 'ou': 'wqURG81DbhS'}. Job statuses were: {'5d38f4ec-b96c-4043-8d90-1ca12522d4d5 - Job that could not start': <AsyncJobStatus.FAILED: ('FAILED', True)>}. See warning logs for more information.")
AirbyteTracedException("At least one job could not be completed for slice {'pe': '201710;201709', 'dx': 'EM02m2HPZG6', 'ou': 'TQZa6RHFdsh'}. Job statuses were: {'cf1407e7-5a42-4d85-8383-92c6a139df25 - Job that could not start': <AsyncJobStatus.FAILED: ('FAILED', True)>}. See warning logs for more information.")
AirbyteTracedException("At least one job could not be completed for slice {'pe': '201710;201709', 'dx': 'PePmfAnKV3c', 'ou': 'TQZa6RHFdsh'}. Job statuses were: {'c1b260e2-b742-4723-9cce-7c84d36c8b8a - Job that could not start': <AsyncJobStatus.FAILED: ('FAILED', True)>}. See warning logs for more information.")
its saying this how can i fix it
k
A message from kapa.ai
The error message you are seeing:
Copy code
AirbyteTracedException("At least one job could not be completed for slice {...}. Job statuses were: {... - Job that could not start': <AsyncJobStatus.FAILED: ('FAILED', True)>}. See warning logs for more information.")
indicates that the asynchronous job for at least one data slice failed to start or complete. This is a generic failure for async jobs in Airbyte and can be caused by several issues: ### Common Causes and Steps to Fix 1. Incorrect Async Configuration - Ensure your
creation_requester
,
polling_requester
, and
download_requester
are correctly configured with the right endpoints, HTTP methods, and request parameters for your API's async job flow. - Double-check that your
status_extractor
and
status_mapping
match the actual structure and values returned by your API. If these are incorrect, Airbyte may not detect when a job is actually running or completed, leading to failures [[Configuring an Asynchronous Stream]](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream). 2. API Job Creation Fails - The job may not be created successfully on the source API. Check the API's response to the job creation request for errors or missing required parameters. 3. Partition Slices Are Invalid - The combination of
pe
,
dx
, and
ou
in your partition router may be producing slices that are not valid or not supported by the API, causing job creation to fail for those slices. 4. Authentication or Permissions - Ensure the credentials provided have the necessary permissions to create and manage async jobs on the API. 5. Check Warning Logs - The error message suggests looking at the warning logs for more information. These logs may contain specific API error messages or details about why the job could not start. 6. Timeouts or API Limits - If the API has rate limits or the jobs are timing out, you may need to adjust your
polling_job_timeout
or partition your data differently. ### What to Do Next - Review the warning logs as suggested in the error message. They will often contain the root cause (e.g., API error message, invalid parameters, authentication failure). - Test your async job creation endpoint manually (e.g., with curl or Postman) using the same parameters as Airbyte to see if the API returns an error. - Validate your YAML configuration against your API's documentation, especially the async job flow and expected status values. If you can provide the relevant warning log entries or sample API responses, I can help you further pinpoint the issue. > The knowledge sources do not provide a specific fix for this error, but they do emphasize the importance of correct async configuration and matching your API's response structure and status values [[Configuring an Asynchronous Stream]](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream).
h
@kapa.ai is it the api causing problem is the api might be asyncronious or syncrouns
k
A message from kapa.ai
Based on the error and the information from the knowledge sources, it is possible that the problem is related to how the API handles job creation and processing. If the API is synchronous (returns data immediately), configuring it as an asynchronous job in Airbyte will likely fail, because Airbyte expects to create a job, poll for its status, and then download the result. If the API is asynchronous but your configuration does not match the API's actual async workflow (e.g., incorrect endpoints, status extraction, or status mapping), jobs may also fail to start or complete. The knowledge sources emphasize that asynchronous streams are only appropriate when the API requires you to trigger a job and wait for it to complete, such as for large data exports or report generation. If your API does not follow this pattern, you should use a synchronous stream instead. Conversely, if your API is asynchronous but not configured correctly in Airbyte, you will encounter failures like the ones you are seeing [[Asynchronous Job streams](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams)]. In summary: - If your API is synchronous, you should not use the asynchronous job configuration in Airbyte. - If your API is asynchronous, ensure your Airbyte configuration matches the API's async workflow exactly. If you are unsure whether your API is synchronous or asynchronous, review the API documentation or test the endpoints manually to see if data is returned immediately (synchronous) or if you must create a job and poll for results (asynchronous).
h
@kapa.ai version: 6.48.15 type: DeclarativeSource check: type: CheckStream stream_names: - indicator_values definitions: streams: indicator_values: type: DeclarativeStream name: indicator_values retriever: type: AsyncRetriever record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: - data status_mapping: completed: - ready failed: - failed running: - pending timeout: - timeout status_extractor: type: DpathExtractor field_path: [] download_target_extractor: type: DpathExtractor field_path: - urls partition_router: - type: ListPartitionRouter values: - wqURG81DbhS - TQZa6RHFdsh cursor_field: ou - type: ListPartitionRouter values: - EM02m2HPZG6 - PePmfAnKV3c cursor_field: dx - type: ListPartitionRouter values: - 201710;201709 cursor_field: pe decoder: type: JsonDecoder creation_requester: type: HttpRequester url_base: https://***.*.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator username: "{{ config[\"username\"] }}" password: "{{ config[\"password\"] }}" http_method: GET http_method: GET request_parameters: dimension: >- dx:{{ stream_partition['dx'] }},pe:{{ stream_partition['pe'] }},ou:{{ stream_partition['ou'] }} polling_requester: type: HttpRequester url_base: >- https://***.*.gov.et/api/analytics/?{{ creation_response['dimension'] }} authenticator: type: BasicHttpAuthenticator username: "{{ config[\"username\"] }}" password: "{{ config[\"password\"] }}" http_method: GET download_requester: type: HttpRequester url_base: "{{ download_target }}" authenticator: type: BasicHttpAuthenticator username: "{{ config[\"username\"] }}" password: "{{ config[\"password\"] }}" http_method: GET download_decoder: type: JsonDecoder schema_loader: type: InlineSchemaLoader schema: $ref: "#/schemas/indicator_values" base_requester: type: HttpRequester url_base: https://***.*.gov.et/api/analytics streams: - $ref: "#/definitions/streams/indicator_values" spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - username properties: username: type: string title: Username order: 0 password: type: string title: Password always_show: true airbyte_secret: true order: 1 additionalProperties: true metadata: autoImportSchema: indicator_values: true testedStreams: indicator_values: streamHash: 523005c6c9dacf30d4fe0e2b768be8eb1174fdd1 hasResponse: false responsesAreSuccessful: false hasRecords: false primaryKeysArePresent: false primaryKeysAreUnique: false assist: {} schemas: indicator_values: type: object $schema: http://json-schema.org/draft-07/schema# additionalProperties: true properties: {} this is not working its responseing An unknown error has occurred
k
A message from kapa.ai
Your YAML configuration is not working and is returning "An unknown error has occurred" because there are several issues and likely mismatches with how your API actually works versus how the Airbyte async retriever expects to interact with it. Based on the knowledge sources, here are the most probable causes and what you should check: --- ### 1. Is Your API Actually Asynchronous? - If your API is synchronous (returns data immediately), you should not use
AsyncRetriever
. The async retriever is only for APIs where you must create a job, poll for its status, and then download the result. If your API does not follow this pattern, use a synchronous retriever instead [[Asynchronous Job streams](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams)]. --- ### 2. Empty or Incorrect
field_path
Values
- Your
status_extractor
has
field_path: []
. This must point to the field in the polling response that contains the job status (e.g.,
["status"]
). If this is empty, Airbyte cannot determine the job status and will fail [[Configuring an Asynchronous Stream](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream)]. --- ### 3. Endpoint and Parameter Issues - Your
creation_requester
,
polling_requester
, and
download_requester
endpoints and parameters may not match your API's requirements. For async jobs, you typically: - Create a job (often a POST, not GET) - Poll for status (GET, using a job ID from the creation response) - Download results (GET, using a download URL from the polling response) - Your current config uses GET for job creation and constructs URLs in a way that may not be valid for your API. --- ### 4. Status Mapping - The values in
status_mapping
(
ready
,
failed
,
pending
,
timeout
) must match exactly what your API returns for job status. If your API uses different words, you must update these [[Polling Tab](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/async-streams#polling-tab)]. --- ### 5. Partition Slices - If your partition router is generating combinations that are not valid for your API, job creation may fail for those slices. --- ### 6. Check Logs for Details - The error message is generic. You need to check the Airbyte logs for more specific error messages from the API or the connector. This will help you pinpoint if it's an authentication issue, a bad request, or a misconfiguration. --- ## What You Should Do 1. Verify if your API is asynchronous. If not, use a synchronous retriever. 2. Update all
field_path
values
to match your API's actual response structure. 3. Check and correct all endpoints and HTTP methods for job creation, polling, and download. 4. Update
status_mapping
to match your API's status values. 5. Check Airbyte logs for more detailed error messages. --- If you can provide sample API responses for job creation, polling, and download, I can help you fill in the correct field paths and status values. Otherwise, you must review your API documentation and update the YAML accordingly. > The knowledge sources do not provide a one-size-fits-all fix, but they emphasize the importance of matching your configuration to your API's actual async job flow and response structure [[Configuring an Asynchronous Stream](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams#configuring-an-asynchronous-stream)].
h
@kapa.ai version: 6.48.15 type: DeclarativeSource check: type: CheckStream stream_names: - indicator_values definitions: streams: indicator_values: type: DeclarativeStream name: indicator_values retriever: type: SimpleRetriever decoder: type: JsonDecoder requester: $ref: "#/definitions/base_requester" path: https://***.moh.gov.et/api/analytics http_method: GET request_parameters: dimension: >- dx:{{ stream_partition['dx'] }},pe201701;201702;201703;201704,ou{{ stream_partition['ou'] }} record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: [] partition_router: - type: ListPartitionRouter values: - wqURG81DbhS - TQZa6RHFdsh cursor_field: ou - type: ListPartitionRouter values: - EM02m2HPZG6 - PePmfAnKV3c cursor_field: dx - type: ListPartitionRouter values: - 201701;201702;201703 - 201704;201705;201706 - 201707;201708;201709 - 201710;201711;201712 cursor_field: pe schema_loader: type: InlineSchemaLoader schema: $ref: "#/schemas/indicator_values" base_requester: type: HttpRequester url_base: https://***.moh.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator password: "{{ config[\"password_2\"] }}" username: "{{ config[\"username_2\"] }}" streams: - $ref: "#/definitions/streams/indicator_values" spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - username_2 properties: password_2: type: string order: 1 title: Password always_show: true airbyte_secret: true username_2: type: string order: 0 title: Username additionalProperties: true metadata: assist: {} testedStreams: indicator_values: hasRecords: true streamHash: 15240667d4046e618331bb9c66b1c935e3248e21 hasResponse: true primaryKeysAreUnique: true primaryKeysArePresent: true responsesAreSuccessful: true autoImportSchema: indicator_values: false schemas: indicator_values: type: object properties: dx: type: string description: Indicator ID ou: type: string description: Org Unit ID pe: type: string description: Period (YYYYMM) value: type: string description: Indicator Value additionalProperties: true for this yml file i want the full response not i dont want to select for partition how can i do that
k
A message from kapa.ai
To fetch the full response without partitioning in your Airbyte YAML, you need to remove the
partition_router
section
from your stream definition. The
partition_router
is what instructs Airbyte to split the requests into multiple partitions based on the values you provide (such as
ou
,
dx
, and
pe
). If you remove this, Airbyte will make a single request using the parameters as you define them in the
requester
. Here’s how you can modify your YAML:
Copy code
yaml definitions:   streams:     indicator_values:       type: DeclarativeStream       name: indicator_values       retriever:         type: SimpleRetriever         decoder:           type: JsonDecoder         requester:           $ref: "#/definitions/base_requester"           path: https://***.moh.gov.et/api/analytics           http_method: GET           request_parameters:             dimension: >-               dx:{{ config['dx'] }},pe:{{ config['pe'] }},ou:{{ config['ou'] }}         record_selector:           type: RecordSelector           extractor:             type: DpathExtractor             field_path: []       schema_loader:         type: InlineSchemaLoader         schema:           $ref: "#/schemas/indicator_values"
Key changes: - Removed the entire
partition_router
section.
- You may want to set the
dimension
parameter using values from the config or hardcode them as needed. What this does: Airbyte will now make a single request to your API endpoint with the parameters you specify, and you will get the full response for those parameters, not split by partitions. Reference: This approach is supported by the Airbyte documentation, which states that partitioning is only required if you need to fetch data in subsets (partitions). If you want the full response, simply omit the partitioning configuration [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning)]. If you want to make the parameters configurable, you can add them to your
spec
and reference them in the
request_parameters
. Otherwise, you can hardcode the values as shown above.
h
@kapa.ai can you send me the whole updated yml file?
k
A message from kapa.ai
Certainly! Below is your updated YAML file with the partition_router section removed, so Airbyte will fetch the full response in a single request. The rest of your configuration is preserved. Note: The
dimension
parameter is set as a single string; you can adjust it as needed.
Copy code
yaml version: 6.48.15  type: DeclarativeSource  check:   type: CheckStream   stream_names:     - indicator_values  definitions:   streams:     indicator_values:       type: DeclarativeStream       name: indicator_values       retriever:         type: SimpleRetriever         decoder:           type: JsonDecoder         requester:           $ref: "#/definitions/base_requester"           path: https://***.moh.gov.et/api/analytics           http_method: GET           request_parameters:             dimension: dx:EM02m2HPZG6,pe:201701;201702;201703;201704,ou:wqURG81DbhS         record_selector:           type: RecordSelector           extractor:             type: DpathExtractor             field_path: []       schema_loader:         type: InlineSchemaLoader         schema:           $ref: "#/schemas/indicator_values"   base_requester:     type: HttpRequester     url_base: https://***.moh.gov.et/api/analytics     authenticator:       type: BasicHttpAuthenticator       password: "{{ config[\"password_2\"] }}"       username: "{{ config[\"username_2\"] }}"  streams:   - $ref: "#/definitions/streams/indicator_values"  spec:   type: Spec   connection_specification:     type: object     $schema: http://json-schema.org/draft-07/schema#     required:       - username_2     properties:       password_2:         type: string         order: 1         title: Password         always_show: true         airbyte_secret: true       username_2:         type: string         order: 0         title: Username     additionalProperties: true  metadata:   assist: {}   testedStreams:     indicator_values:       hasRecords: true       streamHash: 15240667d4046e618331bb9c66b1c935e3248e21       hasResponse: true       primaryKeysAreUnique: true       primaryKeysArePresent: true       responsesAreSuccessful: true   autoImportSchema:     indicator_values: false  schemas:   indicator_values:     type: object     properties:       dx:         type: string         description: Indicator ID       ou:         type: string         description: Org Unit ID       pe:         type: string         description: Period (YYYYMM)       value:         type: string         description: Indicator Value     additionalProperties: true
What changed: - The
partition_router
section was removed from the
indicator_values
stream, so Airbyte will no longer partition requests and will fetch the full response in one go. This approach is consistent with Airbyte's documentation: if you want the full response and not partitioned data, simply omit the partitioning configuration [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning)].
h
@kapa.ai so how can i get the full response whith out removing the partition router
k
A message from kapa.ai
If you want to get the full response without removing the
partition_router
, you need to configure your
partition_router
so that it only produces a single partition that covers the entire dataset you want to fetch. The
partition_router
in Airbyte is designed to split your data retrieval into multiple requests, each for a subset (partition) of your data. If you configure it with only one value per partitioning field, Airbyte will make just one request, effectively giving you the full response in a single partition. How to do this: - Set each `ListPartitionRouter`'s
values
to a single value that represents "all" for that dimension, or to the specific value(s) you want to fetch in one go. - If your API supports a wildcard or "all" value (e.g.,
*
or leaving the parameter empty), use that. Example:
Copy code
yaml partition_router:   - type: ListPartitionRouter     values:       - wqURG81DbhS  # Only one value for 'ou'     cursor_field: ou   - type: ListPartitionRouter     values:       - EM02m2HPZG6  # Only one value for 'dx'     cursor_field: dx   - type: ListPartitionRouter     values:       - 201701;201702;201703;201704;201705;201706;201707;201708;201709;201710;201711;201712  # All periods in one value     cursor_field: pe
With this configuration, Airbyte will generate only one partition and make a single request, so you will get the full response for the specified parameters. Key point from the documentation: > The partition router specifies a list of attributes where each attribute describes a portion of the complete data set for a stream. During a sync, each value is iterated over and can be used as input to outbound API requests. If you only provide one value per attribute, only one request will be made, and you will get the full response for that configuration [[ListPartitionRouter Reference](https://docs.airbyte.com/platform/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/ListPartitionRouter)]. If you want to avoid partitioning altogether, you can remove the
partition_router
, but if you want to keep it for flexibility or future use, just set it up as above with a single value per partition.
h
@kapa.ai what if i have synchronous api but i want to achieve asyncronius since i have different query parameters resulting different results an i wand the full result not partitioned result in airbyte
k
A message from kapa.ai
If your API is synchronous (returns data immediately) but you want to achieve an "asynchronous-like" result in Airbyte—meaning you want to fetch data for many different query parameter combinations and combine all results into a single, unified output (not partitioned)—Airbyte’s current partitioning and stream model does not natively merge all partitioned results into a single response. Each partitioned request is treated as a separate slice, and the results are combined at the record level, not as a single API response. Key points from the knowledge sources: - Partitioning in Airbyte is used to fetch data for different parameter combinations, but each partitioned request is still a separate API call. The results are combined into the same stream, but you do not get the "raw" full response as if you had made a single API call with all parameters at once. If you want the full result for all combinations, you would need to make a single API call with parameters that cover the entire dataset, if your API supports it [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning)]. - Asynchronous streams in Airbyte are designed for APIs that require job creation, polling, and downloading results. They are not intended for synchronous APIs that simply return data immediately [[Asynchronous Job streams](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams)]. What you can do: - If your API supports a way to request all data in a single call (e.g., by omitting filters or using a wildcard), configure your stream to make that single call—do not use partitioning. - If you must use different query parameters to get all data (and the API does not support a single "all data" call), Airbyte will partition the requests and combine the records, but you will not get a single "full response" as if you had made one API call. Summary: You cannot use Airbyte’s async or partitioning features to merge multiple synchronous API responses into a single, unpartitioned "full response" at the API response level. Airbyte will always treat each partition as a separate request and combine the records at the stream level. If you need the true full response, you must configure your stream to make a single API call that returns all data, if your API supports it. Otherwise, you will get a combined set of records from multiple requests, not a single API response [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning)]. If you need more advanced merging or post-processing, you would need to handle that outside of Airbyte, as the platform does not natively support merging multiple API responses into a single "raw" response.
h
@kapa.ai what if i have syncronious api but i want to achive asyncronius since i have different query paramaters resulting different results an i wand the full result not partitioned result in airbyte
k
A message from kapa.ai
If your API is synchronous (returns data immediately) but you want to achieve an "asynchronous-like" result in Airbyte—meaning you want to fetch data for many different query parameter combinations and combine all results into a single, unified output (not partitioned)—Airbyte’s current partitioning and stream model does not natively merge all partitioned results into a single response. Each partitioned request is treated as a separate slice, and the results are combined at the record level, not as a single API response. Key points from the knowledge sources: - Partitioning in Airbyte is used to fetch data for different parameter combinations, but each partitioned request is still a separate API call. The results are combined into the same stream, but you do not get the "raw" full response as if you had made a single API call with all parameters at once. If you want the full result for all combinations, you would need to make a single API call with parameters that cover the entire dataset, if your API supports it [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning)]. - Asynchronous streams in Airbyte are designed for APIs that require job creation, polling, and downloading results. They are not intended for synchronous APIs that simply return data immediately [[Asynchronous Job streams](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/async-streams)]. What you can do: - If your API supports a way to request all data in a single call (e.g., by omitting filters or using a wildcard), configure your stream to make that single call—do not use partitioning. - If you must use different query parameters to get all data (and the API does not support a single "all data" call), Airbyte will partition the requests and combine the records, but you will not get a single "full response" as if you had made one API call. Summary: You cannot use Airbyte’s async or partitioning features to merge multiple synchronous API responses into a single, unpartitioned "full response" at the API response level. Airbyte will always treat each partition as a separate request and combine the records at the stream level. If you need the true full response, you must configure your stream to make a single API call that returns all data, if your API supports it. Otherwise, you will get a combined set of records from multiple requests, not a single API response [[Partitioning](https://docs.airbyte.com/platform/connector-development/connector-builder-ui/partitioning)]. If you need more advanced merging or post-processing, you would need to handle that outside of Airbyte, as the platform does not natively support merging multiple API responses into a single "raw" response.
h
@kapa.ai version: 6.48.15 type: DeclarativeSource check: type: CheckStream stream_names: - indicator_values definitions: streams: indicator_values: type: DeclarativeStream name: indicator_values retriever: type: SimpleRetriever decoder: type: JsonDecoder requester: $ref: "#/definitions/base_requester" path: https://**.*.gov.et/api/analytics http_method: GET request_parameters: dimension: >- dx:{{ stream_partition['dx'] }},pe201701;201702;201703;201704,ou{{ stream_partition['ou'] }} record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: [] partition_router: - type: ListPartitionRouter values: - wqURG81DbhS - TQZa6RHFdsh cursor_field: ou - type: ListPartitionRouter values: - EM02m2HPZG6 - PePmfAnKV3c cursor_field: dx - type: ListPartitionRouter values: - 201701;201702;201703 - 201704;201705;201706 - 201707;201708;201709 - 201710;201711;201712 cursor_field: pe schema_loader: type: InlineSchemaLoader schema: $ref: "#/schemas/indicator_values" base_requester: type: HttpRequester url_base: https://*.*.gov.et/api/analytics authenticator: type: BasicHttpAuthenticator password: "{{ config[\"password_2\"] }}" username: "{{ config[\"username_2\"] }}" streams: - $ref: "#/definitions/streams/indicator_values" spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - username_2 properties: password_2: type: string order: 1 title: Password always_show: true airbyte_secret: true username_2: type: string order: 0 title: Username additionalProperties: true metadata: assist: {} testedStreams: indicator_values: hasRecords: true streamHash: 15240667d4046e618331bb9c66b1c935e3248e21 hasResponse: true primaryKeysAreUnique: true primaryKeysArePresent: true responsesAreSuccessful: true autoImportSchema: indicator_values: false schemas: indicator_values: type: object properties: dx: type: string description: Indicator ID ou: type: string description: Org Unit ID pe: type: string description: Period (YYYYMM) value: type: string description: Indicator Value additionalProperties: true after publishing this does the extraction do by it self without selecting partition
k
A message from kapa.ai
Sorry @hiwot tadese, I am experiencing especially high traffic right now, please try again. 🧑‍💻