G.H.E.Y. IN. H.D.

"God Hates Euroranger, Yes INdeed He Does"

  • July 2017
    S M T W T F S
    « Feb    
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  

Archive for the ‘Coldfusion’ Category

CF development issues and observations

Open Letter to Mustafa Sualp and AEFIS

Posted by Euroranger on October 26, 2014


[Preface: I am sharing an event I am experiencing as an example for why we have laws and rights and why it’s important to not simply surrender them in the face of intimidation.  The following post (and I need to make this so clear even a Philadelphia lawyer won’t fail to discern it) IS MY PERSONAL OPINION AND OBSERVATIONS OF EVENTS MIXED WITH FACTUAL EVIDENCE SUPPORTING THOSE OPINIONS THAT HAVE AFFECTED ME AND MY FAMILY.]

Dear Mr. Sualp:

I am in receipt of your lawyer’s, Stephen Goldblum, emails from both 9/24 and 9/25 of this year regarding exceptions you took with portions of a post on this blog dated June 10, 2013 wherein I related my company’s experience doing business with you and your firm, AEFIS, Inc early last year (2013).  I note, with much amusement, your demand that I provide you written acknowledgement that I have removed said post by September 30, 2014 or that I will be in peril of “institution” (fancy word, that) of a suit against me.  As you may or may not have noted, the post remains unchanged.  I assure you, I did the presumably anticipated quaking in my proverbial boots at his threat of filing suit and seeking fees and expenses “pursuant to Section 9(d) of the Independent Contractor Agreement” which, incidental to Mr. Goldblum’s surely rapier-like attention to legal detail, is the section concerning Notice…as opposed to what I presume he meant to be Section 9(e), the Attorney’s Fees part of the contract.  I will thank your lawyer though for bringing up a salient point which I’ll remind you of here shortly.

Anyway, my post remains where it is.  It is my opinion and clearly does not come even remotely close to a disclosure of confidential information (do you or he even read these contracts?).  I will thank you for the momentary smile I enjoyed at the ludicrous stupidity of such a claim, though.  But hey, let’s break this letter for a moment and let everyone see what I’m talking about.

Let’s start with your opening shot. I’ve decided to informally reference this as “fuck you Exhibit 1″…because, well, fuck you.

 

I’m gonna follow up with this, our exchange, which I’m entitling “fuck you Exhibit 2”

 

And finally, my response of the next day which we can refer to going forward as “fuck you Exhibit 3”.

So, Mustafa, I did, tragically, miss that September 30 deadline.  Before you and your learned legal counsel get all lawsuit-y, I want to say this one thing: PLEASE, do me the favor of suing me for all the things your letter threatens.  I want you to man up and actually follow through on your assertions because, in front of a judge in a court of law, we both know which of us will actually bring evidence of their claims and which will not.  We both know I have a transcript of our entire Skype chat history, and amongst other damning FACTS (because, hey, to a judge this kind of shit will actually matter) the email from your “operations coordinator” explicitly acknowledging that I had indeed worked in excess of 40 hours (46 to be precise) and to not perform further work until requested (hours for which I was never paid).  Oh look, here that email is now:

We’ll go ahead and entitle this one as “oops”…because fuckyouExhibit4 would be just so cliched by now.

Anyhow, I have to make one correction to our ongoing conversation because I believe, and pretty much any and every court in this country will agree, facts and accuracy matter.  I had originally advised your counsel that my claim for unpaid wages (the 4/24/13 email I and he refer to in “fuck you Exhibit 2”) was $2675.  I regret to admit that amount is in error and we both have your esteemed Counselor Goldblum and his manifest inability to correctly identify pertinent sections of a binding contract to thank for prompting me to greater accuracy.  I was so moved by his adroitly applied legal blustering that I went and checked Section 9(d) of our contract.  Guess what I found?  Oh, fuck you, let’s not guess:

Since we already called one “oops” I guess we’ll go ahead and call this one “massive fucking fuck up Exhibit 1”.

