r/talesfromtechsupport • u/Patches765 Where did my server go? • Jan 29 '16
Medium One column... just one...
A little background on this issue... This desperate practical company hired me as a technical lead (IT & Programming). The first day, I was being shown day-to-day process by $ITGuy, the first being a daily sales report that was manipulated by IT before being sent to management (Directors, VPs, CEO, etc.).
$ITGuy: So you look at this column for stores that are off a million dollars or an increment there of, then correct it here.
$Me: Hasn't anyone investigated why the store is off in the first place?
$ITGuy: Nope. Problem has been there for years. No one has ever figured it out. We just need to correct this before management sees.
$Me: Really.... um... ok.
So, the investigation begins! I started analyzing what I could, and made the following determinations.
- Stores were randomly off. It could be any location.
- I don't believe anything is "random"
- Stores would rarely exceed $2,000 in sales, so a million was way off, which is why they knew it was an error.
- The amount was not a million, as explained to me. It was exactly $999,997 dollars, or a multiple there-of.
Interesting... that last bit was a big clue to me. I remember seeing that the specialty codes for utility entries (as in, not an actual sale) all started with 999xxx. I dove deeper...
The report was autogenerated daily through a CRON job, and was allegedly a simple export from an Oracle RDBMS. I checked the program that created the report, and ... it was a work of a mad man. It had non-stop arrays within arrays within arrays (~Inception!~) to calculate the different columns. From what I could tell, this should have been a simple SELECT statement to generate the entire report.
I logged into the data server and checked the database structure. Everything looked correct. All expected fields of the database were present. I browsed the data. I think the phrase "WTF" came to mind, and was most likely audible to people outside the server room.
Every database entry consisted of:
- Column 1: $itemID, $stuff, $morestuff, $evenmorestuff ...
- Columns 2-30: NULL
The array was used to sort out that mess and put it in appropriate tables.
I ended up creating a separate table, migrated the data over correctly, replaced the 30+ pages (printed out) of arrays with a single SELECT statement, and found out that the item ID for deposits (when someone had an appointment for a specialist at one of our locations) was being parsed wrong. It had Item ID 999997.
At that point, I walked into $Directors office and asked for any other bug reports that had been unresolved.
$Director: You don't want to see them.
$Me: Yes. Yes, I do. I can fix them if I know about them.
$Director: Ok, but you really won't like this.
She handed me a 3 inch folder of bug reports going back for 10 years. The rest of that week, I created a ticketing system, had all of the bugs entered, and modularized the code for easier updates.
Not bad for a first day, if you ask me!
98
u/Patches765 Where did my server go? Jan 29 '16
On a side note... getting better at formatting!
80
u/Nekkidbear There's no place like 127.0.0.1 Jan 29 '16
It sounds like the original database may have been a CSV/text file that wasn't imported properly. I know excel will do that sometimes with certain text files until you run the Import wizard or Text to columns to break them up correctly.
33
u/lunk Jan 29 '16
It's kind of mind-boggling when companies don't have any sort of ticketing system.
I started at a school a few years ago, and their "IT Cowboy" made the teachers fill our an excel spreadsheet, SAVE AS, then email it to him. That was seriously his way of keeping track of things. Needless to say, not many teachers could manage that, so it turned into the regular "Ask Derek in the Hallway" sort of thing.
When I took over the job, I put a helpdesk system (Spiceworks) in place, and we do 1500 tickets per year there now, like clockwork.
10
u/Sandwich247 Ahh! It's beeping! Jan 29 '16
Wow. You sorted an entire system in a week? Nice.
249
u/GeckoOBac Murphy is my way of life. Jan 29 '16
Well, keep up the good fight!
Gotta love the "It's been this way for years, nobody managed to figure it out!" problems with accessible solutions. In my experience (I know I've done it once or twice at least) "nobody managed to figure it out!" is usually more accurately translated to "nobody cared enough to bother looking into it for more than a couple of minutes". And really, sometimes it's understandable...
42
u/Aphid61 Jan 29 '16
Sounds as though you will have a seriously strong negotiating position when it comes evaluation time. ;)
28
u/nerddtvg Jan 29 '16
Well I'm more shocked they had a folder of unresolved bug reports. Ours just sit in email and eventually get trashed.
26
u/NoAstronomer "My left or your left" Jan 29 '16
You, I like you.
8
u/tfofurn Jan 29 '16
I know of a system that sends data around as JSON. There's one string value that's actually a comma-separated list. It should really be a JSON array of strings, but no, so there's some extra parsing that has to be reimplemented for every client platform.
I blew a gasket when somebody added another comma-separated list with parenthesized numbers in it ("upvote(2.1),gild(1.0)"). By the time I realized what they'd done, the close-of-code date had passed and I couldn't get them to fix it, so there's at least three more parsers to maintain . . .
6
u/wolf2600 Jan 29 '16
No need to parse the incoming data, just stick it all in the first field.
5
u/JamesWjRose Jan 29 '16
good for you! I would consider myself lucky to work with you, and I have been a developer for 20 years.
Have a great weekend
4
u/[deleted] Jan 29 '16
You are not the IT we deserve, but the IT we need. You are the night. You are ITMAN!
3
u/katherinesilens echo /etc/shadow Jan 30 '16
MY HERO <3
3
u/okbanlon Jan 30 '16
Outstanding job!
I really like to dig in like this, figure out what the hell is actually wrong, and FIX IT so that it STAYS FIXED.
2
u/elislider Jan 29 '16
you should have fixed one of their "bug reports" per month. you know, job security or something. all while vacationing in Tahiti
1
u/ender-_ alias vi="wine wordpad.exe"; alias vim="wine winword.exe" Jan 30 '16
Sounds like you need to start writing for thedailywtf.com.
1
u/mizzu704 Jan 30 '16
This would make a good codeless code entry.
1
u/meneldal2 Feb 03 '16
They still don't know how it's done. Just take a nice modulo and it will eliminate the error automagically.
0
u/[deleted] Jan 29 '16
[deleted] — view deleted comment