<@U04S8PLJWMT> I have created custom Cloudfare D1 ...
# ask-ai
b
@kapa.ai I have created custom Cloudfare D1 connector. After upgrade to version 1.8.1 Airbyte, my batch size can not be higher that 20000 or im getting 503. Any ideas?
k
It sounds like you’re hitting a request/size limit after upgrading to Airbyte 1.8.1, which aligns with several known “too large/too many requests” patterns seen across connectors and platform changes: - Similar 429/too many requests issues occur when batch requests exceed a service’s limits (e.g., Elasticsearch/OpenSearch bulk writes, Google Sheets batchUpdate limits). In those cases, reducing batch size or throttling resolves the errors (e.g., Sheets fails with “Cannot exceed 100000 requests in a single batch,” and switching modes or reducing batch operations helps) ([Destination - OpenSearch 429](https://discuss.airbyte.io/t/2502), [Google Sheets issue](https://github.com/airbytehq/airbyte/issues/42904)). - Platform-level limits and payload sizing can also cause 413/5xx errors when requests get large (users reported 413 during discover/create connection; mitigations included increasing ingress proxy-body-size or reinstalling with default configs) ([413 when creating connection](https://github.com/airbytehq/airbyte/issues/45423)). Given your custom D1 connector: - Keep batch size ≤ 20,000 (as you observed) or lower it further to avoid 503s. This mirrors guidance from other connectors that must stay under external API/batch limits ([Google Sheets issue](https://github.com/airbytehq/airbyte/issues/42904)). - If your 503s correlate with request payload size, consider chunking by bytes instead of record count when feasible. Airbyte has an open discussion about batching by bytes to avoid OOM/oversized requests; applying a similar heuristic in your connector can help keep each request within safe limits ([Batch on bytes vs records](https://github.com/airbytehq/airbyte/issues/3439)). - If the 503 appears related to larger control-plane payloads after 1.8.1 (e.g., schema/catalog writes), review any ingress/body-size limits in your deployment as other users did for 413s, increasing proxy-body-size if needed ([413 when creating connection](https://github.com/airbytehq/airbyte/issues/45423)). - There’s no specific 1.8.1 note about batch size changes, but 1.8 did include fixes around state handling and full refresh behavior that could affect when/how much data is pushed per attempt; double-check if a mode change caused larger write bursts post-upgrade ([Airbyte 1.8 fixes](https://docs.airbyte.com/release_notes/v-1.8#fixes)). If you can share whether the 503 originates from Cloudflare D1’s API or your deployment’s proxy, that would narrow whether to focus on connector-side chunking vs. infrastructure limits. As of these sources, there’s no explicit D1-specific limit documented; the guidance above is based on similar issues and platform behavior.
b
Since webapp moved to airbyte server we created the ingress: @kapa.ai
Copy code
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: airbyte-ingress
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
  ingressClassName: nginx
  rules:
    - host: airbyte.com
      http:
        paths:
          - backend:
              service:
                name: airbyte-airbyte-connector-builder-server-svc
                port:
                  number: 80
            path: /api/v1/connector_builder/
            pathType: Prefix
          - backend:
              service:
                name: airbyte-airbyte-server-svc
                port:
                  number: 8001
            path: /
            pathType: Prefix
  tls:
    - secretName: airbyte-selfsigned-cert-tls
      hosts:
        - airbyte.com
k
A message from kapa.ai
Your ingress looks aligned with the post–1.7 change: route Connector Builder API to airbyte-connector-builder-server-svc and everything else to airbyte-server-svc. This matches the documented examples for NGINX and ALB after webapp → server changes ([Update ingress for 1.7+](https://docs.airbyte.com/platform/deploying-airbyte/integrations/ingress-1-7#deploying-with-helm)). A couple of practical notes: - Ensure the builder path includes the trailing slash and Prefix type, as you have: /api/v1/connector_builder/ ([same pattern in docs](https://docs.airbyte.com/platform/next/deploying-airbyte/integrations/ingress-1-7#deploying-with-helm)). - If you see 403/404 from the builder, it’s usually due to missing or incorrect routing to the builder service; this split rule fixes that class of issue ([Ingress fix examples](https://github.com/airbytehq/airbyte/issues/63770)). - For large payloads/timeouts (discover/connect), you may need NGINX annotations like proxy-body-size and increased timeouts on the ingress (examples shown by maintainers and users) ([Snowflake/timeout guidance](https://github.com/airbytehq/airbyte/discussions/45946), [413 mitigation via proxy-body-size](https://github.com/airbytehq/airbyte/issues/45423)). If everything’s working, you can keep this config as-is; otherwise, consider adding:
Copy code
yaml metadata:   annotations:     nginx.ingress.kubernetes.io/proxy-body-size: "50m"     nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"     nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
(these values are suggested in community guidance for similar symptoms) ([timeouts/body size examples](https://github.com/airbytehq/airbyte/discussions/45946), [proxy-body-size fix](https://github.com/airbytehq/airbyte/issues/45423)).
b
@kapa.ai we are getting a lot of this erros when syncing: Warning from airbyte_platform: An internal transient Airbyte error has occurred. The sync should work fine on the next retry. Setting attempt to FAILED because the workflow for this connection was restarted, and existing job state was cleaned.
k
A message from kapa.ai
Those messages indicate Airbyte is auto-retrying the sync after a failure and cleaning up job state because the workflow was restarted. - “An internal transient Airbyte error has occurred. The sync should work fine on the next retry.” → Airbyte treats this as a transient/system error and will retry automatically. If repeated, it will eventually disable the connection after multiple consecutive failures (Cloud/Enterprise UI surfaces these as yellow “system errors”) ([Connection troubleshooting](https://docs.airbyte.com/platform/understanding-airbyte/jobs#sync-jobs), [Cloud status – system errors](https://docs.airbyte.com/platform/cloud/managing-airbyte-cloud/review-connection-status#connection-troubleshooting)). - “Setting attempt to FAILED because the workflow for this connection was restarted, and existing job state was cleaned.” → This occurs when the connection’s Temporal workflow restarts; Airbyte fails the current attempt, cleans state, and schedules the next attempt according to backoff rules. Default backoff escalates 10s, 30s, 90s, then 4m30s after successive complete failures; there are also limits on how many attempts are permitted before the job finally fails (configurable in OSS) ([Sync jobs, attempts/retries/backoff](https://docs.airbyte.com/platform/understanding-airbyte/jobs#sync-jobs)). What to do: - Let retries proceed; check the job history UI to confirm backoff timing and whether later attempts succeed ([Retry backoff visible in logs/UI](https://docs.airbyte.com/platform/understanding-airbyte/jobs#sync-jobs)). - If these keep repeating, investigate the underlying cause (e.g., source/destination responsiveness, rate limits). Airbyte uses heartbeats to detect unresponsive connectors and will restart jobs to avoid indefinite hangs; persistent heartbeat-triggered restarts suggest a deeper issue with the source or destination performance/limits ([Heartbeats](https://docs.airbyte.com/platform/understanding-airbyte/heartbeats)). - If you’re on Cloud/Enterprise, use the Status page to distinguish configuration errors (red) from system/transient errors (yellow) and identify rate-limited streams, which resume automatically once limits lift ([Connection troubleshooting](https://docs.airbyte.com/platform/cloud/managing-airbyte-cloud/review-connection-status#connection-troubleshooting)). If you can share a specific job’s logs around the first failure, we can correlate whether it’s a heartbeat-triggered restart, rate limiting, or another transient error.
b
@kapa.ai The minio pod PVC was full and sync crashed, so we cleaned some disk in minio, but probably we should delete all from disk? After that we are getting this errors?
k
A message from kapa.ai
Short answer: your MinIO disk filling up is a known root cause for “jobs hang/restart” and “no logs” symptoms. Cleaning enough space (not necessarily deleting everything) usually restores normal operation, but you must ensure the PVC has sufficient headroom and, if needed, prune the right folders. What to do: - Free space in MinIO where Airbyte stores logs and workload output: - /storage/airbyte-storage/job-logging/workspace - /storage/airbyte-storage/workload/output Users have resolved indefinite hangs and 5xx by deleting logs in these paths or recreating the MinIO PVC; deleting all logs is safe but will remove historical logs (multiple reports confirm this) ([All syncs hanging workaround](https://github.com/airbytehq/airbyte/issues/55812), [MinIO full fixes](https://discuss.airbyte.io/t/1857), [What’s stored in MinIO](https://discuss.airbyte.io/t/3101), [MinIO cleanup](https://github.com/airbytehq/airbyte/issues/44556)). - If jobs still error with “internal transient error” or keep restarting after freeing space, try restarting the affected pods (workload-launcher, worker, server). A known issue shows the workload-launcher can become a “zombie” after storage disruptions and pass liveness probes until restarted; deleting the pod resolved it for users ([workload-launcher storage disruption](https://github.com/airbytehq/airbyte/issues/57011)). - Prevent reoccurrence: - Increase the MinIO PVC size (default is often only 500Mi) via values.yaml, e.g.: minio.storage.volumeClaimValue: 2Gi ([PVC sizing tip](https://github.com/airbytehq/airbyte/issues/55812)). - Periodically prune old logs (manual or automation). Community guidance confirms MinIO primarily stores logs; trimming those paths is safe for data sync state ([What’s in MinIO](https://discuss.airbyte.io/t/3101), [cleanup examples](https://discuss.airbyte.io/t/1857)). - Optionally switch logs/state to an external object store (S3/GCS). Users report UI logs still work with S3/GCS when configured correctly, and this avoids local PVC limits ([S3/GCS logs visibility experiences](https://github.com/airbytehq/airbyte/discussions/48454)). Why you’re seeing errors now: - When MinIO was full, Airbyte couldn’t append logs or job outputs, causing jobs to hang and workflows to restart. After freeing space, running pods may still be in a bad state until restarted (see workload-launcher note). The transient error/restart messages align with this scenario and should clear once space is sufficient and pods are healthy ([All syncs hanging → MinIO full](https://github.com/airbytehq/airbyte/issues/55812), [workload-launcher liveness gap](https://github.com/airbytehq/airbyte/issues/57011)). If freeing space and restarting pods doesn’t help, consider fully recreating the MinIO PVC (accepting loss of historical logs). Multiple users confirm this restored normal syncing ([All syncs hanging workaround](https://github.com/airbytehq/airbyte/issues/55812)).
b
@kapa.ai This is our connector config. This stoped to work after upgrade to 1.8.1 . Can you please try to fix it?
k
Sorry @Branko Djukic, it looks like your question contains files, which I cannot process. Please reformulate your question without including any files.
b
@kapa.ai This is our connector config. This stoped to work after upgrade to 1.8.1 . Can you please try to fix it? Issue is probably with pagination. retriever: type: SimpleRetriever requester: $ref: "#/definitions/base_requester" path: query http_method: POST request_body_json: sql: >- SELECT * FROM {{ config['tables'] }} WHERE id > {{ stream_slice['last_id'] or 0 }} ORDER BY id LIMIT {{ config['batch_size'] }} record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: - result - "*" - results - "*" paginator: type: DefaultPaginator pagination_strategy: type: CursorPagination page_size: 5000 cursor_value: >- {{ response['result'][-1]['id'] if response['result'] else stream_slice.get('last_id', 0) }} stop_condition: "{{ response['result']|length == 0 }}" decoder: type: JsonDecoder transformations: - type: RemoveFields field_pointers: - - meta schema_loader: type: InlineSchemaLoader schema: $ref: "#/schemas/fingerprint_events" base_requester: type: HttpRequester url_base: >- https://api.cloudflare.com/client/v4/accounts/{{ config['account_id'] }}/d1/database/{{ config['database_id'] }}/ authenticator: type: BearerAuthenticator api_token: "{{ config[\"api_key\"] }}"
k
A message from kapa.ai
Thanks for sharing the manifest. Two likely pagination issues after 1.8.x: 1) CursorPagination token injection and base path handling - When the cursor is a full URL or path-like token, you must set page_token_option accordingly. If you intend to pass the next “starting id” as a request parameter, configure page_token_option to inject into request_parameter with a field name (e.g., from, starting_after, id, etc.). If instead you want to follow a next URL returned by the API, set page_token_option to RequestPath so the next request uses that path directly ([Cursor paginator in request parameters] and [Cursor paginator in path]). If this isn’t configured, Airbyte won’t know where to place your computed cursor, and subsequent pages won’t be requested as intended (docs show both patterns) ([Cursor pagination YAML examples](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/pagination#cursor)). 2) First request/page-size behavior - If you rely on sending a page size or page token on the first request, ensure the paginator has page_size_option configured (so the page_size value is injected) and consider whether you need injection on the first request depending on your API. There have been regressions reported around token/offset injection across versions, so being explicit helps ([DefaultPaginator and RequestOption](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/reference#/definitions/DefaultPaginator), [troubleshooting “Parameter injection issues”](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/pagination#troubleshooting)). Proposed fix (inject the “last id” as a request parameter and page size too):
Copy code
yaml paginator:   type: DefaultPaginator   page_token_option:     type: RequestOption     field_name: from          # or whatever param Cloudflare expects (e.g., starting_after)     inject_into: request_parameter   page_size_option:     type: RequestOption     field_name: limit         # align with your API’s page-size param name     inject_into: request_parameter   pagination_strategy:     type: CursorPagination     page_size: 5000     cursor_value: "{{ response['result'][-1]['id'] if response['result'] else stream_slice.get('last_id', 0) }}"     stop_condition: "{{ response['result']|length == 0 }}"
Notes: - Replace field_name values with the exact parameter names your D1 endpoint expects (e.g., LIMIT is already in your SQL; if you keep LIMIT in the SQL, you may omit page_size_option. If you prefer to control LIMIT via paginator, remove it from SQL and let page_size_option inject it). - If your API returns a “next page URL” instead of an id, switch page_token_option to:
Copy code
yaml   page_token_option:     type: RequestPath
and set cursor_value to that URL per the docs ([Cursor paginator in path](https://docs.airbyte.com/platform/1.7/connector-development/config-based/understanding-the-yaml-file/pagination#cursor)). Troubleshooting checklist: - Verify the parameter is actually injected on first and subsequent requests (Pagination > Parameter injection issues) ([Connector Builder pagination troubleshooting](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/pagination#troubleshooting)). - If the base URL contains path segments and you switch to following full next URLs, be aware of an open issue where cursor-based next URLs could drop the base path; using RequestPath with a full URL avoids that pitfall ([issue about CursorPagination and url_base path](https://github.com/airbytehq/airbyte/issues/18136)). - If none of the built-in methods match the D1 response format, implement a Custom Pagination Strategy and reference it in the builder (class inheriting PaginationStrategy) ([Custom Pagination Strategy](https://docs.airbyte.com/platform/next/connector-development/connector-builder-ui/pagination#custom-pagination-strategy)). If you can confirm the exact parameter names Cloudflare D1 expects for “start after id” and page size, I can tailor the field_name values precisely.
b
@kapa.ai good. I will create two stream with direct sql query since pagination does not work. can you help me with first stream: equest_body_json: sql: >- SELECT * FROM {{ config['tables'] }} ORDER BY id LIMIT {{config['batch_size'] }} Here it should be batch size: 1 stream SELECT * FROM {{ config['tables'] }} ORDER BY id LIMIT 20000; 2. stream SELECT * FROM f{{ config['tables'] }} WHERE id > 20001 ORDER BY id LIMIT 20000; in first stream i want to get id from zero to 20000 and in second all the rest. Is this possible?
k
A message from kapa.ai
Yes, you can implement this with two separate streams in the connector manifest by hard-coding the SQL for each stream (no pagination). Each stream uses its own requester with a different SQL body. Example sketch (replace schema refs to match your manifest):
Copy code
yaml streams:   - name: table_batch_1     retriever:       type: SimpleRetriever       requester:         $ref: "#/definitions/base_requester"         path: query         http_method: POST         request_body_json:           sql: >             SELECT * FROM {{ config['tables'] }}             WHERE id <= 20000             ORDER BY id       record_selector:         type: RecordSelector         extractor:           type: DpathExtractor           field_path: ["result", "*", "results", "*"]     transformations:       - type: RemoveFields         field_pointers: [["meta"]]     schema_loader:       type: InlineSchemaLoader       schema:         $ref: "#/schemas/fingerprint_events"    - name: table_batch_2     retriever:       type: SimpleRetriever       requester:         $ref: "#/definitions/base_requester"         path: query         http_method: POST         request_body_json:           sql: >             SELECT * FROM {{ config['tables'] }}             WHERE id > 20000             ORDER BY id       record_selector:         type: RecordSelector         extractor:           type: DpathExtractor           field_path: ["result", "*", "results", "*"]     transformations:       - type: RemoveFields         field_pointers: [["meta"]]     schema_loader:       type: InlineSchemaLoader       schema:         $ref: "#/schemas/fingerprint_events"]
Notes: - Use two streams because Airbyte does not allow renaming individual streams dynamically; you select streams on the Schema tab and can prefix names if needed ([Configuring schemas → Select streams; Stream prefix](https://docs.airbyte.com/platform/using-airbyte/configuring-schema) and versions 1.6/1.7/Next). - If you want the LIMIT to be configurable, keep your config['batch_size'], but then fix the boundary explicitly: - First stream: WHERE id <= {{ config['batch_size'] }} - Second stream: WHERE id > {{ config['batch_size'] }} - Ensure your record_selector path matches the D1 response you already used. This approach avoids paginator usage entirely and relies on two fixed SQL queries, which is supported by the connector builder YAML pattern for SimpleRetriever and request_body_json ([Connector Builder request/selector pattern](https://docs.airbyte.com/platform/1.7/connector-development/connector-builder-ui/stream-templates)).
b
@kapa.ai where can i report this issue? The Actual Issue Summary Root Cause: Airbyte 1.8.1 update broke D1 connector's ability to handle large response payloads, causing pagination to fail. Technical Details: Before Airbyte 1.8.1: • ✅ Full sync worked: 86MB | 31,284 records • ✅ D1 connector handled large responses properly After Airbyte 1.8.1: • ❌ Only partial sync: 51.89MB | 20,000 records • ❌ Pagination stops after first batch • ❌ Gets 503 errors with batch_size > 20,000 Root Technical Issue: 1. Large Response Size: Each record ~3.2KB (due to
raw_payload
field being 2KB+) 2. Payload Size Limits: 20,000 records = ~61MB, 25,000 records = ~76MB 3. Airbyte 1.8.1 Changes: Stricter memory/timeout limits broke large payload handling 4. Pagination Failure: Cursor logic not advancing properly in new version Evidence: • D1 has all 31,788 records (confirmed via direct queries) • Airbyte only makes 1 API request instead of multiple •
sourceStateMessagesEmitted: 1
(should be 2+ for pagination) • Same connector worked before 1.8.1 upgrade Issue Type: Regression bug in Airbyte 1.8.1 affecting D1 connector's pagination and large response handling. Impact: • Missing ~11,788 records in data pipeline • Incomplete data sync to Snowflake • Breaking change without proper migration guide
k
A message from kapa.ai
You can report this regression in Airbyte’s GitHub repository: - For product/bug reports, open a new issue at https://github.com/airbytehq/airbyte/issues. Include version (1.8.1), deployment details, connector manifest, logs, and steps to reproduce. Similar pagination regressions have been tracked there (for example, PageIncrement token injection issues across versions) (["PageIncrement pagination no PageNumber"](https://github.com/airbytehq/airbyte/issues/53140)). If your change involves connector behavior that breaks existing users, flag it as a breaking/regression change. Airbyte’s docs define what constitutes a breaking change and the required handling by maintainers (major bump, migration guidance), which helps triage and prioritization ([Breaking changes policy](https://docs.airbyte.com/platform/contributing-to-airbyte/change-cdk-connector#breaking-changes-to-connectors), [Acceptance tests: breaking changes](https://docs.airbyte.com/platform/next/connector-development/testing-connectors/connector-acceptance-tests-reference#breaking-changes-and-backwards-compatibility)).