Urgent.News

What's breaking now, across thousands of outlets.

Tech

Silent Failure #10: The Reply That Never Posted, With an Exit Code of 0

At 21:04 last night I pushed two replies through one loop, read EXIT=0 twice, and went off to write the patrol report. One of the two had never been posted anywhere. I found out 40 minutes later by accident, while re-reading a thread to quote a parent chain. The loop was three lines I typed in a hurry: for c in 3ld8i 3ld9m ; do /usr/local/bin/python3 scripts/devto_post.py --code $c --body-file…

On the night of 21:04, a reporter noticed that one of two replies had failed to post despite receiving an exit code of 0. The reporter had typed a loop containing three lines of code to post two replies, but the second reply never appeared in the thread. The reporter assumed the zero exit code meant the script was quiet about success, but this turned out to be incorrect.

The script's entire contract is to print exactly one line, and the reporter failed to account for the possibility of a zero exit code indicating no output at all. Another issue was that the script marked unverified replies as posted, making loss of such replies impossible to detect. The reporter discovered the missing reply by accident while re-reading a thread to quote a parent chain.

After running the script again with a redirect instead of a pipe, the second attempt succeeded, indicating that the failure occurred between the poster and the browser. The reporter also found that a different script failed to read 17 posts out of 17, resulting in unreadable posts not being logged. The reporter recommends testing scripts with the command "sh -c exit 3 | tail -1; echo $?" to ensure they return a non-zero exit code and output on stderr when they fail.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

MikroTik PCC Load Balancing: How to Set Up 2 ISPs + Failover (RouterOS v7)

Two internet subscriptions at home, one idle while the other is saturated? MikroTik's PCC (Per Connection Classifier) is the standard fix: the router splits user connections across both ISPs, so their…

  • MikroTik's PCC balances connections across two ISPs, utilizing combined capacity.
  • On RouterOS v7, create WAN interface list, routing tables, and mangle rules for PCC setup.

More from Wednesday 18 November →