Would you believe it?  You and AEFIS never did “deliver by hand or mailed by certified or registered mail” your notice of terminating our contract?  Did you send an email to that effect?  NO!  You didn’t!  But your fucking “attention to detail” lawyer did!

Kind of running out of clever titles to apply this. Let’s just note how it’s explicit in that it’s being delivered “VIA EMAIL” which is pretty much not keeping to the contract…which, in itself, is at least consistent.

Guess what that means, Mustafa: the contract is, legally, still in force.  So, with that in mind, remember the part where I admitted that the amount of my claim for unpaid wages is incorrect (I hope so because it was just up the page here).  Well, if you remember that then I’m sure you’ll remember our negotiations wherein I accepted your lower than normal rate of pay for a guarantee of a minimum of billable hours per week (to make working for you actually worthwhile because I was assuming you’d be a man of your word and honor your contractual agreements) which was enshrined in the addendum to the contract (which Mr. Goldblum helpfully supplied me in this recent resumption of our communications):

How many “oopsies” do you and AEFIS commit annually? Hope it’s not this many.

Oh hell.  Does that say a minimum of 20 hours per week at the stupidly low but still mutually agreed to rate of $50 per hour?  Well, let’s see now…time for some math!  So, if I’m generous and use April 30, 2013 as a start point that works out to…lessee here…oh, my…that’s exactly 80 weeks today.  Hm.  80 weeks.  So, at 80 weeks times 20 hours minimum per week times $50 per hour PLUS the back wages you owe me of $2675 the total amount you owe (as of today anyway) comes to:

 

$82,675

 

And let’s be clear for a moment: your smartmouth lawyer suggested I could bring this situation up when “when we sue you for defamation…if the defamatory post is not removed and you fail to provide written confirmation to this effect by September 30”.  Let’s forget for a moment that such a suit would be frivolous because the statute of limitations of your claim has clearly and unambiguously elapsed.  Let’s say I don’t immediately assert that slam dunk defense and let’s say the judge sees some kind of merit in equating what were clearly expressed personal opinions to defamation (which he/she won’t but hey, we’re playing fantasyland here).  Guess what: we won’t be trying such a claim in Philadelphia.  We’ll be trying it in Georgia.  The doctrine of personal jurisdiction is actually a thing (ya’ll might want to look that up) and should you bring your frivolous lawsuit for defamation in any place other than a court that has jurisdiction over my location, it’ll get tossed out.

So, in the event you were hoping your empty, specious threats of legal action against me for discussing my experiences and reactions to your theft of my services and nonpayment of my entirely valid claims would work…they didn’t and don’t and fuck you for thinking they would.

Mustafa Sualp, if you don’t want to see your name or AEFIS’ name come up in a vanity search for the same and discover things like this, there is a much easier way to ensure that this doesn’t happen: honor your agreements, abide by your contracts, and act with a veneer of at least some pretended decency.  The money you failed to pay me for services I rendered is the same money I use to pay my bills and feed my children.  If you think for a single moment that your lawyer and your ridiculous threats relayed through him mean anything in the face of the ABSOLUTE FUCKING TRUTH then you need to attempt to associate with people possessed of dignity, integrity and honesty because this isn’t how you deal with us effectively.  A lawyer friend of mine whose counsel I value once told me of the legal maxim “the truth is an absolute defense”.  The post of June 10 was such a truth mixed with my First Amendment right to express my opinion and this post if more of that.

You have three options as I see it (this would be an example of an opinion about to be expressed):

  1. Pay me what I am owed and, as I generously offered in my 9/25/14 email to your mouthpiece, I’ll remove the offending portion of the June 10, 2013 post as a kindness.  NOT in consideration of your payment…but because you eventually decided to act honorably and decently and I’d consider myself to be mean and vindictive to continue to display my opinions of a complaint amicably (if ridiculously tardily) resolved.
  2. Stop with your fucking threats and sue me for either breach of contract or defamation.  Bring your “evidence” and I’ll bring mine and we’ll ask a judge to decide.  You know how that will work out and I will, of course, also tack on a claim for legal fees and costs I incur for even addressing your outrageous assertions.
  3. Shut the fuck up and put up with this post and the previous one and take it as a lesson for what could happen when someone thinks you’ve defrauded them for services rendered.  I essentially wrote off what you owed me long ago…but fuck you if you think I haven’t purchased the right to complain about it.  I have.  You want to buy that right from me?  Contact me and I’ll be happy to discuss a mutually beneficial agreement.

