Friday, January 4, 2008

Just Tell Me What Did I Do Wrong

Know that thing when your girlfriend(or wife, or whatever) starts acting like a walking icicle because you've done something to upset her? So you also know that she will put you to the test of discovering your error yourself. No matter what exactly you did you will get the same chill tone. Well, who understands women anyway?
But I've expected code to be more friendly (it's mostly written by men after all).

OK, I get it, you supply me with a wonderfully written piece of code and if I'm unable to figure out the correct parameters or set the environment correctly then I'm the stupid one here and that's my problem to deal with. But really, isn't that what Error Handling is for?

Had a variety of error handling related issues lately, here are just some of them:

1. A few weeks ago I've tried to install an R12 Vision database. After copying the installation CD (the very first phase) the installer window have just vanished. The log did contain an error code but with no explanation whatsoever and I haven't found anything on Metalink, so I tried again and this time I saw that just before crashing the installer executes bootstrap.cmd. So I tried to run it myself and got a java error stack with an error message saying something about "Unable to open a window" (I don't really remember the exact formulation right now), with no other apparent choice I've started decompiling the java code together with my team leader (who used to be an Apps DBA as well). At last we've discovered a code section where an error wasn't handled, pleased with ourselves we've logged an SR.
An unhandled error is bad enough but apparently the real problem was that the Staging Area wasn't set correctly, that's definitely my bad but how complicated it is to check the validity of the Staging Area before launching the installer and throwing totally unrelated errors at me?

2. I've noticed that it doesn't matter what's wrong, if running adcfgclone on the database tier it will probably fail with the same error stating something about "Error returned while creating control files" and an RW-50004 error code. If you're lucky the log file will have some clues, if not you'll have to start debugging Oracle's code. I got this same error for problems with an Oracle script which is part of the whole process, for problems with starting the database listener and even for a corrupted database, non of which are really related specifically to the creation of control files. And I'm pretty sure this error shows itself in much more cases. I think it's totally reasonable to expect an error message when the problem appears, instead, all errors seem to propagate to a single line of code where the adcfgclone just won't take it anymore.

3. Had to modify the virtual IP(just the IP, host name stays the same) of my load balanced OID server - turns out that's not as simple as one would expect. From what I know up until now (haven't really resolved this issue yet) it seems that the IP is hardcoded in some configuration file or maybe even in the Meta-Repository database, that's odd. Maybe I'll write about it in another post when I'll have more idea. Anyway, in the process I've discovered a script that's supposed to do just that, it even has it's own folder directly under ORACLE_HOME. This fact made me suspicious at once since it makes this script look like a late add-on which wasn't considered with much thought. The code inside really stands up to the expectations, it seems no one have ever tested the code. It looks something like this:

...
if
echo bad thing 1 happened
goto end
...
if
echo bad thing 2 happened
goto end
...
...
:end
exit

Doesn't take a cmd expert to understand that running the script as it is won't show you any error messages (unless you're a really quick reader) and it will actually close your cmd window (why?!).

Well, I think that concludes my case.

2 comments:

Unknown said...

Can't give you much help with the Oracle errors, but here's something more relevant to you first paragraph: How to Combat the Silent Treatment

Unknown said...

LOL. Wrote it down for further usage... :)