baolsen commented on issue #16770: URL: https://github.com/apache/airflow/issues/16770#issuecomment-944336930
Hi there If you are using an "assume_role"/similar with the aws hook then the credentials _should_ automatically refresh. I tested it using normal boto3 clients but have not tested using a waiter, like what the ECS operator uses. Maybe try add some logging lines to the aws base hook if you can, to see if the expected assume role and refresh credentials methods are being called. Regards On Fri, 15 Oct 2021, 15:22 ss-nef, ***@***.***> wrote: > Hello, > > I am not able to understand how to enable the automatic refresh when using > the ECSOperator to orchestrate Fargate Containers. > > The container I am running is taking more than one hour to complete its > task, which is why I am getting the following error when using the > ECSOperator: > > Traceback (most recent call last): > File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1157, in _run_raw_task > self._prepare_and_execute_task_with_callbacks(context, task) > File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1331, in _prepare_and_execute_task_with_callbacks > result = self._execute_task(context, task_copy) > File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1361, in _execute_task > result = task_copy.execute(context=context) > File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/amazon/aws/operators/ecs.py", line 220, in execute > self._wait_for_task_ended() > File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/amazon/aws/operators/ecs.py", line 293, in _wait_for_task_ended > waiter.wait(cluster=self.cluster, tasks=[self.arn]) > File "/home/airflow/.local/lib/python3.8/site-packages/botocore/waiter.py", line 53, in wait > Waiter.wait(self, **kwargs) > File "/home/airflow/.local/lib/python3.8/site-packages/botocore/waiter.py", line 334, in wait > raise WaiterError( > botocore.exceptions.WaiterError: Waiter TasksStopped failed: An error occurred (ExpiredTokenException): The security token included in the request is expired``` > > > what setting do I need to set to enable automtic refreshing, so that the waiter can wait for longer than one hour? > > — > You are receiving this because you were assigned. > Reply to this email directly, view it on GitHub > <https://github.com/apache/airflow/issues/16770#issuecomment-944298277>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AGLEIY2ML7DTDURJDTVAH5LUHATKDANCNFSM47WJHO5A> > . > Triage notifications on the go with GitHub Mobile for iOS > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> > or Android > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. > > -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