Either way, take your own insipid advice and don’t underestimate MY fucking resolve.  I am the wronged party here and I do not bend knee to idle threats or compromise my personal integrity or principles.

Oh, and by the way, per the combination of the contract addendum and Section 9(d)…the meter’s still running, asshole.

My name is Euroranger and I approved this message.

Posted in Amusing, Coldfusion, Errata, Web Dev | Tagged: , , , , , | 6 Comments »

…and when Losing is actually Winning

Posted by Euroranger on June 10, 2013


Yeah, I’m juvenile this way. Still, good advice is good advice.

So, as many of you know, I’m a software developer.  Who else would sit at their desk 12-13 hours per day without restraints or really good meds?  I pen posts here in increments when I simply need to find something to distract myself from my daily professional activities.  Typically those distractions are things like wanting to simply give my brain a break from trying to untangle unnecessarily complicated code, learn something more about how to understand the black magic some DBA used when encapsulating business logic in a database…things like that.  I’m relatively good at what I do so I understand most things I see and can figure out most of the rest that I don’t.  I’ve been doing what I do for somewhere short of 15 years now so there isn’t much code or data wise that I can’t handle.  To that end, I make a fairly comfortable living primarily as a contractor while enjoying the revenues I get from personal projects that continue to make my customers happy.  I do well enough, in fact, that I have time during the week to take on additional work.  Now, a great many of you might think that working from home would be ideal and who couldn’t be delighted to do such work?  No commuting, no dress code, flexible hours and the like is cool, right?  Well, it is but there are distinct pitfalls that many wouldn’t realize.  One of them is that you typically don’t ever get to meet the people you’re working for.  That sounds minor but more and more, I’m coming to discover that it’s actually a major piece of a potential employee or contractor who is trying to size up a work opportunity for suitability.  By virtue of the fact that you’re seeing this comprise the topic for a post, I’ve had recent experiences that I feel I need to vent about share with those thinking of doing this kind of thing.

Thieving douchebags. Yeah, you should avoid them as well.

Several years ago I briefly worked as a remote developer for a firm in Jacksonville, FL (keep in mind, I’m located outside the Atlanta, GA area) who had a grass roots political organizing application.  Not to get into the specifics of the app because it was way too ambitious given the owner’s timeline, funding and overall technical acumen but I did code some pretty cool modules for this application that even today (roughly 4 years later) I’m still pretty proud of (think a Google maps mashup that would create a walking route overlaid on a map for volunteers to go door-to-door for “get out the vote” drives with pinpointed addresses for political supporters with a map popup with details for each address…yeah, it was damn cool).  Anyway, long story short, the owner turned out to be a budding little criminal and it wasn’t until after he decided that paying me was “optional” that I discovered that he’d done the same to the two previous remote developers who’d done work for him as well as later hearing the same about two subsequent employees.  He did it enough that he rated an article in the Florida Times-Union for his activities.  He’s now a cable installation tech in Anchorage, AK.  My guess is that Anchorage is probably as far as he could run away from his legal troubles back in Florida that didn’t require the use of a passport.  Lesson from that: if the employer is short, seems slimy and tries to impress upon you who his friends are to show big a wheel he is…be careful.  Narcissistic a-holes don’t much care about anyone but themselves.  I did contract work for another 3+ years after that without incident.  Long jobs, short jobs, one off jobs.  They all worked out and I did good work for them and they paid me what I was owed…which is really all I’m after.  But then I took a contract with a firm in Philadelphia earlier this year that made me recall why contracting can be such a racket.

Damned shame closets don’t hold all the thieving douchebaggery in. Guess they’re not built for that.

Now, this firm, to be honest, appeared to be on the up and up.  It was a small, start-up like company who were providing assessment tools to the post-secondary education market (read: “colleges and universities”).  This time I actually flew up to Philadelphia to make the acquaintance of the owner and other folks I’d be working with.  They all, on the surface, seemed to be a nice group of people.  But a couple of things were apparent initially and became more ominous as time went by.  One of those things was the number of previous developers’ notes I was seeing in the codebase I was assigned to work on.  Now, keep in mind, the entire team was comprised of just 4 people (owner, project manager, database/network guy, lead CF dev) plus me but as I progressed through the code I saw notes in there from no less than 5 other devs who had worked on this code…within the previous 6 months…none of whom were still with the company.  Yes, that did ring alarm bells but not loud enough that I had reason to evacuate.  The other thing that happened was the announcement shortly after I started that the project manager would be leaving the company.  Now, this in and of itself wasn’t anything to be concerned about but she was, seriously, the only employee that knew anything about what was going on.  It became clear to me very early on that if she got hit by a bus or was somehow otherwise removed from the picture, that this company would struggle mightily.  Her reason for leaving though was even more suspect.  She was moving from Philadelphia to Pittsburgh for her husband’s job.  However, as I was doing MY job remotely and others (especially the owner) did much the same…why did she choose to not do her job from Pittsburgh remotely?  She easily could have but decided not to…and explicitly told me she didn’t have a job lined up in her new locale.  I don’t know about you but my family would find it difficult to get by on one income if we’d been relying on two…but this girl admitted it would be tough going and yet STILL didn’t seek to do her job remotely.  Third thing was the sudden “disappearance” of a remote developer they had who was in California.  One day up and quits responding to emails, Skype messages, everything…and nobody seemed at all concerned or surprised by it.  When most people go suddenly missing from their jobs, more often than not, it’s the employer who ends up calling someone to ask why such and such hadn’t been in to work recently.  Not so these folks.  The owner made a point of bringing it up during a telephone conference that he “was probably in jail” and had had other such occurrences before…except that this was news to both the lead dev and the database/network guy when I mentioned it later.  Anyway, long story shorter again, these folks called me one day to tell me to stop working despite the fact we had a contract that specified minimum guaranteed hours but when I asked if I should expect more work or if this was their way of ending the contract they said they’d have more work…it was only temporary.  Temporary, in this case, actually meant permanent and also apparently meant they’d decide to not pay me for the previous week of labor I’d provided.  They also decided to do this to their lead, in-house developer, as well and they stiffed him to the tune of around $15K.  The lesson I took from that: don’t wait until the warning signs are so piled up they’re like knocking over furniture before you make a move to protect yourself.

So, while those two were bad enough on their own, they had something in common: those assholes pretty much robbed me for their own gain.  However, something happened just this morning that makes me nostalgic for straight up crooks like that.  Recently, I entertained an opportunity to take on a FT developer role that I saw via LinkedIn on May 14 (that’d be just 3 weeks and some as of today).  I read the listing, knew I had the time and certainly the qualifications for the remote, telecommute position…so I applied and in short order I was interviewed and pretty much immediately offered the job.  Great right?  Well, on the surface you’d think so.  I mean, it’s a non-profit located in Maryland who caters to the education industry (something I already had a few years experience with).  The salary was low for my experience level but then again, I didn’t really take the job for the pay.  I took it for extra money and to stay gainfully occupied.  While they described their technical situation in terms that suggested they knew their application needed the kind of help I could lend it, it wasn’t until I actually got a look at their code and database that I realized the extent to which their product suffered.  For you non-devs out there (most of you, I think) the following paragraph of my admittedly subjective opinions will seem like Greek but believe me, this gets into nightmare territory dev-wise.

Quality Matters...somewhere else.

The only way this logo could be more ironic is if it was made with actual iron.

