Skip to content

How to get rid of MWAA lingering errors?

0

Can someone please help me with this issue? We recently upgraded to airflow v3.0.6 and if a python file contained any errors, airflow would still show the errors for a long while even after the dev would have fixed the error and reuploaded the file, causing confusion. I'm unsure what causes it to eventually drop. However, if I try to force some error myself (like a ValueError or an ImportError), upload the file to the specific s3 bucket, the previous false positive is quite quickly replaced by this valid new error. And again if I fix the Value or Import error and reupload the file, it will still remain as a flag in the UI. We were on 2.6.3 before this and never experienced this issue. I'm curious if there's any fine-tunning setting I might have missed.

Is anyone else experiencing this?

3 Answers
0

This issue with lingering errors in the Airflow UI after fixing DAG files is likely related to how Apache Airflow processes DAGs in Amazon MWAA.

There are a few potential causes and solutions to consider:

  1. DAG Processing Time: In Amazon MWAA, new DAG files typically take about 300 seconds (5 minutes) to be processed, while updates to existing DAGs take around 30 seconds. The lingering errors you're seeing might be due to this processing delay.

  2. Resource Contention: High CPU and memory utilization in the scheduler, web server, or worker components can cause issues with DAG processing. Check your CloudWatch metrics for CPUUtilization and MemoryUtilization to see if resource constraints might be causing delayed processing.

  3. Complex DAGs: Complex DAGs can contribute to processing issues. Consider optimizing your DAGs by:

  • Moving imports and logic inside task functions when possible
  • Avoiding heavy data processing in Apache Airflow workers
  • Creating an .airflowignore file to exclude unnecessary DAGs from processing
  • Avoiding calling Apache Airflow variables in top-level code
  1. Python Interpreter Setting: Ensure that core.execute_tasks_new_python_interpreter is set to True in your Airflow configurations. This parameter is activated by default but confirming it might help.

  2. Environment Class: If the issue persists, consider upgrading your environment class to provide more resources for DAG processing.

To troubleshoot further, you could monitor the scheduler logs in CloudWatch for any errors related to DAG processing, and consider implementing some of the DAG optimization practices mentioned above.
Sources
Resolve MWAA SIGTERM SIGKILL errors | AWS re:Post
Amazon MWAA frequently asked questions - Amazon Managed Workflows for Apache Airflow
Resolve tasks stuck in running state in Amazon MWAA environment | AWS re:Post
Troubleshoot Apache Airflow UI access issues in MWAA | AWS re:Post

answered 7 months ago

    1. As I mentioned updates to the same dag are being reflected in the UI. If I replace the previous error with a new one, it gets updated, if I fix the error, I can see the dag gets updated and is now usable but the UI still shows a false positive error...an echo. So dag processing time is not the issue
    2. I have the same environment class (mw1.medium) as when it was running 2.6.3 and while the older version has about 90 complex dags, I started off with 3 when I began noticing this bug. So it's not this.
    3. Similar to my previous answer I started off with 3 dag migrations initially which were the simplest...like just a Dummy (Start) >> GlueOperator >> Dummy (End) when I started seeing this issue. So it's not this either.
    4. Will give it a try but you said it yourself this is activated by default so what good would "confirming" it do?
    5. Lol. Nice try but you're not upselling me.

    As mentioned, this is more of an UI issue than an operational one by the looks of it. For example if I have a valid ImportError in a dag, that dag is not visible in the UI so I can't use it. If I fix the import error, the dag becomes visible, I can trigger it, but the UI still shows there's an ImportError so it is most likely a bug and not by design.

0

Hi

  • The MWAA lingering error issue might occur because Airflow's web server doesn't automatically refresh when DAG errors are resolved, it depends on the scheduler to reserialize DAGs, which may not complete properly after fixes and which is resulting to the web UI to display cached errors.[1]

  • The quickest solution is to force an environment restart by making any minor configuration change in the MWAA console, which triggers a full restart and clears cached errors. You can also diagnose the issue by checking CloudWatch DAGProcessing logs to see if the scheduler is still detecting errors.

  • The most impactful setting for your issue is likely dag_processor.min_file_process_interval, reducing this from 30 to 10 seconds will make the processor check for file changes more frequently, clearing errors faster. Setting core.store_dag_code to False forces fresh parsing instead of using cached serialized DAGs.

https://airflow.apache.org/docs/apache-airflow/3.0.6/administration-and-deployment/dag-serialization.html

Reference: [1] https://repost.aws/questions/QUb7U-sleJQweFauStZcFV7Q

AWS

answered 7 months ago

0

Hello!

The quickest solution is to force an environment restart by making any minor configuration change in the MWAA console, which triggers a full restart and clears cached errors.

It doesn't help.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.