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

Parameter invalid (cluster) in amazon-> operator -> EcsRunTaskOperator when using deferrable #40207

Closed
2 tasks done
frantoja opened this issue Jun 12, 2024 · 3 comments · Fixed by #40482
Closed
2 tasks done
Assignees
Labels
good first issue kind:bug This is a clearly a bug provider:amazon-aws AWS/Amazon - related issues

Comments

@frantoja
Copy link

Apache Airflow Provider(s)

amazon

Versions of Apache Airflow Providers

No response

Apache Airflow version

2.8.1

Operating System

AWS MWAA

Deployment

Amazon (AWS) MWAA

Deployment details

No response

What happened

I have a custom class inheritance from EcsRunTaskOperator.
When I set deferrable = True, the Airflow task runs and changes to the deferred state successfully and also the ECS task runs successfully. However, when it returns (TaskDoneTrigger - task finished), the method execute_completes -> self._after_execution() -> self._check_success_task() -> response = self.client.describe_tasks(cluster=self.cluster, task=[self. arn]) shows an error:

botocore.exceptions.ParamValidationError: Parameter validation failed
Invalid type for parameter cluster, value: None, type: <class 'NoneType'>, valid types: <class 'str'>

What you think should happen instead

I believe (and tested) that the variable self.cluster (approximately line 696 in the file airflow/providers/amazon/aws/operators/ecs.py) "looses the value"

How to reproduce

Set the parameter deferrable to true in EcsRunTaskOperator

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@frantoja frantoja added area:providers kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Jun 12, 2024
Copy link

boring-cyborg bot commented Jun 12, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@jscheffl jscheffl added provider:amazon-aws AWS/Amazon - related issues and removed area:providers labels Jun 22, 2024
@vincbeck vincbeck added good first issue and removed needs-triage label for new issues that we didn't triage yet labels Jun 25, 2024
@vincbeck
Copy link
Contributor

Indeed, the operator EcsRunTaskOperator use some variables that might not have been set when executing execute_complete. Ideally execute_complete should only use information from the event, the executor/worker running execute and execute_complete might (and most likely) be different

@ellisms
Copy link
Contributor

ellisms commented Jun 25, 2024

I'll take it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue kind:bug This is a clearly a bug provider:amazon-aws AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants