<@U04S8PLJWMT> My replication jobs are failing whe...
# replication-ask-ai
m
@kapa.ai My replication jobs are failing when scheduled on AWS fargate profile for eks with the following error:
Copy code
Caused by: software.amazon.awssdk.services.s3.model.S3Exception: The provided token is malformed or otherwise invalid.
I am using IRSA for authentication. My airbyte version is 1.5.7 and deployed it using helm chart on EKS.
k
That S3 error indicates that the AWS credentials the job container is using are invalid/garbled, not that S3 itself is misconfigured. Given your setup (EKS + Helm + IRSA + S3), there are a few known, related issues in the docs and GitHub/Forum threads: 1. Confirm IRSA is actually being used by all Airbyte pods (including workers on Fargate) With Helm, the service account and its IRSA annotation must be at the correct level in
values.yaml
, and all workload pods must mount that service account. Several users hit S3 auth failures when pods were either: - using the node role instead of the IRSA role, or - not getting any service account at all. [[IRSA issue](https://github.com/airbytehq/airbyte/issues/53652); [workload SA issue](https://github.com/airbytehq/airbyte/issues/50979)] Make sure in your Helm values:
Copy code
yaml    global:      serviceAccountName: airbyte-admin      storage:        type: S3        bucket:          log: <bucket>          state: <bucket>          workloadOutput: <bucket>        s3:          region: <region>          authenticationType: instanceProfile   # critical for IRSA    serviceAccount:      annotations:        <http://eks.amazonaws.com/role-arn|eks.amazonaws.com/role-arn>: "arn:aws:iam::<account_id>:role/<Airbyte-role>"
And verify at runtime:
Copy code
bash    kubectl get pod <job-pod> -o jsonpath='{.spec.serviceAccountName}'    kubectl get pod <job-pod> -o jsonpath='{.spec.serviceAccount.annotations.eks\.amazonaws\.com/role-arn}'
If the job pod on Fargate is not using the IRSA-annotated service account, S3 auth will fail. [[IRSA values example](https://github.com/airbytehq/airbyte/issues/53652)] 2. Remove conflicting static AWS credentials from Airbyte pods In one reported case, Helm-based deployments injected
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
(for MinIO/S3 logging) into the server pod, which interfered with S3 access and produced 4xx auth errors. Removing those env vars fixed the issue. [[Invalid Access Key thread](https://discuss.airbyte.io/t/1669)] On EKS/Fargate with IRSA, you generally should not set static AWS credentials on the pods. Check:
Copy code
bash    kubectl exec -it <server-or-job-pod> -- env | egrep 'AWS_ACCESS_KEY_ID|AWS_SECRET_ACCESS_KEY|AWS_SESSION_TOKEN'
If present from your chart overrides or environment, remove them and rely solely on IRSA. 3. Validate the IAM role and trust for your IRSA service account Users who saw S3 permission/auth problems with IRSA resolved them by: - Fixing the IAM role trust policy to allow the specific Kubernetes service account (
airbyte-admin
or your equivalent) to assume the role. - Ensuring the role actually has S3 permissions matching Airbyte’s S3 policy examples. [[IRSA fix comment](https://github.com/airbytehq/airbyte/issues/53652); [AWS S3 policy](https://docs.airbyte.com/platform/deploying-airbyte/infrastructure/aws)] Double‑check: - Trust policy: references the correct cluster OIDC provider and Kubernetes service account. - Permissions: allow the bucket actions Airbyte needs (
s3:ListBucket
,
s3:GetObject
,
s3:PutObject
, etc.) on your Airbyte buckets. [[AWS S3 policy](https://docs.airbyte.com/platform/deploying-airbyte/infrastructure/aws)] 4. Fargate specifics (possible limitation in our sources) The knowledge sources do not explicitly document IRSA + Fargate interaction or “malformed token” on Fargate, only IRSA on EKS nodes. They also don’t cover Airbyte 1.5.7 specifically for this error. I cannot confirm from the provided docs whether there is a known Fargate‑specific bug. Because the error is about a malformed/invalid token, the most concrete, source‑backed steps you can take from above are: - Ensure
authenticationType: instanceProfile
and a correctly annotated service account in Helm values. [[IRSA values example](https://github.com/airbytehq/airbyte/issues/53652)] - Ensure all job pods (including those running on Fargate) actually use that service account and its annotation. - Remove any static AWS credential env vars from Airbyte pods that could override IRSA. [[Invalid Access Key thread](https://discuss.airbyte.io/t/1669)] - Confirm the IAM role trust and S3 policies match the documented patterns. [[AWS S3 policy](https://docs.airbyte.com/platform/deploying-airbyte/infrastructure/aws)] If, after these checks, the error persists specifically only on Fargate, the knowledge sources do not contain further Fargate‑specific guidance; in that case you may want to open or update a GitHub issue with your pod spec, service account YAML, and full S3 stack trace so the team can investigate.
m
@kapa.ai Even if the job pods use the IRSA, I can verify the service account attached to the job pods. But I have checked the envs for the AWS static credential
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
exist on the job pods without any values. E though I haven't specified any of these as I tried to use IRSA.
k
A message from kapa.ai
Those empty
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
env vars are a known Helm‑chart behavior and they can interfere with AWS SDK credential resolution, even when you intend to use IRSA. You can see the same pattern in multiple reports where logs show: >
Unsetting empty environment variable 'AWS_SECRET_ACCESS_KEY'
>
Unsetting empty environment variable 'AWS_ACCESS_KEY_ID'
[[workload SA issue](https://github.com/airbytehq/airbyte/issues/50979); [mysql source check](https://github.com/airbytehq/airbyte/issues/52075)] And in another case, the
airbyte-config-secrets
secret contained zero‑byte
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
entries, while the actual S3 credentials were stored under
s3-access-key-id
/
s3-secret-access-key
instead. [[stuck installing](https://github.com/airbytehq/airbyte/issues/52091)] For IRSA, you should not have these static env vars at all. Given what’s in the sources, the practical, chart‑level fixes are: 1. Remove or avoid the empty AWS secrets/keys that generate those env vars Make sure your
airbyte-config-secrets
secret does not define
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
keys with empty values. It should instead contain the S3 keys under
s3-access-key-id
and
s3-secret-access-key
only if you’re using static credentials; with IRSA you don’t need those either. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] 2. Ensure Helm values are aligned with IRSA usage Your Helm
values.yaml
for storage should explicitly indicate instance profile auth (IRSA) and not provide access keys:
Copy code
yaml    global:      storage:        type: "S3"        secretName: airbyte-config-secrets        bucket:          log: <bucket>          state: <bucket>          workloadOutput: <bucket>        s3:          region: "<region>"          authenticationType: instanceProfile    # critical for IRSA          # Do NOT set accessKeyId / secretAccessKey when using IRSA
[[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] 3. Confirm job pods inherit only the IRSA service account, not static creds You already confirmed the service account is attached; from the similar Helm issues, the missing piece was usually that workload pods either: * had no service account and fell back to node metadata, or * carried (empty or conflicting) AWS env vars that broke auth. [[workload SA issue](https://github.com/airbytehq/airbyte/issues/50979); [invalid access key thread](https://discuss.airbyte.io/t/1669)] After cleaning the secret and values, re‑deploy and check on a job pod:
Copy code
bash    kubectl exec -it <job-pod> -- env | egrep 'AWS_ACCESS_KEY_ID|AWS_SECRET_ACCESS_KEY|AWS_SESSION_TOKEN'
Ideally, with IRSA, you should not see
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
set at all. Because the sources don’t show a direct fix specifically for “empty but present” AWS env vars causing malformed token on Fargate, I cannot state with certainty that this alone is your root cause. But based on the documented Helm/IRSA issues and how AWS SDKs choose credentials, the recommended path is: - Remove those empty AWS envs by fixing
airbyte-config-secrets
and storage values. - Rely solely on IRSA (
authenticationType: instanceProfile
+ annotated service account). If, after that, the Fargate jobs still hit the malformed token error, there isn’t more Fargate‑specific guidance in the provided sources; at that point, opening/updating a GitHub issue with your rendered pod spec and env would be the next step.
m
@kapa.ai here are my helm value configs for s3:
Copy code
storage:
    type: S3 # default storage used
    storageSecretName: "s3-secret"

    # S3
    bucket:
      ## S3 bucket names that you've created. We recommend storing the following all in one bucket.
      log: log-bucket
      state: state-bucket
      workloadOutput: wo-bucket
    s3:
      region: "us-east-1" ## e.g. us-east-1
      authenticationType: instanceProfile
How can I remove the static AWS credentials from replication job pods? The secret in storage doesn't contain anything should I also remove it?
k
A message from kapa.ai
With
authenticationType: instanceProfile
you should not need any static AWS credentials; Airbyte should rely solely on IRSA. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] From the docs and issues, the only documented sources of
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
in pods are: - Kubernetes secrets that define those keys (or S3 keys) and are mounted as env vars. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values); [invalid access key](https://discuss.airbyte.io/t/1669)] - The legacy pattern where S3 credentials were expected under
s3-access-key-id
/
s3-secret-access-key
in a secret referenced by
secretName
. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] Given your values:
Copy code
yaml storage:   type: S3   storageSecretName: "s3-secret"   bucket:     log: log-bucket     state: state-bucket     workloadOutput: wo-bucket   s3:     region: "us-east-1"     authenticationType: instanceProfile
the source-backed steps to “remove static AWS credentials” are: 1. Clean up the referenced secret if you’re using IRSA Since you’re using
authenticationType: instanceProfile
, the storage docs say you only need secrets if you’re using static credentials. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] So you can either: - Empty or delete the
s3-secret
entirely if you don’t need it for anything else; or - At least make sure
s3-secret
does not contain: -
AWS_ACCESS_KEY_ID
-
AWS_SECRET_ACCESS_KEY
-
s3-access-key-id
-
s3-secret-access-key
This prevents the chart from turning those keys into env vars on the pods. The docs explicitly mention those keys when using credentials mode, which you are not using. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] 2. Verify that after redeploy, job pods have no AWS static env vars After updating/removing the secret and upgrading the Helm release, check a fresh replication job pod:
Copy code
bash    kubectl exec -it <job-pod> -- env | egrep 'AWS_ACCESS_KEY_ID|AWS_SECRET_ACCESS_KEY'
With IRSA and no static credentials configured, these variables should not appear. This matches the intended “instanceProfile”/IRSA flow in the storage docs. [[storage values](https://docs.airbyte.com/platform/deploying-airbyte/integrations/storage#values)] The knowledge sources do not show an additional, chart-specific flag to suppress these env vars beyond removing/cleaning the referenced secret and not setting credentials under
s3
in
values.yaml
, so if empty env vars still appear after the above, it would likely require a chart change and you’d need to open/extend a GitHub issue with your rendered pod spec.