Your Disk Has Room. Your Agent Still Can't Create One More File.
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.
Ideas, experiments, and systems for building profitable AI workflows.
By MarketMai
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.
A synthetic customer set lets you test AI agents against messy, realistic cases without touching real people. Here is how to build one, what to put in it, and how to keep it honest.
When a small agent box runs out of memory, Linux quietly kills a process to survive, and it is often the one you care about most. Here is how to tell if it happened, see who is eating the RAM, and set limits so the right thing dies first.
A crashed agent leaves its lock file behind and every future run quietly skips. Here is how to build lock files that expire, prove liveness, and fail loudly instead of silently blocking your automation.
A home agent box with the wrong time fails in confusing ways: TLS errors, rejected API tokens, jobs that fire late, and logs you cannot line up. Here is a 15-minute check that proves your clock is right and stays right after a reboot.
When an API says 'slow down,' most agents hammer it harder. Here is a practical backoff, jitter, and budget policy for unattended agents that share quotas across cron jobs.
Your agent box runs fine until the power blinks or an update restarts it. Here is a 20-minute reboot test that shows what comes back on its own, what silently doesn't, and how to fix it before the next outage.