DEV Community

What's the dumbest bug you caused yourself

Peter Tasker on December 15, 2017

I was thinking about this recently, what's the dumbest bug you've caused yourself? I'll go first. More often then not my code won't work because ...
Collapse
 
ardennl profile image
Arden de Raaij

Editing in development environment while watching another environment for changes that never come. I'm afraid to say I've wasted way too much time wondering why nothing worked.

Collapse
 
hrmny profile image
Leah

Yeah happened to me a lot, or copying a file and then editing the original expecting the copy to change

Collapse
 
sir_wernich profile image
Wernich ️

oh man, similar thing. we have a project that loads two other projects as modules. the one module uses hardlinks so you're able to change the JS/cshtml while it's running. the other project was never set up that way (probably because it was going to be a temporary project). the projects are combined in VS with a "combined" project that has everything in one place so we don't need to run three instances of VS.

so instead of stopping, changing and rebuilding, i would just edit the js/cshtml files that were copied to the main project when everything builds, then copying the changed files back to the project's source directories...

... except when i didn't copy and thought it was safe to rebuild. lost my work so many times. facepalm

Collapse
 
abandonedfridge profile image
Daniel Nielson

How about freaking out over why changes aren't posting to dev only to realize you've been pushing to production... Yeah, me neither...🤫🙄

Collapse
 
ptasker profile image
Peter Tasker

Oh man, so much this.

Collapse
 
kammy_smb profile image
kammy

This has happened so many times to me it's quite embarrassing at this point

Collapse
 
kayis profile image
K • Edited

Classic. Wrong file/folder/server is the first I look when helping a co-worker debugging.

Next: permissions

Also: Caching

(Still happens to me all the time xD)

Collapse
 
ardennl profile image
Arden de Raaij

I like how many people relate. Makes me feel slightly less idiotic 😂

Collapse
 
gregorgonzalez profile image
Gregor Gonzalez

This is really common. Happened to me when I work on multiple projects at same time. Also when I have many copies "app" "app1" "app2" "apptest"

Collapse
 
sabatesduran profile image
Dídac

So many times

Collapse
 
andy profile image
Andy Zhao (he/him)

I dropped test coverage by over 60%, all because I left a setting that focused on running a single test and only that test.

This happened today.

Collapse
 
ben profile image
Ben Halpern

One time I was writing some code and I heard the Mac trash can sound in my headphones and it confused me for a second, but I kind of shrugged it off. A little later I went to commit some code to production and it was a tiny fix and I did git add . and made the push without thinking much. Then I went off to do some other things.

A little later I notice that A CRITICAL IMAGE IS MISSING and that's when I realized what the trash can sound was. I accidentally sent something to the trash as my computer lagged and I clicked some keys while it was frozen.

I HEARD THE TRASH CAN sound and when I put two and two together it was major face palm.

Very sloppy.

Collapse
 
ptasker profile image
Peter Tasker

Lol, yeah the trash can sound is never good...

Collapse
 
frosnerd profile image
Frank Rosner

Neither is git add . :P

Collapse
 
garwan50 profile image
Garwan50 • Edited

Not a big deal but i wrote
curl_setopt($handle, CURLOPT_HTTPHEADER, "Authorization : something");
instead of
curl_setopt($handle, CURLOPT_HTTPHEADER, "Authorization: something");
took me three days and stackoverflow to notice it

Collapse
 
falansari profile image
Ash

ouch XD

Collapse
 
jballanc profile image
Joshua Ballanco

The biggest face-palm bug I've faced was while working on a language runtime. I was implementing a method aliasing feature that, if working correctly, would extract a method from one object and inject it into another. I coded up a solution that should have worked, fired up a REPL, and attempted to hit the new aliased method.

I was promptly greeted by an error with the message "This method does not exist." Crud!

I went back and reviewed my implementation. I tried adjusting some things, moving allocations and dereferencing pointers slightly differently, and yet each time I got the same answer: "This method does not exist." I put in some debug logging statements, but everything looked correct. I stepped through the whole process in a debugger, and still everything looked correct.

At a loss, I randomly decided to look at the implementation of the method I was attempting to alias. Since it was a library method, and not part of the project I was working on, I had to go check out the code and dig in. Eventually, after working out all the complex inheritance and class-cluster implementation details, I found the source of the specific method I was working with. It was, in effect:

fprintf(stderr, "This method does not exist.");
Collapse
 
