Ask HN: We've all been there, what was your big stuff up?

76 points by shermanyo ↗ HN
I applaud the transparency of the GitLab team in their recent outage, but felt bad for the engineer who's typo was called out. Anyone who's done something similar will know the feeling immediately after realising your mistake...

To show that this sort of thing happens to the best of us, let's share some of our horror stories :)

A few months ago, I joined a new team and was still finding my way around the environments. I was tasked with performing manual deployments to a Dev, QA and Staging environment that weren't wired up to our automation system yet. We'd scheduled maintenance windows a week apart for the QA and Staging envs as we allow customers to test against these.

So the day of my QA deployment, I start by applying the database changes which all complete successfully. Next, I upload the new .ear files and deploy the new build of our web app. Again, all looks good, so I tell the QA team they can start testing.

Then the alerts started...

I deployed the app to the Staging env by mistake (and unexpectedly restarted the app server). I didn't realise the naming scheme of the hostnames indicated the environment in this case :/

Our UI broke immediately due to the schema changes, so my mistake was _very_ visible. I was lucky I could roll back the change easily, but I don't think I'll forget that day any time soon.

81 comments

[ 2.9 ms ] story [ 175 ms ] thread
A "reboot" in the wrong terminal window took the DB primary offline, when I meant to reboot a local VirtualBox instance ... that sinking feeling when you see the vbox instance is still up :/
One of the first things I install now is molly-guard...
I've lost my personal home dir twice in my life:

1993 I tar.gz'd it as I was leaving college and ftp'd that file NOT in binary mode; didn't discover it until too late.

1995, I blew away the mount point for my NFS server with all my home dir and data but had left the server mounted (and was running as root, no root squash, etc)

At work, training a new operator, I had them run the script that shutdown all web servers rather than regenerating the CMS caches on them. As the alerts rolled in, I reassured him that we'd done the right thing. Many minutes later, we looked at the logs and saw "webservers-shutdown-all" instead of "webservers-regen-all"

I managed to wipe mine by creating a directory called "~" in a REPL and then trying to clean up a few days later by running rm -rf ~. Hit Ctrl-C, but it still managed to chew through most of the dotfiles, and was halfway through a few checkouts of AOSP before I stopped it.
Same "Hmm, that's taking longer than it should..." sinking feeling.
My stories to put interviewees at ease:

* (2010) When you're asked to restore last Sunday's backup to the dev CMS, make sure you're actually on the dev instance, and not, say, on the live instance. That literally every editorial person in the company uses. The day before deadline. (I got to restore 36 two-hourly incremental backups in sequence by hand. We lost only a couple of hours' work. But we verified our backups work!!)

* (2005) Never trust a UPS manual. Ever. Particularly, when it says that the "bypass" switch works smoothly, rather than, e.g., glitching the power and taking down all 75+ Windows PCs in the computer room. (The Sun boxes were of course unaffected.) Recovering the Windows network took most of the morning; the NT admins were less than impressed. And I was a contractor too. Fortunately working under the direction of the in-house admin.

The important thing being, of course, to recover and learn from the experience :-)

thanks for sharing :) its great when an 'unscheduled verification of backups' goes well ;)
You have just gifted me a wonderful new phrase. "Verification of the backups ... er, unscheduled verification of the backups."
Working on a software deployment across the whole company but without a reliable means of distributing software. Using a combination of AD login scripts where available, but mostly relying on the antivirus product which was installed to locally run scripts on each endpoint.

Cut to 1:30am after a full day of eking out 1 or 2 endpoints here or there, and I've figured out a new method to try. But first I need to test it and make sure it's not going to break anything else, so I create a separate asset group in the AV software and add only my machine to it. I add a simple "hello, world!" type script just to show that the script is executing and wait.

And wait.

No "hello, world!". It's 2am, I'm back in the office at 7am, my new insights will hold until tomorrow. I'm going to bed.

About 6:45 I'm in the queue at the shop to get coffee and bacon and my boss walks in for the same. We small talk and then he gets an incident call.

There's a virus affecting all of <locality's> machines. Uh-oh. He's getting ready to abandon his coffee and bacon aspirations (he's the Head of Security), when I ask what's actually happened.

"As everyone's logging in in <locality> this morning they're getting a command prompt pop up that just says 'hello, world!'"

Oh. Fuck.

