53

had this bizarre issue where a backup script ran fine monday through friday but failed every saturday. took me way too long to figure out.

turns out the script was calling an internal API that had rate limiting. during the week, the backup ran at 2am when nobody was using the system. on saturdays, some other batch process kicked off at the same time and ate up all the API quota.

the fix was dead simple — stagger the start time by 30 minutes. but finding the cause? that was a couple hours of my life I'm not getting back.

moral of the story: if your cron job is failing intermittently, check what else runs at the same time. crontab -l only shows YOUR crontab. other users and system crontabs in /etc/cron.d/ might be competing for the same resources.

you are viewing a single comment's thread
view the rest of the comments
[-] ctrlzee@lemmy.world 7 points 13 hours ago

Loved the replies. Once it’s over (that’s the hard part), everyone has a funny story to tell!

Mine was a race condition in an outsourced core system that showed up about six months after release, only when enough transactions hit at the same moment. The contact centre was on fire, with people calling non-stop.

Same lesson as yours: when something fails only sometimes, stop staring at the code and look at what else is running at that moment.

this post was submitted on 16 Nov 2026
53 points (93.4% liked)

Programming

29290 readers
387 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS