Hi all. My initial replication syncs were taking a...
# replication-troubleshooting
m
Hi all. My initial replication syncs were taking a really long time (3+ hours), saying they finished successfully, but I see no data in the target schema/tables. Checking the workloads in GKE, I noticed that replication-job-2-attempt-0 had an error message, which was that the source container had been killed due to OOM error 137. Where in the helm values can I bump the memory requested/limits for the source container and/or replication-job pod? Also, why is this error state not detected and indicated as a sync failure?
k
To address your questions: ### 1. Where to bump memory requests/limits for the source container or replication-job pod in Helm values? Airbyte on Kubernetes allows you to configure resource requests and limits for different job types (including replication jobs) via environment variables in your
values.yaml
. However, it's important to note that there are multiple environment variables for different job types (e.g., replication, check, discover, spec). Setting only the general
JOB_MAIN_CONTAINER_*
variables may not affect all job types. To ensure your replication jobs (which handle syncs) have higher memory, set the following in your
values.yaml
under `global.env_vars`:
Copy code
yaml global:   env_vars:     JOB_MAIN_CONTAINER_MEMORY_REQUEST: "2Gi"     JOB_MAIN_CONTAINER_MEMORY_LIMIT: "4Gi"     # You may also want to set CPU values     JOB_MAIN_CONTAINER_CPU_REQUEST: "1"     JOB_MAIN_CONTAINER_CPU_LIMIT: "2"     # Optionally, set for other job types as well:     SYNC_JOB_MAIN_CONTAINER_MEMORY_REQUEST: "2Gi"     SYNC_JOB_MAIN_CONTAINER_MEMORY_LIMIT: "4Gi"     # ...and so on for CHECK, DISCOVER, SPEC, SIDECAR, etc.
This approach ensures that the correct resource limits are applied to the pods responsible for your syncs. If you only set the general job resource values, some job types (like check/discover) may still use cluster defaults, which can lead to OOM errors. For more details and a full list of variables, see the discussion and example here: [Github Issue #48816](https://github.com/airbytehq/airbyte/issues/48816). ### 2. Why is the OOM error not detected as a sync failure? There are known issues where Airbyte syncs may appear as "successful" in the UI even if the underlying pod was OOMKilled or failed for other reasons. This is often due to how errors are (or are not) propagated from the pod/container level up to the Airbyte UI and job status. Users have reported that OOM errors in the logs do not always result in a failed sync status, which is a recognized problem in the community ([Github Issue #68104](https://github.com/airbytehq/airbyte/issues/68104)). You should always check the pod logs for OOMKilled events if you suspect resource issues, as the UI may not always reflect the true job status. ### Debugging To confirm your resource settings are being picked up, check the job logs in the Airbyte UI. You should see log lines like:
Copy code
Launching replication pod: replication-job-... with containers: [source] ... resources: ResourceRequirements(... limits={memory=2Gi, ...})
This confirms the memory limits are being applied as expected. If not, revisit your
values.yaml
and ensure the correct environment variables are set for the job type in question ([Configuring Connector Resources - Debugging](https://docs.airbyte.com/platform/operator-guides/configuring-connector-resources#debugging)). --- Summary: - Set memory/CPU requests and limits for replication jobs in
values.yaml
under
global.env_vars
using the appropriate environment variables. - OOM errors may not always be reflected as sync failures in the UI; always check pod logs for the real status. - For more details and troubleshooting, refer to the linked documentation and issues above.
m
Thanks. I will play with the limit/request env vars. Just a note for others, it seems the available env vars, at least in 1.8.5/2.0.17, available to control cpu (
CONTAINER_CPU_LIMIT
and
CONTAINER_CPU_REQUEST
) or memory (
CONTAINER_MEMORY_LIMIT
and
CONTAINER_MEMORY_REQUEST
) appear to be:
CHECK_
DISCOVER_
JOB_MAIN_
SIDECAR_MAIN
There does not appear to be those controls for
SYNC_JOB_MAIN_
as kapa.ai indicates. There are, however,
JOB_SOURCE_DECLARATIVE_MANIFEST_KUBE_NODE_SELECTORS
and
JOB_SOURCE_DECLARATIVE_MANIFEST_KUBE_RUNTIME_CLASS_NAME
which could affect these containers if you have a special node pool for them.
@kapa.ai Setting the following in my value.yaml:
Copy code
global:
  env_vars:
    JOB_MAIN_CONTAINER_MEMORY_REQUEST: "4Gi"
    JOB_MAIN_CONTAINER_MEMORY_LIMIT: "8Gi"
    JOB_MAIN_CONTAINER_CPU_REQUEST: "1"
    JOB_MAIN_CONTAINER_CPU_LIMIT: "2"
and then running a helm upgrade fails with:
Copy code
Error: UPGRADE FAILED: failed to create patch: The order in patch list:
[map[name:JOB_MAIN_CONTAINER_CPU_LIMIT value:2] map[name:JOB_MAIN_CONTAINER_CPU_LIMIT valueFrom:map[configMapKeyRef:map[key:JOB_MAIN_CONTAINER_CPU_LIMIT name:airbyte-airbyte-env]]] map[name:JOB_MAIN_CONTAINER_CPU_REQUEST value:1] map[name:JOB_MAIN_CONTAINER_MEMORY_LIMIT value:8Gi] map[name:JOB_MAIN_CONTAINER_MEMORY_REQUEST value:4Gi] map[name:JOB_MAIN_CONTAINER_MEMORY_REQUEST valueFrom:map[configMapKeyRef:map[key:JOB_MAIN_CONTAINER_MEMORY_REQUEST name:airbyte-airbyte-env]]]]
 doesn't match $setElementOrder list:
followed by a very long list of env vars in the configmap, including the ones I am trying to patch. Should these be set at the global level or in the
env_vars
setting for each deployment?
k
A message from kapa.ai
I'm sorry you're encountering this Helm upgrade error. This is a known issue with
abctl
and Helm chart upgrades related to environment variable patch ordering. ## The Problem The error you're seeing (
failed to create patch: The order in patch list doesn't match $setElementOrder list
) occurs when Helm tries to patch Kubernetes Deployments with environment variables that have conflicting definitions—specifically, when the same environment variable appears both as a direct
value
and as a
valueFrom
(referencing a ConfigMap). This creates a patch ordering conflict that Helm cannot resolve. According to the [troubleshooting documentation](https://docs.airbyte.com/platform/deploying-airbyte/troubleshoot-deploy#failed-to-create-patch-order-in-patch-list), this error is a known issue (referenced in [Github #114](https://github.com/airbytehq/abctl/pull/114)) and is currently being fixed. It commonly occurs when you run
abctl local install
and then subsequently run
abctl local install --low-resource-mode
, or when upgrading with conflicting environment variable definitions. The same type of error is reported in [Github Issue #60918](https://github.com/airbytehq/airbyte/issues/60918) and [Github Issue #65129](https://github.com/airbytehq/airbyte/issues/65129), where users encounter patch failures due to duplicate or conflicting environment variable definitions during Helm upgrades. ## Recommended Approach Based on the [Helm chart V2 upgrade documentation](https://docs.airbyte.com/platform/deploying-airbyte/chart-v2-community#update-your-valuesyaml-file), the correct way to set these resource values in Helm chart V2 is not via
global.env_vars
, but rather via the dedicated Helm values paths:
Copy code
yaml global:   workloads:     resources:       mainContainer:         cpu:           request: "1"           limit: "2"         memory:           request: "4Gi"           limit: "8Gi"
The documentation explicitly maps the old environment variables to the new Helm chart V2 equivalents: -
JOB_MAIN_CONTAINER_CPU_REQUEST
→
global.workloads.resources.mainContainer.cpu.request
-
JOB_MAIN_CONTAINER_CPU_LIMIT
→
global.workloads.resources.mainContainer.cpu.limit
-
JOB_MAIN_CONTAINER_MEMORY_REQUEST
→
global.workloads.resources.mainContainer.memory.request
-
JOB_MAIN_CONTAINER_MEMORY_LIMIT
→
global.workloads.resources.mainContainer.memory.limit
Using the proper Helm values paths instead of
env_vars
should avoid the patch ordering conflict, as these values are handled differently by the chart templates. ## If the Issue Persists If you continue to encounter this error after switching to the correct Helm values format, the issue may be related to existing ConfigMap state from a previous installation. In that case, you may need to clean up the existing deployment state before upgrading. However, the knowledge sources do not provide explicit instructions for this scenario beyond noting that the issue is being fixed. --- Summary: - Use
global.workloads.resources.mainContainer.*
paths in your
values.yaml
instead of setting these as environment variables in
global.env_vars
. - This is the correct approach for Helm chart V2 and should avoid the patch ordering conflict you're experiencing.