this post was submitted on 16 Apr 2025
25 points (96.3% liked)

Programmer Humor

23536 readers
2005 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

So today I discovered that there's a cron job that holds non-reproducible state that died, and now our system is fucked.

The cron job doesn't live inside any source control. This morning it entered a terminal state, and because it overwrites its state there's no way to revert it.

I'm currently waiting for the database rollback and have rewritten it in a reproducible/idempotent way.

top 28 comments
sorted by: hot top controversial new old
[–] wise_pancake@lemmy.ca 6 points 1 month ago (1 children)

What's extra frustrating is the previous guy did create a git repo of these types of hacks, but this one doesn't live in it for no discernible reason.

[–] Colloidal@programming.dev 5 points 1 month ago (1 children)
[–] wise_pancake@lemmy.ca 6 points 1 month ago (3 children)

He does charge a consulting fee to "fix" these issues

Almost all of them are dumb shit like this, where something is built in super hacky and dumbass ways.

[–] blarth@thelemmy.club 5 points 1 month ago

It’s his kill switch and he forgot to check in.

[–] peregrin5@lemm.ee 2 points 1 month ago* (last edited 1 month ago) (1 children)

Smart man. This is how we fight being replaced by AI.

[–] Agent641@lemmy.world 1 points 1 month ago

Judgement day postponed indefinitely due to "Object reference not set to an instance of an object"

[–] Stanley_Pain@lemmy.dbzer0.com 1 points 1 month ago (1 children)

Super hacky and dumb? Sign me up 😂

[–] swab148@lemm.ee 1 points 1 month ago (1 children)

Me running all my services in tmux

[–] Sherry@programming.dev 1 points 1 month ago (2 children)

that might be a stupid question, but why would you running all services in tmux be a bad idea? a co-worker of mine is doing exactly that right now, which is why I'm asking.

[–] qaz@lemmy.world 2 points 1 month ago* (last edited 1 month ago)
  1. They're all gone when you restart
  2. It doesn't properly deal with logging
  3. You can't set up dependencies between services but that doesn't matter due to point 1

I recommend using systemd services and/or docker compose instead. systemd services are files that describe which program / script to run and when (like after networking is active or after a certain other service is loaded).

[–] swab148@lemm.ee 1 points 1 month ago (1 children)

It's not horrible, like it'll do the job just fine, it's just probably a better idea to use systemd and like, containers and whatnot, but I couldn't be arsed to fiddle with all that for Jellyfin, caddy reverse proxy, and two modded Minecraft servers, so shell scripts and tmux won the day. It takes a little extra time to restart everything after an update, and maybe I'll get the motivation to do things "correctly™" one day, but today is not that day.

[–] mosiacmango@lemm.ee 2 points 1 month ago* (last edited 1 month ago) (1 children)

Use the tmux resurrect plugin. It will restore your tmux session to its previous state after a restart, including programs if you like.

You can put off doing things "correctly™" even longer.

The "here's how you keep doing this poorly but more efficiently" energy on display here is a refreshing change of pace from the usual "here's how you do this correctly" crap peddled by normies (including me). You have my respect.

[–] symbioticremnant@lemmy.world 2 points 1 month ago (1 children)

So do you work for Spotify or Zoom?

[–] lord_ryvan@ttrpg.network 1 points 2 weeks ago

Probably DeepSeek.

[–] arotrios@lemmy.world 2 points 1 month ago* (last edited 1 month ago) (1 children)

This is almost exactly what happened to me on Monday, resulting in a fifteen hour day.

My particular jenga piece was an Access query that none of my predecessors had deigned to document or even tell me about... but was critical to run monthly or you had obsolete data embedded deep within multi-million dollar reports.

Thank god I don't work on salary anymore, or I'd be really upset.

[–] floo@retrolemmy.com 3 points 1 month ago

I stopped reading at “Access” and just wept a silent tear for you.

[–] grrgyle@slrpnk.net 2 points 1 month ago (1 children)

I have also mixed up crontab -l with crontab -r. 😔

Let this be a lesson to start versioning your crontabs.

[–] tiredofsametab@fedia.io 1 points 1 month ago

We never had our crons in source control, but I always saved it somewhere (usually on my machine and the target machine) so we had some history just in case of typing r instead of l for some reason. You can also create an alias called backupCrontab or something that runs the command for you and puts the output somewhere safe.

[–] LainTrain@lemmy.dbzer0.com 2 points 1 month ago (1 children)

Cron job that evals some base64 encoded string which is actually downloading a script from a personal GitHub repo of an IT guy who left...

[–] lord_ryvan@ttrpg.network 1 points 2 weeks ago

And just started cleaning up their GitHub account…

[–] JackbyDev@programming.dev 1 points 1 month ago

Had a similar thing once. Some how, some way, the DBA copied and pasted something wrong. Oracle DB had some odd extra syntax for left and right joins that other DBs didn't (or at least that I'd never seen). My best guess is that he auto formatted out of habit and maybe it took those symbols out.

It took a long time to find that. Because the only evidence something was wrong was that ONE of our customers wasn't being billed for ONE product. Everyone else was fine. Basically they were using it in a very atypical way. The left joins made sure to include them in the billing even because they didn't have whatever was on the right of that join. Everyone else did.

[–] MonkderVierte@lemmy.ml 1 points 1 month ago* (last edited 1 month ago)

Only tangentially related, but "What a elegant house of cards" is an insult i'm going to use someday.

[–] sfled@lemm.ee 1 points 2 weeks ago

Ah yes, good old dependency.

[–] Godort@lemm.ee 0 points 1 month ago (1 children)

Time to restore a whole machine backup to a VM with no network connectivity, and manually pull the command?

[–] wise_pancake@lemmy.ca 1 points 1 month ago

I was able to do that

Turns out there was a second bug which triggered this one, and a bug I found in this script that I thought was responsible was happening silently for months.

Now three bugs are squashed

[–] someguy3@lemmy.world 0 points 1 month ago (1 children)
[–] wise_pancake@lemmy.ca 1 points 1 month ago

Cron is a scheduler to run a program at a set frequency