Comments (9)
No , I use community edition and I have customized the xcom code to solve this problem
from airflow.
Also found this github thread, shall we implement this : kubernetes-client/python-base#190 (comment)
from airflow.
@potiuk , Can you please guide us on this ? I'm not able to find a solution for this. This occurs intermittently and works on next retry. If you require further information on this , I'll be able collect the logs.
from airflow.
I can confirm that the issue is solved with the below code , we have added this as custom extract_xcom :
This is also mentioned here : kubernetes-client/python-base#190 (comment) ,
We didn't have this issue in v2.3.3 , so I believe this PR could have caused the error : https://github.com/apache/airflow/pull/23490/files
def extract_xcom_json(self, pod: V1Pod):
try:
self.log.info(f'Running command... cat {PodDefaults.XCOM_MOUNT_PATH}/return.json')
client = kubernetes_stream(
self._client.connect_get_namespaced_pod_exec,
pod.metadata.name,
pod.metadata.namespace,
container=PodDefaults.SIDECAR_CONTAINER_NAME,
command=[
'/bin/sh',
'-c',
f'cat {PodDefaults.XCOM_MOUNT_PATH}/return.json',
],
stderr=True,
stdin=False,
stdout=True,
tty=False,
_preload_content=False,
_request_timeout=10,
)
client.run_forever(timeout=10)
result = client.read_all()
self.log.info("Received {} ({}) ({} ... {}))".format(type(result), len(result), result[:64], result[-64:]))
# validate it's valid json
_ = json.loads(result)
# Terminate the sidecar
_ = kubernetes_stream(
self._client.connect_get_namespaced_pod_exec,
pod.metadata.name,
pod.metadata.namespace,
container=PodDefaults.SIDECAR_CONTAINER_NAME,
command=[
'/bin/sh',
'-c',
'kill -s SIGINT 1',
],
stderr=True,
stdin=False,
stdout=True,
tty=False,
_preload_content=True,
_request_timeout=10,
)
return result
except json.JSONDecodeError:
message = f'Failed to decode json document from pod: {pod.metadata.name}'
self.log.exception(message)
raise AirflowException(message)
except Exception as e:
message = f'Failed to extract xcom from pod: {pod.metadata.name}'
self.log.exception(message)
raise AirflowException(message)
from airflow.
@paramjeet01 do you have a proposed fix in mind? Can you open a PR?
from airflow.
Any news here? Is there any known workaround while a fix is in the way?
from airflow.
@eladkal yes , I'll create a PR with the above suggest code. I'm afraid that I can't find the root cause of the issue in current code.
from airflow.
@cleivson , you can customise your airflow to call the above mentioned method till we have a fix
from airflow.
@paramjeet01 , thanks. I'm not really sure where to put this. Based on your SO "Amazon Linux 2", am I right to assume you're using MWAA? I'm using it and I was wondering if the bug could be related to the environment
from airflow.
Related Issues (20)
- Visible Secrets in XCOM Outputs HOT 4
- Configuration file not in effect HOT 3
- Airflow Random Failure with SQS HOT 1
- Airflow scheduler gets exit while running application HOT 1
- Emit OL `FAIL` event when manually marking a DAG as failed HOT 1
- DynamoDBToS3Operator using native export functionality. HOT 4
- ExternalTaskSensor doesn't check existence in deferrable model HOT 4
- Add a keytab field to the Spark connection (handle the base64 encoded text value as a credential). HOT 2
- Status of testing Providers that were prepared on July 12, 2024 HOT 2
- Status of testing of Apache Airflow 2.9.3rc1 HOT 12
- Using the @task.external_python() to call a task in a venv fails due to attempting to import airflow and other packages not in the external venv HOT 2
- Exception when using session object in CustomPriorityWeightPlugin
- Dependent DAG Based schedules HOT 3
- soft_fail | operator is skipped in all cases and not only "data" related fail HOT 11
- DatabricksRunNowOperator failing as named parameters Jinja templating not getting resolved HOT 10
- AWS SNS Sensor HOT 3
- OpenLineage: Add AirflowRunFacet to DAG run events HOT 1
- Support named mapping for task group HOT 10
- Remove StatsD and replace it with Open Telemetry as first-class citizen HOT 10
- Setting podAnnotations for workers also adds them to other deployments such as scheduler HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airflow.