It seems to be a race for s3 auth during the task manager initialization process. The task manager fails to start because of the below issue. The job manager will stop the existing one and start a new one afterwards. Depending on the luck, sometimes it takes 2 or 3 tries but when it is unlucky it can take more than 10 tries. I am running Flink 1.17.
No AWS Credentials provided by DynamicTemporaryAWSCredentialsProvider WebIdentityTokenCredentialsProvider