Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "mysterious errors"
-
Wow, what a fucking mess this sunday was.
My boss wrote me an email that one route of a RESTful API we wrote for a customer was not working anymore and puking back a status 500 with some error mentioning invalid UTF-8 characters.
Not one single person has had touched nor changed the code on production in some 6 months, so what the fuck could it be?
Phpunit did not give any errors (running only locally), the code had no syntax errors and the DB dump did not contain any invalid bytes (tested with a hex editor).
WHAT THE FUCK?!
OK so I started to comment out lines (all tested directly on production of course) until the error vanished.
Guess what was the culprit?
.
.
.
.
.
.
In the code (PHP) we used strftime(...) to get nice time strings. Of course we set the correct locale on the server, thus having months and days formatted in German.
So, in Geman there is this one mysterious month called "März" which contains an umlaut character.
Calling strftime generated the date with März in it, but the server locale was de_CH.iso-8859-1 and not fucking de_CH.utf8, so the "ä" was returned as 0xE4 instead of 0xC3A4 (valid UTF-8), which json_encode(...) did not want to swallow but instead threw an exception.8 -
"Stop throwing errors in your library! They cause my app to crash"
Who amongst us hasn't hear of the popular maxim: "Fail late even after you know something is wrong, and then make sure the failure cascades over the whole app in mysterious ways"5 -
ye ok so officially rust doesn't have a headless browser I can use
there is two.
one will randomly just throw errors totally randomly at you, about some event not coming back or the connection being closed. which means every single unwrap for every single "wait for this element to exist on the page" or trying to access an element is literally a blow-up minefield
the repo is filled with small issue tickets like how the docs keep pointing to 404 pages but I worked around that by just brute forcing everything with debug logging (despite data types being missing / not where they should be in return objects...)
and then there's apparently whatever selenium driver is and that has half as many stars and even worse sounding issue tickets and I already spent 6 hours writing code that took me 20 minutes to write in JavaScript like 8 months ago so I think I don't want to write another stupid headless browser script for it to be utterly useless
I guess I could just have loops and potentially caching. so if it has a mysterious event or connection error, try again! that's literally what I did with fucking reqwest. I don't even know why that nonsense is broken. I have thousands of proxy'ed network connections going and some of them randomly hang and I'm reasonably sure it's reqwest just not cleaning something up
I really wonder if rust people have brain aids. they wanted it to be safe so they just don't get safety exercises in for their brains, and do nonsense like this where they can't go from level 0 safety brain to ohno now I have to do networking and turns out that's extremely error-prone and needs brain-can-account-for-safety-9000 level and they just can't do it because no brain exercises make them all smooth and not wrinkly like everyone else gets in the skull jello by actually using the brain jello9 -
I'm trying out Picolisp. Cool, I think, an OpenGL library. I'll try the example program.
(Clicks mouse on program window)
(A wild SIGILL appears!)
Two hours later, still trying to figure out why it's doing that, with Google and DuckDuckGo returning no helpful results whatsoever. This is very annoying.2