From SIGILL crashes to zombie tasksโone checklist to rule them all
The Nightmare Scenario
You've just deployed your Airflow DAG on macOS. Everything looks perfect in the UI. You hit "Run", and then... nothing.
The symptoms:
- Task starts โ hangs for minutes โ scheduler marks zombie/failed
- Scheduler log shows:
Task exited with return code -4
Detected zombie job ...
- Nothing ever prints past the first
requests.get()
Sound familiar? You're not alone.
After weeks of debugging LocalExecutor issues on macOS, I discovered three silent killers that were sabotaging my workflows. Below is the exact three-step checklist that took my DAG from broken to blazing in under 30 seconds.
1. The macOS Proxy Phantom ๐ป
The Problem:
macOS silently routes all HTTP traffic through networkserviceproxy
. If that proxy stalls (or becomes unreachable), requests.get()
never returnsโyour tasks hang indefinitely.
The Symptoms:
- Tasks hang on any HTTP request
- No error messages, just eternal waiting
- Works fine on Linux, breaks on macOS
The Fix:
Export once, forget forever:
# In the shell that launches airflow
export NO_PROXY="*"
# Make it permanent
echo 'export NO_PROXY="*"' >> ~/.zshrc
Why this works: This bypasses macOS's network service proxy entirely, allowing direct connections.
2. The Objective-C Fork Bomb ๐ฃ
The Problem:
LocalExecutor (and Celery) fork workers to run tasks. On macOS 14 + Python 3.11, libdispatch
crashes inside child processes with:
objc[...] BUG IN CLIENT OF LIBDISPATCH... SIGILL
The Symptoms:
- Tasks immediately crash with return code -4
- SIGILL errors in system logs
- Works in SequentialExecutor, breaks in LocalExecutor
The Fix:
Set one environment variable:
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
echo 'export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES' >> ~/.zshrc
โ ๏ธ Important: Restart Airflow completely so every worker inherits this setting.
Why this works: This disables Objective-C's fork safety checks that conflict with Python's multiprocessing on recent macOS versions.
3. Memory & Network Time-Bombs ๐งจ
The Problem:
- Full-list API URLs (e.g., Binance
/ticker/24hr
without symbol filter) - No timeout configuration โ hangs forever
- pandas loading 2MB+ JSON โ OOM โ SIGKILL
The Symptoms:
- Tasks hang on large API responses
- Memory usage spikes then crashes
- Inconsistent failures depending on data size
The Fix:
Make your requests tiny, scoped, and streamed:
import requests
import pandas as pd
from typing import Dict, Any
def fetch_data_safely(url: str, params: Dict[str, Any] = None) -> pd.DataFrame:
"""Fetch data with proper timeouts and memory management."""
# Always set timeouts
response = requests.get(
url,
params=params,
timeout=(10, 30), # (connect_timeout, read_timeout)
stream=True # Don't load everything into memory
)
response.raise_for_status()
# Process in chunks to avoid OOM
data = response.json()
# Filter early, filter often
if isinstance(data, list) and len(data) > 1000:
# Only take what you need
data = data[:1000]
return pd.DataFrame(data)
# Example: Instead of fetching all tickers
# BAD: requests.get("https://api.binance.com/api/v3/ticker/24hr")
# GOOD:
df = fetch_data_safely(
"https://api.binance.com/api/v3/ticker/24hr",
params={"symbol": "BTCUSDT"} # Be specific
)
The Complete Fix Checklist โ
Copy-paste this into your terminal:
# 1. Fix proxy issues
export NO_PROXY="*"
echo 'export NO_PROXY="*"' >> ~/.zshrc
# 2. Fix fork safety
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
echo 'export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES' >> ~/.zshrc
# 3. Restart your shell
source ~/.zshrc
# 4. Restart Airflow completely
pkill -f airflow
airflow scheduler &
airflow webserver &
Why These Issues Are So Sneaky
- They're macOS-specific - Your code works fine on Linux production
- Silent failures - No obvious error messages
- Intermittent - Sometimes work, sometimes don't
- Environment-dependent - Different macOS/Python versions behave differently
Testing Your Fix
Create a simple test DAG:
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime
import requests
def test_http_request():
"""Test that HTTP requests work properly."""
response = requests.get("https://httpbin.org/json", timeout=10)
print(f"Success! Status: {response.status_code}")
return response.json()
dag = DAG(
'test_macos_fix',
start_date=datetime(2024, 1, 1),
schedule_interval=None,
catchup=False
)
test_task = PythonOperator(
task_id='test_http',
python_callable=test_http_request,
dag=dag
)
If this runs successfully with LocalExecutor, you're golden! ๐
๐ Mission Accomplished: From Zero to Hero
These three nuclear-grade fixes completely transformed my Airflow development experience on macOS. No more:
- ๐ซ Mysterious hangs that steal your afternoon
- ๐ซ Zombie tasks haunting your scheduler
- ๐ซ 3 AM debugging sessions fueled by caffeine and desperation
- ๐ซ "It works on my Linux server but not my Mac" embarrassment
๐ฏ The beauty of this approach: These are environment-level fixesโset them once, and every single DAG benefits automatically. It's like giving your entire Airflow installation a permanent immunity boost! ๐
๐ My before/after stats:
As you can see, the image below shows the consecutive 6 failures to the Consecutive 5 Success Executions
As you can see image below from previous Loooong Executions, which failed to Short and Successful Executions
๐ค Join the Victory Squad!
Have you battled other macOS-specific Airflow demons that I missed? Found creative workarounds for edge cases? Drop them in the comments! ๐
Let's build the ultimate macOS Airflow troubleshooting arsenal together. Every shared fix saves countless developers from pulling their hair out!
๐ฅ Bonus points for:
- Obscure M1/M2 chip issues ๐
- Obscure Intel Mac chip issues ๐
- Docker-related macOS quirks ๐ณ
- VS Code + Airflow integration problems ๐ป
- PostgreSQL connection hiccups ๐
๐ Spread the Victory!
Found this guide life-saving?
- ๐ Smash that heart button
- ๐ Share with fellow developers drowning in Airflow issues
- ๐พ Bookmark for your future self (trust me, you'll need it)
- ๐ฃ๏ธ Tag that colleague who's been struggling with macOS Airflow
Remember: Every developer you help with this guide is one less person cursing at their terminal at 2 AM! ๐ดโก๏ธ๐
May your DAGs run smoothly and your tasks never zombie! ๐งโโ๏ธโ
Top comments (0)