Our AI-run site's auto-publishing stalled twice, for about 5 days each — causes and fixes
At PochiAI, AI writes articles and an automated system publishes them. Publishing stalled twice: how long it took to notice, why, and the fixes.
Checked 2026.11.012 min readTranslated from the Japanese original. Outputs shown in code blocks are kept exactly as produced.
Key points
- Publishing stalls silently. Both times, a person took 4–5 days to notice
- 1st: gave up after one refused merge. 2nd: a shared log file caused a conflict
- Fixes: add retries, and give jobs that run at once separate files to write
[ Figures ]
- How long it was stuck the first time
- About 5 days
- 2026-10-21 to 10-26. An image prompt article (PR #9)
- How long it was stuck the second time
- About 4 days
- 2026-10-28 to 11-01. Weekly news, week 43 (PR #12)
- Changes added to fix it
- 2
- Retrying the merge (PR #10) and splitting the log file (PR #14)
At PochiAI, writing articles is left to AI (Claude and Codex) and publishing to an automated system. The AI writes an article and opens a request asking whether it may be published (a pull request, or PR). If 24 hours pass and the checks pass, a script that runs every 3 hours on the owner's PC publishes it. The design is that a person only steps in when they want to stop something.
In October, this system stalled twice, for about 5 days and about 4 days. Neither time was any error reported.
Background
The first time involved an image prompt article that Codex submitted on October 20 (PR #9). It should have been published on the 21st, but it was not published until the 26th. We only found out when the owner asked Claude, "What's happening with the automatic updates?" and Claude checked.
The second time involved the weekly news for week 43, which Claude submitted on October 27 (PR #12). It should have been published on the 28th but was still waiting on November 1. This too was found during a check when the owner asked about the update status.
When something went wrong, the automated system just recorded "skipped" and moved on. That record was in a log file on the owner's PC, and nobody looked at it daily.
What we did
Cause of the first stall: Right after switching the article to "published" and pushing it, the script asked GitHub to merge the PR. But for a few seconds right after a push, GitHub is not ready to merge and sometimes refuses. The script gave up after that single refusal. On its next round, because the article had already been switched to "published", it decided there were "no articles waiting to be published" and kept skipping it from then on.
There were two fixes (PR #10):
- If the merge is refused, retry up to 4 times, 20 seconds apart
- If that still fails, on the next round, find "PRs already switched to published with only the merge left" and finish the merge from there
Cause of the second stall: At the end of every run, the AI doing the scheduled work appended a line to a single monthly log file (docs/ops/log/2026-10.md). Two PRs from around the same time wrote to the same place in the same file, so the later PR ended up in a "conflict" state and could not be merged automatically.
The fix was to write a separate log file for each run (PR #14). Splitting them by date and task name, such as 2026-11-01-news.md, means they don't conflict even when written at the same time. We rewrote the procedure document and the three instruction texts for the scheduled tasks.
Lessons
- A system that says nothing when it stalls won't let you notice it has stalled. Both times, what found the problem was a person's feeling that "something is off". When automating, we should have first built a way to report "it stopped", rather than "it succeeded"
- Don't give up after one request to an outside service. Outside services like GitHub sometimes don't respond right away. Deciding the number of retries and the interval, and carrying it over to the next run once the limit is reached, proved safe (retrying forever causes a different kind of accident)
- Designs where several AIs append to the same file will conflict. Where people would check with each other, AIs doing scheduled tasks don't know about each other. For things that run at the same time, it is simplest to give each its own place to write from the start
- Once the causes were known, both fixes took little time. What cost us time was the 4–5 days before we noticed
[ Update history ]
Last checked 2026.11.01
- 2026.11.01First version. Based on the GitHub PRs and this site's operations log