alephnaught2tog profile image
Max Cerrina • Edited

I just laughed so hard I woke the dog up.

My project for PHP this past semester was a site to track my errors with the idea that eventually you could have multiple users, share them, think of things to look for in your own code, learn, etc. I hadn't thought about the debugging issues that would arise when my code and text was full of the word "error" and oh man, the number of times I would stare at the screen because of the error message that showed up... only to realize that no, that WAS what was supposed to happen, I was TRYING to show those error messages.

Eventually I just added a temporary class to make all of those "error" messages bright green.

Collapse
 
klemensek profile image
klemensek

my cheapest bug in the code:
back in 2005 I needed to send email to 300 customers in two for loops..
so I sent 300 identical emails to each customer, because of index error in second for

Collapse
 
hewerlin profile image
Hendrik Ewerlin

I developed a company-internal social application with LDAP authentication.
I used a code snipplet.
As it turned out, any username with empty password worked just fine. The code snipplet would simply skip password check for "undefined" empty password.
:-o

Collapse
 
falansari profile image
Ash

I nearly made that same mistake last month x'D luckily while I was testing login, I "accidentally" left the p.w field empty when I was trying out different combos. Lo and behold I got in lol! Fixed fast.

Collapse
 
erinlmoore profile image
Erin Moore

I accidentally mis-wrote some CSS, so the animation from an svg loading element bled over to all the svg's on the page. The feature we were working on involved a rating page with a bunch of yellow stars (think amazon reviews) that now all spun around. It delighted everyone and they made me show it to the executive in charge of the whole division.😅

Collapse
 
davidaddario profile image
David Addario

This one time, in band-camp, my login authentication banned the IP address of a user who had 3 consecutive failed login attempts. Out of nowhere, the entire e-commerce site was "down". Needless to say, It took me an entire day to figure out that one of the managers had forgotten his password and banned the outbound IP address for the entire organization. Ugh

Collapse
 
djpallotta profile image
D. J. Pallotta

Forgot to set up a rewind for a segue and wondered why the app dutifully consumed memory no matter how many times the "back" button was tapped. That screen is gone, why are there a dozen copies in memory??!!?

After that adventure I forced myself to learn how to properly use navigation controllers.

Collapse
 
bgadrian profile image
Adrian B.G. • Edited

Every big bug/issue I wrote changed the way I think&code, to avoid them in the future, examples:

  • I don't use negation operator, I'm always explicit if (a == false)
  • I use verbose variables after I've spent many hours on a bug like:
//big event loop, within a huge 2D grid game system
//..lots of code
for (x=0; ..; x++) {
    for(y=0;...;y++{
       //lots of code

       //search for a neighbour
       for(x=...;x..){
        }

    }
}//spend many hours to find out why the map was not rendered correctly

I don't remember the specifics, I think it was a shadowing and not declaring var mix of issue, nevertheless now I will try explicitly to avoid i,j,x,y in loops, and ofc I use linters in big projects and static typed languages :))

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Spent two days debugging a seemingly impossible freeze-crash.

Day two, my non-programmer mother said "I bet you forgot a semicolon somewhere."

Ten minutes of desk-checking later, yup, there it was. Missing semicolon in a for loop, making it infinite.

Collapse
 
sir_wernich profile image
Wernich ️

it took me an hour to figure out why i only sometimes got a certain thing to happen (i can't remember what it was, so let's call it a popup). i'd go through the process of doing what needs to be done and only sometimes the popup worked and i couldn't figure it out.

turns out i shot myself in the foot when i used

if (variable) {
...
}

"that won't work you knob! 0 is a valid value!"

Collapse
 
phlash profile image
Phil Ashby

Shipping critical new crypto code to production with the wrong keys configured, caused a full DR failover as nothing decrypted any more.

Of course this would have been caught in test, if test had any HSMs installed. Who designed those environments you ask? That would be me...

(In my defence, nobody would pay for a £25,000+ HSM outside production, and the supplier didn't have any emulators available)

Collapse
 
telexen profile image
Jake C

I often comment out parts of the beginning of a stored procedure and make it more of a script, then strategically place RETURN; statements one at a time to debug SQL statements within the procedure.

Once in a while, I find the problem, fix it, but forget to remove my RETURN; before saving.

Collapse
 
xputerax profile image
ad

We were migrating a database and my leader told me to create a temporary feature that sends a email containing a new randomly generated password to every email address that was registered on the system.

The thing was I forgot to add the "new" keyword when creating the mailer object as I thought it would create a new instance on every call.

Every time the "feature" sent an email, the email address would be appended to a property of the mailer object. Thus, the previous users (that had been emailed) received the email for the next users and had their inbox spammed. Fortunately it was just some randomly generated password.

What a stupid mistake lol.

(Please forgive my grammar mistakes, if there are any)

Collapse
 
elmuerte profile image
Michiel Hendriks

Adding contextual locking, but forgetting to unlock in case of an exception.
Took a long time for something to go wrong. But when it finally did the application stopped immediately trying to acquire a lock it would never get.

Collapse
 
computersmiths profile image
ComputerSmiths

Recently:
Meant to clean up a development directory with:
rm *~
But missed the tilde

In the past:
Deleted entire directory structure of a CP/M disk and had to rebuild it by hand. Yeah, all my BIOS sources. 😜

Collapse
 
rohithmenon89 profile image
Rohith Kunnath

This was 3 years before : Clients were complaining about freezing of browser after 3 to 4 hours of usage. Debugging helped me to figure out a setInterval inside a closure which was not removed and a TODO note saying TODO : To be removed :)

Collapse
 
antonfrattaroli profile image
Anton Frattaroli

Boolean errors. Always forgetting to add a ! in validation code.

Collapse
 
cabe_bedlam profile image
Gregg Bond • Edited

Integrating some network code for broadcast traffic, the receiver binds to any active network connections (this is important).

I am receiving every packet twice, without fail.

I go up and down through my transmission code, even adding in timestamp payload to ensure its unique. Check the receive, sure enough, it's decoding the same packet twice, as it appends different timestamps to the decoded payload. So I dive into the code that end.

Turns out I had left the wifi on my laptop, which is also connected to the same network as the hardline.

Whole afternoon pissed up the wall. FMAL.

Collapse
 
martingbrown profile image
Martin G. Brown

I once called a VB 6 COM+ project "security.dll". Started getting the error "Method '~' of object '~' failed". It took MS Support a whole week to figure out that security.dll is a reserved name in Windows.

Collapse
 
courier10pt profile image
Bob van Hoove

delete from tblSomething - omitting the where :)

Collapse
 
gregorgonzalez profile image
Gregor Gonzalez

Oh man that "s" It's my biggest problem specially when the ide or app doesn't show any message.

Another one, re-declaring variables on JavaScript or any language. Or changing the value at some scope.

Script not running because some special character and you cannot see it with some ides or text editors.

Collapse
 
vedrantrebovic profile image
vedrantrebovic

Writing try{} catch{} as usual then putting all my code in catch, instead to try. I was wondering why my code does nothing and none of my breakpoints are ever hit.

Collapse
 
groso profile image
Sonja

I constantly forget the return statement at the end of a method.

Wondering each and every time: Why is the variable null!?!?

Collapse
 
hamzaop profile image
Hamza • Edited

Working on a React app, using console.log in the client code and I was expecting them to show up in the server....

Collapse
 
adambrandizzi profile image
Adam Brandizzi

One very common mistake: forget to "git add" a new file. Time and again the CI fails "for apparently no reason."

But my favorite was to try to solve a conflict running "apt-get remove apt".

Collapse
 
xyz85046927 profile image
Charles Xavier

this.items = service.call();
...
//ALWAY UNDEFINED 😡
if(!!this.item) {
...
}
I couldn't see the missing "S" 😅

Collapse
 
pbouillon profile image
Pierre Bouillon

Changed the name of a git submodule, suddenly making all the submodule files tracked by my repository. Needless to say the repo was wasted and needed to be recreated.

Collapse
 
miadabrin_82 profile image
Miad Abrin

I deleted a large number of products on an e-commerce platform by deleting their attribute set. And I was thinking this is the development

Collapse
 
sercasti profile image
casti

SuperImportantComponent.setSuperImportantProperty("CONFIGURABLE_PROPERTY")

Collapse
 
hudsonburgess7 profile image
Hudson Burgess

I don't remember how this happened, but I was building an SMS service and accidentally sent myself ~1500 texts. Probably did something silly in a callback.

Collapse
 
ghost profile image
Ghost

Creating member variables within a Servlet thinking they were local... but they are global and in production people overwrote their results making the whole application malfunction.