<@U04S8PLJWMT> I have deployed airbyte-v2 oss with...
# ask-ai
d
@kapa.ai I have deployed airbyte-v2 oss with kubernetes but the following pods - airbyte-worker, airbyte-server,airbyte-connector-builder-server, airbyte-cron, airbyte-workload-api-server and airbyte-workload-launcher keep restarting causing error 502. What do i need to fix to not get this error and make sure the pods don't restart ? - these are the error details '// HttpError { "i18nKey": "errors.http.badGateway", "i18nParams": { "status": 502 }, "name": "HttpError", "requestId": "9iVzMqd5SNXg47U8tEdWDg", "request": { "url": "/api/v1/web_backend/config", "method": "GET" }, "status": 502, "response": "<!DOCTYPE html>\n<html>\n<head>\n<title>Error</title>\n<style>\nhtml { color-scheme: light dark; }\nbody { width: 35em; margin: 0 auto;\nfont-family: Tahoma, Verdana, Arial, sans-serif; }\n</style>\n</head>\n<body>\n<h1>An error occurred.</h1>\n<p>Sorry, the page you are looking for is currently unavailable.<br/>\nPlease try again later.</p>\n<p>If you are the system administrator of this resource then you should check\nthe error log for details.</p>\n<p><em>Faithfully yours, nginx.</em></p>\n</body>\n</html>\n" }'
k
The repeated restarts of Airbyte v2 OSS pods (airbyte-worker, airbyte-server, airbyte-connector-builder-server, airbyte-cron, airbyte-workload-api-server, and airbyte-workload-launcher) and the resulting HTTP 502 errors are commonly linked to misconfiguration of authentication tokens between the worker and workload API server components. Root Cause: A frequent issue is that the
WORKLOAD_API_BEARER_TOKEN
(and sometimes
WORKLOAD_API_AUTH_HEADER
) environment variables are not set to the same value across the relevant deployments. This causes authorization failures (401 errors) between the worker and workload API server, which in turn leads to failed job launches and 502 errors in the UI. This has been reported and resolved in several user cases for Airbyte v2 OSS on Kubernetes and Docker, especially when using
abctl
or similar orchestration tools. How to Fix: 1. Generate a Bearer Token:
Copy code
bash    BEARER_TOKEN=$(openssl rand -hex 16)    echo "Generated token: $BEARER_TOKEN"
2. Set the Token on All Relevant Deployments:
Copy code
bash    kubectl -n airbyte-abctl set env deployment/airbyte-abctl-worker \      WORKLOAD_API_BEARER_TOKEN="$BEARER_TOKEN" \      INTERNAL_API_AUTH_TOKEN="$BEARER_TOKEN"     kubectl -n airbyte-abctl set env deployment/airbyte-abctl-workload-api-server \      WORKLOAD_API_BEARER_TOKEN="$BEARER_TOKEN"     kubectl -n airbyte-abctl set env deployment/airbyte-abctl-server \      WORKLOAD_API_BEARER_TOKEN="$BEARER_TOKEN"
3. Restart the Deployments:
Copy code
bash    kubectl -n airbyte-abctl rollout restart deployment airbyte-abctl-worker    kubectl -n airbyte-abctl rollout restart deployment airbyte-abctl-workload-api-server    kubectl -n airbyte-abctl rollout restart deployment airbyte-abctl-server
4. Wait for the pods to become healthy:
Copy code
bash    kubectl -n airbyte-abctl get pods
This process ensures that all components use the same authentication token, allowing them to communicate properly and preventing the 502 errors and restarts. This solution has been confirmed to resolve similar issues for other users deploying Airbyte v2 OSS on Kubernetes and Docker environments [see details and user confirmations](https://github.com/airbytehq/airbyte/issues/65567) [and here](https://github.com/airbytehq/airbyte/issues/66692). Note: If you are not using the
airbyte-abctl
namespace or have customized your deployment, adjust the namespace and deployment names accordingly. If after this fix the pods still keep restarting, check the logs for each pod for additional errors (e.g., resource limits, database connectivity, or other misconfigurations), but the token mismatch is the most common root cause for the symptoms you described.
d
@kapa.ai But i didn't deploy it with abctl , i deployed airbyte with kubectl like '_helm install airbyte airbyte-v2/airbyte \_ --namespace airbyte-v2 \ # Target Kubernetes namespace --values ./values.yaml \ # Custom configuration values --version 2.0.3 \ # Helm chart version to use --set global.image.tag=1.8.0 # Airbyte version to use'
k
A message from kapa.ai
Thank you for clarifying your deployment method. Since you deployed Airbyte OSS v2 using the Helm chart (not abctl), the namespace and deployment names will differ, but the underlying issue and solution are similar. Key Points from Knowledge Sources: - Repeated pod restarts and HTTP 502 errors are often due to misconfiguration, especially with authentication tokens between Airbyte components (worker, workload API server, etc.) as seen in multiple user reports and GitHub issues. The solution involves ensuring that the relevant environment variables (such as
WORKLOAD_API_BEARER_TOKEN
) are set consistently across all related deployments. This is not limited to abctl deployments; it can also affect Helm-based Kubernetes installations if the tokens are not aligned [see user confirmations](https://github.com/airbytehq/airbyte/issues/65567) [and here](https://github.com/airbytehq/airbyte/issues/66692). - The official documentation does not provide explicit steps for setting these tokens in Helm-based deployments, but user reports confirm that the same root cause and solution apply. What You Should Do: 1. Generate a Bearer Token:
Copy code
bash    BEARER_TOKEN=$(openssl rand -hex 16)    echo "Generated token: $BEARER_TOKEN"
2. Set the Token on All Relevant Deployments: Replace
airbyte-v2
with your namespace and use the correct deployment names (e.g.,
airbyte-worker
,
airbyte-workload-api-server
,
airbyte-server
, etc.):
Copy code
bash    kubectl -n airbyte-v2 set env deployment/airbyte-worker WORKLOAD_API_BEARER_TOKEN="$BEARER_TOKEN"    kubectl -n airbyte-v2 set env deployment/airbyte-workload-api-server WORKLOAD_API_BEARER_TOKEN="$BEARER_TOKEN"    kubectl -n airbyte-v2 set env deployment/airbyte-server WORKLOAD_API_BEARER_TOKEN="$BEARER_TOKEN"    # Repeat for other relevant deployments if needed
3. Restart the Deployments:
Copy code
bash    kubectl -n airbyte-v2 rollout restart deployment/airbyte-worker    kubectl -n airbyte-v2 rollout restart deployment/airbyte-workload-api-server    kubectl -n airbyte-v2 rollout restart deployment/airbyte-server    # Repeat for other relevant deployments if needed
4. Monitor Pod Status:
Copy code
bash    kubectl -n airbyte-v2 get pods
If the issue persists: - Check the logs of the restarting pods for more specific errors (e.g., database connectivity, resource limits, or other misconfigurations). - Ensure your
values.yaml
is correctly configured for your environment, especially for database and storage settings. Summary: Even though you did not use abctl, the 502 error and pod restarts are most commonly caused by a mismatch in the
WORKLOAD_API_BEARER_TOKEN
across Airbyte components. Aligning this token should resolve the issue, as confirmed by multiple user reports for Helm-based deployments [see user confirmations](https://github.com/airbytehq/airbyte/issues/65567) [and here](https://github.com/airbytehq/airbyte/issues/66692). If you need more detailed troubleshooting, please provide logs from the failing pods.
d
@kapa.ai i don't have this error in the logs though 'io.airbyte.api.client.ApiException: Unauthorized at io.airbyte.workload.api.client.WorkloadApiClient.workloadCreate(...)' ? Shouldn't i see the Unauthorized error if it's an issue with WORKLOAD_API_BEARER_TOKEN?
k
A message from kapa.ai
You are correct: if the issue is specifically with a mismatched or missing
WORKLOAD_API_BEARER_TOKEN
, you would typically see an
Unauthorized
error in the logs, such as:
Copy code
io.airbyte.api.client.ApiException: Unauthorized at io.airbyte.workload.api.client.WorkloadApiClient.workloadCreate(...)
This pattern is confirmed in multiple user reports where the root cause was a token mismatch, and the logs clearly showed
Unauthorized
errors when the worker tried to communicate with the workload API server ([example](https://github.com/airbytehq/airbyte/issues/65567), [example](https://github.com/airbytehq/airbyte/issues/65574)). If you do not see any
Unauthorized
errors in your logs, it suggests that the root cause of your 502 errors and pod restarts may be different. Other possible causes (based on the knowledge sources) include: - Database connectivity issues - Resource constraints (CPU/memory) - Misconfiguration in your
values.yaml
- Other internal errors not related to authentication Next steps: - Check the logs of the restarting pods (e.g.,
airbyte-worker
,
airbyte-server
, etc.) for any error messages or stack traces. - Look for errors related to database connections, out-of-memory kills, or other exceptions. - If you find a different error message, please share it for more targeted troubleshooting. In summary: If the
WORKLOAD_API_BEARER_TOKEN
was the issue, you should see
Unauthorized
errors in the logs. Since you do not, the knowledge sources suggest you should look for other causes in the pod logs for further diagnosis. If you provide those logs, I can help interpret them based on the available information. Let me know if you have more log details to share!
d
@kapa.ai these are the logs from airbyte-server pod - and airbyte-bootloader is now OOMKilled
k
A message from kapa.ai
Thank you for providing more context. Based on the knowledge sources, here’s what is relevant to your situation: ### 1. OOMKilled (Out of Memory Killed) for airbyte-bootloader When a pod is marked as
OOMKilled
, it means the container exceeded its memory limit and was terminated by Kubernetes. This is a common issue if the memory requests/limits are set too low for the workload. There are several reports of Airbyte pods (including bootloader and worker) being OOMKilled due to insufficient memory allocation in the Helm values or Kubernetes resource settings [see example](https://github.com/airbytehq/airbyte/issues/48816). What to do: - Increase the memory limits and requests for the
airbyte-bootloader
in your
values.yaml
file. For example:
Copy code
yaml   airbyte-bootloader:     resources:       requests:         memory: 1Gi         cpu: 1       limits:         memory: 2Gi         cpu: 2
- After updating, run a Helm upgrade:
Copy code
bash   helm upgrade airbyte airbyte-v2/airbyte --namespace airbyte-v2 --values ./values.yaml
### 2. airbyte-server and Other Pods Restarting Pods like
airbyte-server
,
airbyte-worker
, etc., may also restart if they are running out of memory or if a critical dependency (like the bootloader or database) is not available. If the bootloader is OOMKilled and cannot complete its tasks, it can cause other components to fail or restart as well [see related discussion](https://github.com/airbytehq/airbyte/issues/60318). ### 3. 502 Errors HTTP 502 errors from the Airbyte UI are often a symptom of backend services (like
airbyte-server
) being unavailable, which can be caused by repeated restarts or OOMKills. This is consistent with your symptoms. --- Summary of Actions: - Increase memory (and possibly CPU) limits for the
airbyte-bootloader
and other affected pods in your
values.yaml
. - Apply the changes with a Helm upgrade. - Monitor pod status and logs after the change. If you continue to see restarts or 502 errors after increasing resources, check the logs for other errors (such as database connectivity or misconfiguration), as these are also common causes of such issues. If you can share the specific error logs from the
airbyte-server
pod, I can help further interpret them. But based on the knowledge sources, OOMKilled is a clear indicator that resource limits are too low for your current workload [see example](https://github.com/airbytehq/airbyte/issues/48816).
d
@kapa.ai ok i will update the resources for airbyte-bootloader. I also found this comment do you think i need to also update the liveness and readiness probe? I found that this is due to the liveness probe timeout being too short on less performant machines. You can override these values in the config or disable the probe entirely (useful in dev).
server.livenessProbe
server.readinessProbe - https://discuss.airbyte.io/t/bad-gateway-error-due-to-airbyte-server-constantly-restarting/4176/3
k
A message from kapa.ai
Yes, based on the knowledge sources, it is a good idea to review and potentially update the liveness and readiness probe settings for Airbyte components, especially if you are running on less performant machines or seeing frequent restarts. The Helm chart for Airbyte allows you to configure these probes for each component, including
server.livenessProbe
and
server.readinessProbe
. The default values may be too aggressive for some environments, causing Kubernetes to restart pods that are simply slow to start or respond under load. You can increase the
initialDelaySeconds
,
timeoutSeconds
, or even disable the probes in development environments to reduce unnecessary restarts. For example, in your `values.yaml`:
Copy code
yaml server:   livenessProbe:     enabled: true     initialDelaySeconds: 60     periodSeconds: 20     timeoutSeconds: 10     failureThreshold: 5     successThreshold: 1   readinessProbe:     enabled: true     initialDelaySeconds: 60     periodSeconds: 20     timeoutSeconds: 10     failureThreshold: 5     successThreshold: 1
This approach is supported by the configuration options shown in the knowledge sources, which document how to adjust these probe settings for Airbyte components deployed via Helm [see example configuration](https://github.com/airbytehq/airbyte/issues/49843). So, yes—if you are experiencing restarts and suspect the probes are too strict, increasing their thresholds or disabling them temporarily (especially in dev) is a recommended troubleshooting step.