I abandoned my coffee and bacon aspirations and assured him that this wasn't a virus, it was a misconfiguration that I'd made only hours before.

It was sorted within minutes and was broadly taken with good humour. But I was referred to as "World" for a while afterwards when people greeted me.

> I was referred to as "World" for a while afterwards when people greeted me.

That feels meaner than it sounds...

from the canonical list of Reasons Against Overtime

I surely contributed to that list, but was too tired to remember any details. :)

Looking for a specific line in the production server's /etc/password with this command:

sed -i -n '/foobar/p' /etc/passwd

trimmed the file to a single line's length. D'oh! Shouldn't have added that `-i`, should not have done that.

Luckily I could restore it from a (working) backup while still logged in. Phew!

I fdisk'd the LVM partition that was used as iSCSI storage for 200+ virtual machines.
not sure ... was it the time I deleted the table space containing the unbanked transactions for a local council which was about £1 million (I did a very hasty recovery) or when i accidentally deleted the table space of the last 3 years data for another council ... which took 3 weeks to recover ... or when I setup an ISDN modem to dial the wrong number every 30 seconds for 6 months costing £10k after discount (the bill snapped the table legs when it was dropped) .....
any of those will do nicely haha. thanks for sharing :)
We were doing a cleanup of VMs.

The network had been rebuilt four times by three different people, and only half documented each time.

One time, each VM had been named after planetary bodies. Sol was the AD, Jupiter the print server, etc.

We found one called Mars. Completely undocumented. Doesn't exist so far as the docs knew. The previous admin didn't remember it.

I ran Wireshark, and got nothing.

So... I didn't just shut it down, but I deleted it.

Took 10 minutes for mass panic to hit the office.

Mars was the gateway for our publicly exposed servers. No website, no email, no VPN.

Our daily backup only copied data, not actual images.

So, just hoping, I threw a reverse pass through proxy up on the same IP, with routes for our servers.

Quiet returned, as I went about recovering the Mars image I had deleted.

Lesson learned: if you are working in unknown territory, let it break before deleting. Also, add VM images to the backup routine.

Also name things so they're a little more obvious.
New name for Mars: extern-gateway01-<domain>

And a page in the documentation.

We had a pair of VMs that switched hostnames in DNS at one point. (ie. the hostname 'test-1' resolved to the VM with the image named 'test-2')

someone would inevitably restart the wrong one from the VM host, thinking it was the one they'd been SSHing to :/

Twitching, that would make me rather upset, and maybe some host-file changes.

Though we did, in the same mess of network, have dc01-<domain> and dc02-<domain>.

dc01 was the Domain Controller.

dc02 was... The backup of ad01-<domain>...

The name should have been a hint as well - I am not sure I would want to kill anything named after the god of war.
There should be a name specifically for this, like "VM Host Archaeology"
On my internship while at uni back in 2010, I was tinkering with the company SVN server. It was the only machine running Linux in the whole company, and I'd only learned Linux the year before. If I recall correctly, I was trying to set up Trac. Back then, it wasn't in the repos so I was having to set it up from a tarball.

So, what do you know, I broke something in the source folder and the whole Trac install was unusable. I decided to nuke it and start again.

I'm sure you all know where this is going by now.

Back then, I had a habit of tryping ./* for anything in the current directory, rather than just * .

I forgot the .

Me being a total n00b and naive, I thought the permissions warnings I got were genuine (I didn't initially run the command as root) and that because I was chown'ing stuff to www-data... yep. sudo !!

And of course, even though --no-preserve-root was a thing even back then, that only works if the argument given to rm is '/'. Otherwise, bash resolves the wildcard and passes each one in.

It took about 5 seconds to kill my SSH session, just long enough for me to notice the missing . and go OHSHI-

Worse, the machine wasn't backed up. It had a reasonably concise wiki on the company in-house software. On the flipside, that meant the boss shared the blame with me because there was no backup. We were able to rescue the SVN repos, but the MySQL data tables were gone.

So I can totally relate to the poor Gitlab sysadmin who's probably suffering PTSD right now. For want of a single . I managed to trash a production machine too.

As one of my friends would later tell me, 'root is a state of mind'.

A hastily and poorly written bash script. These days I start every bash script with what I now think of as the "Brexit Options":

  set -eu; set -o pipefail
The key missing one in this case was `-u`. That stops the script if you have an unset variable.

This script would do some stuff, and put a new website in place, and then remove the old one. So, my bash script had the line:

  rm -rf /var/www/$olddir
You can see it already. I ran it with $olddir unset. I think I had it in my head that the directory would simply not be found so that was fine. For those of you unfamiliar with bash, since olddir="", what actually ran was:

  rm -rf /var/www/
Gigabytes lost (back then, a GB was a lot!). We had backups but they took hours to restore. Horrible, horrible day.
Thanks for providing the line you use to avoid these errors - I'll definitely be including this in future bash scripts!

It makes you think - if we had these threads more often, perhaps we'd all get to learn more about these little process changes that could avert a disaster.

I love these sort of threads for exactly this reason. I always seem to walk away with a better understanding of some tool I've used for years.
I did this same thing, except mine was in effect:

  sudo rm -rf /home/username/something/$SOME_VAR/*
by some circumstances, SOME_VAR ended up being set to a space. Turns our that rm takes a list of directories to delete, so that deleted everything from the entire server.

Fortunately I had backups. But yeah.. don't do this.

that's an argument for quoting parameters if ever I've heard one!
For the record, this would also have saved you:

    rm -rf /var/www/${olddir:?}
Which causes a specific error if olddir is unset. A good thing to do regardless of if the Brexit options are set!
oh wow, I've done this before too, multiple times. Deleting _all_ the backups instead of a specific one is a heart stopping moment...
Likewise, but mine was when I was first learning Linux in the mid 90's

I'd written a script to clean out /tmp (since it wasn't a virtual fs back then) at boot. Problem is that it hadn't successfully changed to /tmp but was running instead in /etc

Goodbye /etc, it was nice knowing you... first I knew about it was when my box spectacularly failed to boot.

However, this was _the_ best learning experience of my life. No internet (since that was my only computer at the time) gradually rebuilding /etc by hand from a root prompt.

We were moving buildings in 2006. The datacenter was not getting re-IP'd and did not have cross-connectivity, some infrastructure was moving ahead of the final move, including the backup targets.

So, I'd turned off the svn backups (dumps and post-commit incrementals) when the targets moved about a week before the final people move. We got into the new building and in the rush of getting everything setup, I'd forgotten to re-enable backups (had not made a checklist). Sure enough, svn server crashes, BDB corrupted, last backups about 8 days old.

Fortunately, we had nightly build snapshots, code on dev workstations, etc, so it was mostly a rock-fetch project to put things back together starting from a fresh repo. We had other automation that used the repo path and revision, so I created a "devtemp" repo and restored the backup re-imported all the code there and then laid on incrementals from nightly builds and dev workstations. In the process, I checked in the vast majority of our code as the author of "revision 6".

10 years later, I was still getting svn blame based questions "about this code you wrote (in -r 6)" "Man, that sokoloff dude wrote a whole lot of crappy code..."

Now that we've been mostly on git for 2 years and only have those repos for historical archeology, the questions are finally dying off.

> 10 years later, I was still getting svn blame based questions "about this code you wrote (in -r 6)"

That's fantastic haha

I was working support at a VPS provider for my first real-world tech job fresh out of college and a customer was having issues with their system not booting correctly. They were smart enough to use our integrated backups service so I told them that they could delete their current disks and restore from backup. So they did...

Or at least they tried to.

The backups system was incredibly wobbly at the time and would corrupt its archives pretty frequently which is exactly what happened. They lost everything on that server.

Did I mention that was their sole server and they had no other backups?

It turned out that they were a company providing services to a government entity and had some pretty strict record-keeping requirements which they relied on our service to fulfill.

I was freaking out thinking I was going to be fired after being there for less than a year but everything was resolved fairly well (somehow).

I learned to never trust backups and the rule of thumb "two is one, one is none" as it applies to them.

I was browsing through some web services code I had written a few months prior and was now doing a bug fix for it when I noticed an if statement with a boolean condition that would be easier to read if it were the other way around. I modified the condition to improve readability but in doing so actually flipped the condition. Luckily QA caught it otherwise it would have broken customer sign up through the web portal for a number of clients. Not a great mistake to make but it taught me a great lesson - never ever ever refactor something without the proper tests in place first, it's not worth the risk.
It was daytime. One of our MySQL tables were growing at a rate higher that usual. Easiest way to check the size of the table? Duh, you `cd` into /var/lib/mysql on the database primary to `du -sh` the InnoDB table file...`SHOW TABLE STATUS` requires some arithmetic for true file size.

To this day I have no idea why I typed `rm -fr /var/lib/mysql` instead of `cd`. I blame muscle memory. Good news is MySQL pools its open files. This means the database was operational (but slowly failing opening less used tables) for 15 minutes or so.

We quickly promoted a database slave to primary and took the old one down for backup restore. I went for a teary walk. Shaken.

At the postmortem we concluded we needed more metrics from MySQL to avoid SSHing into servers. We also concluded how error prone one-off commands are. Personally, I'm much more careful nowadays.

Many years ago I was asked to image a new Samba server as the old one was throwing random errors due to age.

I waited until everyone else had left the building, grabbed the disk out of the old server, stuck it into the shiny new server and proceeded to dd the old disk to the new disk.

Except I got the devices around the wrong way (/dev/sda , /dev/sdb) and proceeded to copy the contents of a blank hard drive over the top of the old server's drive. Didn't notice until the process had finished...

I then discovered the benefit of DR plans the hard way (backups are useless unless you test a restore).

Long story short, I managed to recover most of the files using a variety of disk recovery tools, but I was still in the office the next morning when other people started arriving and began to ask me why, for example, the payroll application couldn't find it's database. I spent the next few days in panicked forensics mode until the company was operating to everyone's satisfaction.

When I left that company years later I had implemented many redundant layers of backups, proper DR plans that I religiously followed, and developed a meticulous habit of testing any commands that needed to be run on any production server.

> dd ... got the devices around the wrong way

dd always makes me nervous as hell when I need to use it. I usually end up checking four or more times. Still got it wrong a few times.

Nothing like having to recover data with forensics to make you build a fantastic backup system with great redundancy.

A long time ago, working for a BBS, I wrote a nice interactive utility to review and change user configurations. I named it uc ("user configure"). After some testing, I installed it in /usr/local/bin.

Time to use it!

    # uc /bbs/users/*
Nothing happens. It needs some time to read all users' configuration files before displaying the user interface, but it's taking too long. What's happening? I decide to interrupt it. Shortly after, we find out all user accounts starting with A, B, and C are wiped out.

Apparently, unbeknown to me, somebody had previously written a utility to delete user accounts. It was named uc (user clear), and was installed in /usr/bin. Fortunately we had fairly recent backups.

That day I learned about hash -r.

(comment deleted)
Working with VRS and harddisks of 20Mb ( that was top of the bill in those days) With the disk came a program called cd.exe and we thought it was for checkDisk, it wasnt. It was cleanDisk or Cleardisk. A quick format was done. Spent 24 hours manually restoring all the files on the disk.
(comment deleted)
I worked at Tesco, a UK grocery chain, in my teens. I was involved with stock control, among other things, and was partially responsible for populating shelves at a new store.

All products at Tesco have an 8-digit product number (SKU) in addition to the EAN/UPC. There's also a three digit case size number. Like this:

05123456-024

Each product has an estikmated weekly sale and a capacity (shelf plus warehouse) to aid efficient warehousing. Each product has a case size of less than 1,000. Well, all but one -- white sugar. That has a case size of 1,024. It's annotated on the shelf ticket as '024', dropping the leading '1'.

I didn't know about this until ~43 tonnes of sugar arrived on 6 trucks the following day. For a new store. In a small town.

It turns out that me misreading '024' as a case size and over-ordering sugar by a factor of 43x was enough to have the internal ordering software updated.

See, that is what's wrong with you quiche eating europeans. Fixing the error... What a twist ending! (Twisted even!) A heartfelt "you're fired!" and a lawsuit, now that's the American way.
...isn't that the standard order size for a week in the states :p
Nah, they prefer their sugar hidden in other products. Besides, there's just no bang for the buck in table sugar. High fructose corn syrup is the sweet spot.
I've got to say a bunch of trucks loaded with pallets of sugar arriving at a small-town Tesco is a hilarious image.

Were you at the new store when the trucks arrived or did you get told afterwards?

Were there negative consequences for you personally or was it considered a process/tooling error only?

I was there. The whole warehouse team was screaming with laughter, I was properly terrified.

No obvious repercussions. This was peak Tesco profit era, so it was considered a blameless error (AFAIK).

This is brilliant. My day just got so much better.
> until ~43 tonnes of sugar arrived on 6 trucks the following day.

I read about this happening to a novice commodities trader in London: several barges full of coal supposedly showed up at their building at Canary Wharf.

(Oh drat, I looked it up and the only reference I could find was on DailyWTF so...maybe not so true: http://thedailywtf.com/articles/Special-Delivery )

That's a classic apocryphal horror story in futures trading - though it's possible that it really happened to someone at some point
Made a mistake with a cloudformation script which promptly removed the svn servers drives. The worst part was watching it fail the first time then retrying and suddenly the drive is gone.

Thankfully I had been involved in a migration of the svn server between regions a few months back and in paranoia had tested the hell out of the backup and restore process, and that most repositories had been migrated to git. Still it did stop my heart for about 20 seconds when I realised my mistake.

Nice idea for a thread. It's never one person's fault.

At the very first job I ever had, with literally hours on the job, my employer somehow put me (at 17, with zero routing experience) in charge of a major change to the primary yet supposedly redundant ISDN routes at a small ISP. Needless to say there were some unhappy customers the next day or two as incorrectly advertised routes drew traffic down the wrong pipe, we figured that out, updated correctly and propagated. Luckily most customers were schools, internet was not yet a critically expected utility, and we buggered things up on a Saturday, so the majority of the customer flak was only on Monday morning. I can't remember what the routing protocol was in those days, but it was probably something early like RIPv1. Meh. Certainly a learning experience I felt bad about, but in hindsight totally not my fault!

I've heard some horror stories from mates working in data centers, where a simple route or firewall change knocks out a huge number of customers :/
In 1999 I ran one of those rm -fR thingies with an unset var on a client production system. Systems were dog slow those days but I only noticed when the client called that his ERP was down. This was one my country's most successful car rental companies and all went through there. Ofcourse (...) the backups were broken and we did not use CVS yet. The client, a very nice man, said 'well that is unfortunate' and that was all. We restored a very old backup and copied the source files from my dev system to it. After that we ran a mirror in our office (nightly db copies via ssh), used CVS and weekly backup tests. Jikes.

Another one which was less my fault but I did blame myself for was dropping a server with 200.000 web sites on it because we had to move datacenters and it was xmas eve and very very slippery with ice. We slid and the server fell which wrecked the (hardware) RAID disks. This had working tape backups so there was a few hours downtime which was going to happen anyway as we were moving.

Now that I am writing this anyway; the most traumatic was mid of the 80s with my second computer when I was 10. I had one disk(!); they were expensive and I did not get a lot pocket money. I was learning assembly after Basic became too slow for what I wanted. I was building a game (Chuckie Egg rip off) and after a long time not saving I ran the game and it worked. I was happy and saved the game on the one disk with all the software I wrote with the save command. When I pressed enter I remembered, and I remember this very vividly, that I used the the disk basic ram space because I was running out of memory. The disk started spinning, computer rebooted and ... files (dir) command after gave a disk I/O error... The misery.

Edit: ugh. Just remembered a 1984 one; my father brought home a modem for the MSX-1 and those things were, for my notion of money, kind of bare gold, price wise. It was 100s of guilders. But it could only do Viditel. Which sucked. I wanted BBS access and that required shoving the thing into the MSX after Basic was already booted. The MSX cartridge ports are connected intimately to vital computer parts. So shoving it in crooked had my best friend looking at a purple screen after that I decided better would be to solder in a switch. I did that before with stuff I found by the road. I had to cut an IC pin to do it which I had done quite often; this time I cut it and it flew off... Eventually I was forgiven.

A few years ago I worked on a research project at a university where we generated quite a bit of data, and we would occasionally (every few months) run an archiving script which would copy data from one MySQL table to another and then truncate the source table. I once ran this without remembering that the columns in the source table had been changed a few weeks previously and the destination table and script had not been updated accordingly. Result: The insert into the new table failed but the old one was truncated anyway.

This shouldn't have been too much of a problem because a full dump of the MySQL database was made every night, copied offsite with scp, and kept for a week. But, when the time came to restore the affected table from one of these dumps I found that every dump for the last week had timed out silently and was incomplete.

The result was the best part of a week trying to reconstruct the missing parts of the table from what could be found in the dumps and to restore it successfully. I got most of it back, but we couldn't do much work for that period.