News and Happenings

Man accidentally 'deletes his entire company' with one line of bad code

Submitted by Aoki, , Thread ID: 20527

Thread Closed
15-04-2016, 02:19 AM
#1
Quote:A man appears to have deleted his entire company with one mistaken piece of code.

By accidentally telling his computer to delete everything in his servers, hosting provider Marco Marsala has seemingly removed all trace of his company and the websites that he looks after for his customers.

Mr Marsala wrote on a forum for server experts called Server Fault that he was now stuck after having accidentally run destructive code on his own computers. But far from advising them how to fix it, most experts informed him that he had just accidentally deleted the data of his company and its clients, and in so doing had probably destroyed his entire company with just one line of code.

The problem command was "rm -rf": a basic piece of code that will delete everything it is told to. The ?rm tells the computer to remove; the r deletes everything within a given directory; and the f stands for ?force, telling the computer to ignore the usual warnings that come when deleting files.

Together, the code deleted everything on the computer, including Mr Masarlas customers' websites, he wrote. Mr Masarla runs a web hosting company, which looks after the servers and internet connections on which the files for websites are stored.

That piece of code is so famously destructive that it has become a joke within some computing circles.

Normally, that code would wipe out all of the specific parts of the computer that it was pointed at. But because of an error in the way it was written, the code didnt actually specify anywhere and so removed everything on the computer.

?I run a small hosting provider with more or less 1535 customers and I use Ansible to automate some operations to be run on all servers, wrote Marco Marsala. ?Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar} with those variables undefined due to a bug in the code above this line.

Mr Marsala confirmed that the code had even deleted all of the backups that he had taken in case of catastrophe. Because the drives that were backing up the computers were mounted to it, the computer managed to wipe all of those, too.

?All servers got deleted and the offsite backups too because the remote storage was mounted just before by the same script (that is a backup maintenance script).

Most users agreed that it was unlikely that Mr Marsala would be able to recover any of the data. And as a result his company was almost certainly not going to recover, either.


READ MORE
Women write better code than men, study suggests
?I feel sorry to say that your company is now essentially dead, wrote a user called Sven. ?You might have an extremely slim chance to recover from this if you turn off everything right now and hand your disks over to a reputable data recovery company.

?This will be extremely expensive and still extremely unlikely to really rescue you, and it will take a lot of time.

Others agreed that perhaps Mr Marsala was on the wrong forum.

?You're going out of business, wrote Michael Hampton. ?You don't need technical advice, you need to call your lawyer.

Many of the responses to Mr Marsalas problem werent especially helpful pointing out that he could have taken steps to stop it happening before it did.

?Well, you should have been thinking about how to protect your customers' data before nuking them, wrote one person calling himself Massimo. ?I won't even begin enumerating how many errors are simultaneously required in order to be able to completely erase all your servers and all your backups in a single strike.

?This is not bad luck: it's astonishingly bad design reinforced by complete carelessness.

Mr Marsalas problem is far from the first time that someone has accidentally destroyed their own system by missing a mistake. Indeed, responses to his post mostly referenced a similar thread posted two years ago, with the headline ?Monday morning mistake.

That error saw someone accidentally lose access to their entire server, after they didnt notice a stray space in the code.

Source

RE: Man accidentally 'deletes his entire company' with one line of bad code

#2
Yeah, you might wanna be careful with rm -rf / Aoki.

This is hilariously stupid though.
[Image: InZ3hGx.png]

RE: Man accidentally 'deletes his entire company' with one line of bad code

#3
fucking christ.

sounds like someone who would run a command given to them in a linux terminal w/o checking it.

oh wait, thats the exact thing he fucking did.

RE: Man accidentally 'deletes his entire company' with one line of bad code

#4
Welp, retards get what's coming to them. Practice safe terminal usage, folks!

RE: Man accidentally 'deletes his entire company' with one line of bad code

#5
Lol

This is highly retarded...

Why not test out your scripts in a VM before applying them to your server?

RE: Man accidentally 'deletes his entire company' with one line of bad code

#6
A company that manages that many peoples websites should only allow techs to access it, from what I read this guy didn't know what he was doing. Honestly why would you even allow rm -rf to even be used, in addition why where you not backing up your entire database daily, or at least allowing your customers to do it themselves.

RE: Man accidentally 'deletes his entire company' with one line of bad code

#7
Well, he is out of business...

It sucks for him, :(
[Image: oAqtc2l.png]

RE: Man accidentally 'deletes his entire company' with one line of bad code

#8
Lol so people just dont use the command at all everybody makes mistakes so ... :D

RE: Man accidentally 'deletes his entire company' with one line of bad code

#9
Kind of hilarious. But I do feel bad for the guy.
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.

RE: Man accidentally 'deletes his entire company' with one line of bad code

#10
And i thought my provider freaking exit scammed,

Users browsing this thread: 17 Guest(s)