To begin, the application(s) they describe are actually one big application, not separated code-wise at all.  Crossover identity issues abound.  They move data around in the application via URL or form variables, both of which are ridiculously easy to hack and, for which, their code had nearly no validation or even any rudimentary protection whatsoever.  Further, while it was running on a relatively recent version of the server software I specialize in (ColdFusion) it was coded as though it had been written perhaps 10 years ago.  No concern with code organization, multiple redundant pages, absolutely zero use of any Object Oriented Programming, little code re-use, nothing to indicate that anyone who had looked at it had done so in the past decade or did so with any expertise whatsoever.  Potential SQL injection opportunities on practically every form page, easy to invoke looping race conditions, cross site scripting attacks…you name it and this application was ripe for it.  On top of that, as a new dev, I had no documentation, the code contained no commentary whatsoever, business logic was entirely contained in the CF code (as opposed to the more secure and more efficient database), data was stored with little regard to efficient retrieval and lookup tables?  Nah, who needs those when you can store all your data as single flat files?  And the cherry on top?  It’s all on one box.  Not just the database and codebase but the development environment as well as their production environment…all one box.  No versioning control software to be found either which means that if (when) their site is ever hacked, they have a snowball’s chance in hell of recovering the code and/or data and bringing up a restored box (and why mention the failover backup box when it doesn’t exist?).  In short, from a developer’s perspective, calling it a “challenge” was probably the nicest thing you could say about it.  But, as I gained access to their technical resources I resolved that I’d move methodically through this steaming turd of a Fisher Price application and, by God, make it better…and I was.

That is, until this past Friday.  Having cleared roughly 3/4 of the outstanding tech tickets in just 8 days and having only the ones that required greater business knowledge than I possessed remaining, I got an email Friday afternoon informing me that they were disappointed with the volume of my work product and had scheduled a performance evaluation for this morning.  Naturally, I was fired during that call today.  Keep in mind, this was but day 9 of my employment and only 7 days after I got access to their code and database.  I’d been given no goals, no expectations, nothing but tickets to work on and for which I had cleared all but the 4 I lacked the requisite business knowledge to address.  In short, I was fucking lied to this morning.  Nobody hires an employee, says nothing about their work performance in the interim and then fires them less than 2 weeks later.  I’m not all that broken up about not working further for such a schizophrenic and obviously dysfunctional imbecile like the woman I was reporting to but for crying out loud, at least be a prepared asshole when I question exactly what goals did I fail to meet.  The conversational equivalent of a shrug isn’t what qualifies a fat chick to be a CIO these days is it?  Somebody enlighten me some here.  I thought competence still had a spot in the American workplace.

Anyway, all of the above is merely my opinions on the companies involved (namely Patriot Information Systems which is unsurprisingly now defunct, AEFIS, Inc which will likely become defunct in the near future and Quality Matters which while the company name criminally abuses the definition of the word “irony” will likely stagger along like a drunk toddler for some more time) and shouldn’t be considered anything other than my right as a person relating anecdotal recollections of events I was involved in.  If any other devs wish to work for AEFIS or Quality Matters, I’ll be pleased to stand aside and watch you rush to your predictable reward.  After all, you shouldn’t believe everything you read on the internet…but some of it should cause prudent people pause.

My name is Euroranger and I approved this message.

Posted in Coldfusion, Web Dev | Tagged: , , , , , , , , | 3 Comments »

Install a plugin in OpenBD

Posted by Euroranger on March 25, 2011


Nerd rage

While I could go all nerd rage today, it's getting old. I'll just drink heavily later instead.

