Your Agent's Browser Jobs Finished. The Chrome Processes Didn't.
Headless Chrome left running after agent browser jobs? Count the orphans, clean up safely, kill the whole cgroup on timeout, and add a fail-closed preflight.
Ideas, experiments, and systems for building profitable AI workflows.
By MarketMai
Headless Chrome left running after agent browser jobs? Count the orphans, clean up safely, kill the whole cgroup on timeout, and add a fail-closed preflight.
Overnight agent jobs crawl or time out with no crash and no OOM line? Confirm swap thrashing on a Pi, get safe relief, cap memory, and add a preflight.
Fix a self-hosted agent that fails with EADDRINUSE: find what holds the port or socket, free it safely, keep one owner, and add a fail-closed preflight.
Git refuses your agent's repo with 'detected dubious ownership'? Confirm the owner mismatch, chown to the job user, and add a fail-closed preflight.
Wi-Fi power save can sleep your Pi's radio overnight while the agent stays green. Confirm it with iw, turn it off, persist it, and add a preflight.
If your agent's data disk mounts late, jobs write to an empty mountpoint on the SD card. Confirm it, recover hidden files, and add a fail-closed preflight.
Agent says 'No space left on device' but df -h shows free space? Confirm inode exhaustion, find file-count hogs, clean up safely, add a preflight.
Long-running agent failing with Too many open files? Confirm EMFILE from /proc, find the descriptor leak, set LimitNOFILE, and add a fail-closed preflight.
Ping works and healthchecks are green, but every API call fails name resolution. Confirm it's DNS, fix the cause, and add a fail-closed preflight.
Restart=on-failure isn't a safety net by default. Fast crashes hit systemd's start limit and stay dead; slow ones loop forever. Set bounded restarts and alerts.
When a cron job and a long-running agent share one SQLite file, writes fail with 'database is locked' and scripts exit 0. Use WAL, busy_timeout, and BEGIN IMMEDIATE.
Cron and systemd agent jobs that never finish are often stuck on a hidden git, ssh, apt, or npx prompt. Find it, reproduce it, and make every tool fail fast.
Slow nights, random timeouts, and SSD dropouts on a Pi running agents are often power or heat. How to detect throttling, log it, alert, and fix the cause.
When a self-hosted agent script runs fine over SSH but fails or does nothing under cron or a systemd timer, the scheduled environment is different; here is how to capture it, reproduce it, and write jobs that carry their own PATH, env, and working directory.
Raspberry Pi SD card read-only? Confirm the remount, find the cause in dmesg, back up and image the card, then stop agent jobs from failing silently.
A self-hosted publish job can exit 0, log success, and still ship nothing when a leftover staged file made the working tree dirty. Here is how to detect dirty trees before the job starts, fail loudly when they block a write, and recover without inventing a second post.
Opening port 22 on your router so you can fix your agent from your phone is the riskiest shortcut on a home agent box. Here is how to reach a self-hosted agent from anywhere with Tailscale SSH, lock access down with ACLs, and keep the approval step from blocking a 7 a.m. fix.
When you move an agent job to a new scheduler, the old one usually keeps running. Here is how to list every place a job can be scheduled on a self-hosted agent box, spot the duplicates, and retire the old copy without losing the one you meant to keep.
Green cron status only proves a job started. A canary task with a known answer proves your self-hosted AI agent can still read, reason, call tools, and write results. Here is how to build one in an afternoon.
Self-hosted agents break overnight more often from a floating npm or pip version than from anything you changed. Here is how to pin every dependency your agent and its scripts use, upgrade on purpose, and roll back in one command when an update goes bad.
Tool outputs get cut off by byte limits, row caps, and context budgets, and the agent keeps going as if it saw everything. Here is how to make truncation loud, countable, and impossible to ignore.
Most home agent boxes run the agent as the main login user, with sudo, SSH keys, and every file on the machine in reach. Here is how to move it to a dedicated service user with a systemd sandbox in under an hour, without breaking the jobs it already runs.
A scheduled agent job that hangs does not fail, it just stops reporting and starts stacking. Here is how to give every run a hard time limit, a single-instance lock, and a clear terminal state.
A home agent box that never gets patched is a risk, and one that patches itself at the wrong moment breaks your morning jobs. Here is how to set up automatic security updates on a Pi or mini PC so they land on your schedule, skip what they should, and tell you when a reboot is due.