Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Airflow s3 connection test intermittent failures #510

Closed
alexander-semenets opened this issue Oct 5, 2018 · 4 comments
Closed

Airflow s3 connection test intermittent failures #510

alexander-semenets opened this issue Oct 5, 2018 · 4 comments
Assignees
Labels
bug [Fixed] for any bug fixes.

Comments

@alexander-semenets
Copy link
Collaborator

alexander-semenets commented Oct 5, 2018

Airflow S3 connection test fails periodically with next error:

`Documentation: Fails if container contains item one or more times.
20181005 11:26:17.997 / 20181005 11:26:17.997 / 00:00:00.000
`
Airflow worker log has the next error:
`HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 'Date': 'Fri, 05 Oct 2018 09:18:23 GMT', 'Content-Length': '357'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets "airflow-credentials-s3-conn" is forbidden: User "system:serviceaccount:company-a:airflow-company-a-airflow-worker" cannot get secrets in the namespace "company-a"","reason":"Forbidden","details":{"name":"airflow-credentials-s3-conn","kind":"secrets"},"code":403}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/legion_airflow/hooks/k8s_base_hook.py", line 32, in get_connection
return cls._get_conn_from_k8s(conn_id)

File "/usr/local/lib/python3.6/dist-packages/legion_airflow/hooks/k8s_base_hook.py", line 51, in _get_conn_from_k8s
k8s_namespace=os.environ['NAMESPACE']
File "/usr/local/lib/python3.6/dist-packages/legion/k8s/properties.py", line 99, in retrive
instance.load()
File "/usr/local/lib/python3.6/dist-packages/legion/k8s/properties.py", line 347, in load
self._read_k8s_resource_exception_handler(load_exception)
File "/usr/local/lib/python3.6/dist-packages/legion/k8s/properties.py", line 716, in _read_k8s_resource_exception_handler
.format(self.k8s_name, self.k8s_namespace_or_default, exception))
Exception: Cannot read secret 'airflow-credentials-s3-conn' in namespace 'company-a': (403)
Reason: Forbidden
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'X-Content-Type-Options': 'nosniff', 'Date': 'Fri, 05 Oct 2018 09:18:23 GMT', 'Content-Length': '357'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"secrets "airflow-credentials-s3-conn" is forbidden: User "system:serviceaccount:company-a:airflow-company-a-airflow-worker" cannot get secrets in the namespace "company-a"","reason":"Forbidden","details":{"name":"airflow-credentials-s3-conn","kind":"secrets"},"code":403}
Stack (most recent call last):
File "/usr/local/bin/airflow", line 27, in <module>
args.func(args)
File "/usr/local/lib/python3.6/dist-packages/airflow/bin/cli.py", line 438, in run
handler.close()
File "/usr/local/lib/python3.6/dist-packages/airflow/utils/log/s3_task_handler.py", line 77, in close
self.s3_write(log, remote_loc)
File "/usr/local/lib/python3.6/dist-packages/airflow/utils/log/s3_task_handler.py", line 150, in s3_write`

@alexander-semenets alexander-semenets added the bug [Fixed] for any bug fixes. label Oct 5, 2018
@aliaksandr-d
Copy link
Member

aliaksandr-d commented Oct 5, 2018

s3_task_handler.py fails because it uses s3_hook that doesn't take credentials from Kube2IAM. It means that kube2iam doesn't work on Airflow.

@aliaksandr-d aliaksandr-d self-assigned this Oct 5, 2018
@ablatov
Copy link
Member

ablatov commented Oct 23, 2018

@kirillmakhonin
Copy link
Member

Closed by #560

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [Fixed] for any bug fixes.
Projects
None yet
Development

No branches or pull requests

4 participants