Second blog entry in a row for something other than me ranting and raving.  Actually, I COULD be ranting and raving today as the Jeep I own that I had repaired just yesterday made it…check this out…A GRAND TOTAL OF THREE F**KING MILES BEFORE THE SAME THING BROKE AGAIN.  Yep.  Got it back, drove it exactly 3.3 miles before it broke stranding me at the place I went for lunch today.  Naturally, the garage that “fixed” it (and I’m using the common English definition for the word “fix”…which may or may not be the same definition the garage uses) has it again but they’ve called to tell me that no, they won’t be able to “fix” it again until tomorrow morning.  Saturday.  Nearly 20 miles from where I live.  So while we have, yet again, another fine example of just how much God does indeed hate me (as though there was any atom of a doubt by now) I have made the decision to veer away from the expected recitation of some malevolent deity’s childish torturing of my apparently annoying continued existence to share yet a second technical blog entry.  Note to God: It’s called “taking the high road”…you should leave me alone and try it sometime.  Anyway, on to the fun.

OpenBD Logo

Sometimes someone DOES build a better mousetrap. This is CFML's better mousetrap.

I’ve mentioned before that my site is run by CFML (Coldfusion Markup Language).  Specifically, it’s run atop an instance of something called Open Bluedragon or OpenBD as it’s more commonly known.  OpenBD is a CFML engine (similar to Adobe’s CF9) that is built and maintained by a very talented group of folks as an open source project.  Anyhow, in my continuing efforts to upgrade and resurrect my site, I discovered that some old code that I’d built that allowed my customers and users to utilize Twitter was now broken.  It seems that sometime in the interim, Twitter changed their API (application programming interface) and so now my previously working code was now obsolete.  In an effort to try and get my code back up and running I ran across mention of a plugin for OpenBD that would make available CFML functions that would do much of the Twitter work for me.  In programming parlance this is something known as “very good” and can cause developers to break into spontaneous happy dance mode.  Using a standard plugin or custom tag or function helps to standardize the language (in my opinion) so I was all on board with trying out this nifty plugin.  Unfortunately, the installation directions accompanying the plugin didn’t work.  I followed them to the letter but when I tried testing them, no joy.  Nothing happened.  The site responded as though the plugin wasn’t even there.  In programming parlance this is known as “frustrating as hell” and is quite a regular occurrence (for me anyway).  However, due to my previously mentioned metaphysically caused misery (God hating me), I am well accustomed to frustration, depression, rage, suicidal ideation and other normal signs of a typical day of being a developer…so I took this all in stride.  More accurately, I dropped an email to the fellow who built the plugin asking “what gives”.  He (Matt Woodward) was as helpful as he could be to someone he didn’t know and whose server setup he had no real clue about.  However, after several attempts to troubleshoot my problem via email, he forwarded me to another fellow who is part of the team that helps to craft what eventually becomes OpenBD in it’s final perfect and serene form, Alan Williamson.  Alan pretty much immediately discerned what was up and very helpfully provided the instructions necessary to get OpenBD to recognize an load a plugin file.  I am pleased to report that my test of the plugin loading succeeded on the first attempt and, because no detailed instructions appear to exist on the web for such, I am pleased to share a step-by-step narrative for how to install a plugin on OpenBD.

Before we begin, the version of OpenBD I am running is 1,4.  It is running atop Apache Tomcat/6.0.26 with an operating system that is described as: Linux i386 (2.6.18-164.9.1.el5xen).  OpenBD plugins are .jar files that follow a particular naming convention: openbd-XXXX-plugin.jar.  Normally all you’d need to do is to simply identify your project’s WEB-INF/lib directory, drop the .jar file(s) into that directory, reboot your server and VOILA! you have functioning plugins.  It should come as no surprise to anyone that I would not enjoy such a simple experience.  However, due to the help of those people as well as the tech support folks at Viviotech (who host my site) I am pleased to present the following instructions for how to install a plugin on OpenBD:

  1. Drop the pertinent openbd-XXXX-plugin.jar file into your project’s WEB-INF/lib folder.  In my case, it was the /opt/openbd/lib/ folder.
  2. Edit the bluedragon.xml document (for me, found in the /opt/openbd/conf/ folder) and add the following entry under <server><system> (same level as <buffersize> and <licensekey>): <pluginjarpath>file:///opt/openbd/lib/openbdplugin-XXXX.jar</pluginjarpath>
  3. To add more plugin files, simply comma-separate them within the single <pluginjarpath> tag
  4. Reboot your server
  5. Login to OpenBD admin and click on Log Files under Debugging and Logging
  6. View the log file for bluedragon.log
  7. You should see an entry in the log (2 lines) that looks something like this:  25/03/11 12:08.40: -] PluginManager Manual Loading …
    25/03/11 12:08.40: -] PlugIn.Load.Installed: org.alanwilliamson.openbd.plugin.spreadsheet.SpreadSheetPlugin; SpreadSheet; Version=1.95
    (I tested with the OpenBD spreadsheet plugin, ergo the details in the plugin installation.  Different plugins will read differently)
  8. Congratulations!  Your new plugin should be ready for testing/use.

It should be noted that while I was forced to use this method to get OpenBD to recognize a plugin, it should work for anyone whether they need to use the method or would simply prefer to.  Understandably so, it’s easier to simply drop the .jar files into the appropriate place and restart your server.  In fact, that’s one of the nice features of working with a Java based CFML engine like OpenBD.  However, in my case (supposedly because I was using Tomcat), that method didn’t work…but this one did.

So, a quick post today to extol the virtues of OpenBD.  As a side note, please note that what I was attempting to do was to modify the actual install of OpenBD so that I would acquire access to functions specific to Twitter.  Not a UDF or component or custom tag…but actually integrated into the language.  As far as I know, this isn’t something you can do with CF9 and is one of the things I like best about OpenBD.  It’s much more dynamic than CF9 and when I had an issue with it, I was able to speak to one of the architects who got me a workaround IN THE SAME DAY.  While I work everyday with and like CF9, there’s no way on Earth Adobe is nearly this responsive to user issues.  One of the nice legacies of NewAtlanta’s BlueDragon platform…from which sprang OpenBD.  Superior, contactable, responsive support…just because they like doing what they do.  Something proprietary vendors should pay a lot more attention to.

(Please note that I’ve included a few pertinent links in this post to sites and blogs and such that pertain to this subject.  These are all smart, dedicated folks who have much wisdom to impart.)

My name is Euroranger and I approved this message.

Posted in BlueDragon, Coldfusion, OpenBD | Tagged: , | Leave a Comment »

Odd Struct Behavior in CF9

Posted by Euroranger on March 17, 2011


No politics or profanity today.  This post, however, is the distilled result of much profanity-inducing code angst…and I simply had to share.  Actually, I had already shared this a few weeks back on a tech forum I help out on but figured it couldn’t do any harm to repeat my discoveries here.

It’s not often one runs across something in CF these days that qualifies as an actual bug.  This isn’t one (I think) but I encountered this issue recently and wanted to post it up on the web somewhere so when others encounter it Google will have a reference to this post in the appropriate search results.

I’ve recently been tasked with building a centralized site error catcher for my employer.  They have dozens of sites running on both CF8 and CF9 and they needed a way to collect all the errors from all the sites and funnel them to one database table collecting things like the site the error occurred on, form/session/URL/client variables in effect at the time of the error and, of course, the error content itself.  To do this, I built code in each site’s onError method for each Application.cfc.  As we know, the onError method fires for each exception error generated on any sites using that Application.cfc.  My plan was to collect the various bits of information I needed, drop them into a Coldfusion struct, serialize that struct into a WDDX string and then store the resultant string in the database.  Later, calling up a particular error would require only that you grab the appropriate record from the database, deserialize the string from WDDX back into a struct and then CFDUMP that struct to the screen for the dev to examine.  Understand, when building the struct initially, I am storing structs inside the error storage struct that I’m serializing.  That is, I’m doing something like this:

<br />
&lt;cfset errorStruct = StructNew()&gt;<br />
&lt;cfset temp = StructInsert(errorStruct, &quot;ErrorTime&quot;, Now())&gt;<br />
&lt;cfset temp = StructInsert(errorStruct, &quot;CGI&quot;, cgi)&gt;<br />
&lt;cfset temp = StructInsert(errorStruct, &quot;Error&quot;, arguments.exception)&gt;<br />
&lt;cfset temp = StructInsert(errorStruct, &quot;Form&quot;, form)&gt;<br />
&lt;cfwddx action=&quot;cfml2wddx&quot; input=&quot;#errorStruct#&quot; output=&quot;errorString&quot;&gt;<br />

In case you didn’t know, the onError method in Application.cfc will generate an arguments variable (it is still, after all, a CF component method) called exception that will populate with the error structure that Coldfusion creates whenever an exception error occurs.  So, on line 4, I’m dropping that CF generated error struct into my own structure (errorStruct) that I also store the CGI, form and other things in (the example isn’t a line for line copy of what I’m doing).

Anyway, this encountered a problem for some errors wherein the string turned out to be too long (in my case, greater than the 64,000 characters I had allotted via the datatype for that column in the database table).  I realized by wholesale saving the entire error scope that I was saving things I didn’t really need: namely things like the StackTrace and objectType items found in the CF generated error struct.  My idea was to remove those from the CF generated error struct before storing them in my custom errorStruct…and this is where I encountered the problem I’m writing about.

For reference, I’m using CF9 as illustrated by the dump of the server scope:

 

CF9 Server Scope

My server scope dump

And for illustration purposes, I’m going to concentrate solely on StackTrace.  The original CF generated error struct looked like this:

CF9 Error Struct

CF9 Error Struct

So, to get rid of stacktrace my first idea was to do a StructClear which when I tried it in the onError method looked like this:

&lt;cfset temp = StructClear(arguments.exception.stacktrace)&gt;

And resulted in this:

StructClear Attempt

StructClear() Attempt

No dice.  So my next attempt was a StructDelete:

&lt;cfset temp = StructDelete(arguments.exception,&quot;stacktrace&quot;,true)&gt;

Which did this:

StructDelete Attempt

StructDelete() Attempt

Also no joy.  So, StructClear and StructDelete both failed.  My next thought was to overwrite stacktrace like so:

&lt;cfset arguments.exception.stacktrace = &quot;blorf&quot;&gt;

Which, surprisingly, did nothing per the before and after CFDUMPS of the error struct (you should see “blorf” as the stacktrace content in the second dump):

Error overwrite attempt

Overwright attempt

Now, that didn’t overwrite…but it also didn’t generate an error.  CF9 simply ignored it.  By now, it’s becoming obvious to me that CF9’s error structure is something I’m not allowed to mess with…so naturally, I tried messing with it in one more way: I tried adding to it like so:

&lt;cfset arguments.exception.testy = &quot;this is way testy!&quot;&gt;

And got the, by now, predictable result:

Error add attempt

Error Add Attempt

It didn’t add it either…but it also didn’t tell me it didn’t.  Again, it simply ignored me.

What does all this mean?  It means that it appears that CF generated structs like error are pretty much “view only” and cannot be altered.  This made me wonder if the same was true for the struct generated when you use CFTRY/CFCATCH and I found it had identical behavior to the error struct that I illustrated above.

In my case, I circumvented this issue by creating my own error struct in the onError method and populating it only with the things I needed before adding it to my overall error struct and serializing it into a string.  However, my looking through the online Adobe CF documentation doesn’t mention that either ERROR or CFCATCH structs cannot be edited by application code.  What’s worse, the error messages aren’t exactly informative and in cases like editing an existing variable value or adding a new one, it doesn’t tell you anything at all…it simply ignores you which is decidedly unhelpful behavior.

So, consider this post as a warning sign if you need to do more than simply read the contents of either the ERROR or CFCATCH structs generated by CF9.  It doesn’t appear to be possible. I do a fair amount of work with OpenBD these days and will be testing this same behavior there and will edit this post with the results from that test when I can.

I welcome comments or contrary test results.  Please post them here.

Posted in BlueDragon, Coldfusion, OpenBD, Web Dev | Tagged: , , , , | 1 Comment »