So, I checked the bank account today. The following kinda stood out to me:
What the hell is AMERICAN MARKETING ASS ????
“Invalid parameter number: no parameters were bound”
When people used our search feature on our site, a few specific search terms would result in un-caught exceptions. Of course, this ONLY happened on the client’s server. Nothing like saying a project is solid, only to find out there’s something ‘special’ about the production environment.
The first thing we did, was to list out what was unique about the client’s server. The client was using a Media Temple box running CentOS 5.2. For the un-initiated, CentOS is the free version of Red Hat Enterprise Server. We run Macs in the office, and our staging server is a Mac too. Other than the OS, the normal ‘LAMP’ stuff pretty much matched verbatim.
So, we started digging into the differences between the compiled versions of PHP between the development and production environments, and one thing popped out at us:
The version that’s supported on Red Hat / CentOS is 6.6. That’s horrible. 6.6 came out nearly 3 years ago, and the version the client was running had no support for unicode at all. A little research, and we found out that Zend Search Lucene (what we built the search functionality on top of) requires unicode for the way it stores search indexes.
With that, we figured we were done. The client had a limitation on their server, they needed to address it, and the problem would fix itself when they did. Not quite so fast …
I was testing some of the searching on my iMac, when the same issue happened on my own computer. Disaster! Could it be that something in our own code was the culprit? What half-reproducible error was causing this?
After hours of searching for an answer on the googlez, I came across some help on the Zend Issue Tracker. It turns out, that PDO was failing when it was trying to prepare a statement, when that statement contained a question mark. When I switched my SQL adapter to Mysqli, the problem was solved. Both the production and the development environments were bug free after the change.
It turns out, that our search indexes would return fields that either contained question marks, because they actually existed in the document (as was the case locally), or because the document had encoding errors when the search index was built (as was the case on the production servers). The ORM we used would grab the documents, and grab relevant data from the database by querying with the fields stored in the index.
The SQL that was being prepared, would then look something like this:
‘SELECT id FROM folks WHERE first_name LIKE ‘Jo?hnny’
The question marks would be interpreted by PDO as variable markers, which rightfully didn’t exist.
So, the real solution wound up being a little bit of a mix between the client’s problem, and our own. Granted, we needed to catch question marks being stored in db before they got there. That improves the longevity of our own code. However, the search functionality will still return results that may have question marks in them, thus causing the same issue. That issue is resolved by using Mysqli, but that feels more like a hack, than a solution.
Anyways, I spent a long time trying to search the answer to this and found nothing except the one mention in the issue tracker. For those of you using Zend Lucence Search on Red Hat / CentOS servers. Make sure you use Mysql if you’re using the Zend ORM to populate models based on results returned from the index.
Oh yeah, and make sure you filter your input too, Mr. Bobby Tables…..
So, after listening to all of the news, and hearing all of the hype, I’ve come to the single conclusion anyone can make:The end is near. Seriously though, I don’t know how anyone can stare down the barrel of the sort of debt collection going on right now, without visualizing the Four Horsemen.
I’m not an expert on finance. I write neat websites for people. I have a degree in civil engineering (which means I had to fight through some calculus classes). I’m not at all qualified to make judgement on what’s going on in global credit markets.
That doesn’t mean I don’t have an opinion however.
Hearing the amount of security trading going on is astounding; something like 60 trillion dollars of potential debt being traded on 5 trillion dollars worth of bonds and other investments. To put that number in perspective, the entire GDP of the country is 12 trillion dollars annually. That means, that the value of what our whole freakin country makes every year (the largest economy in the world), is worth 20% of what might need to be collected at any given time.
Again, I’m not an expert, but wasn’t much of the cause of the bank run in 1929 based on a re-valuation of assets in the stock market? When people started needing some re-assurance of the value of the companies they were buying into, and companies couldn’t produce proof of value, the value was adjusted, violently.
History, always repeating itself …
It’s a cliche, I know, but ‘Those who fail to learn from history, are bound to repeat it’. So, folks have invested 60 trillion dollars that’s only really worth 5 trillion dollars? Am I reading that right? If not, please let me know. But that’s the way it’s been explained to me. Imagine if your salary dropped to 8% of what it was before. In other words, if you made 100k a year before, you’d be down to 8k a year afterwards.
Nobody is going to take that sort of a loss lying down. People are going to fight to keep as much of their money as they can. That’s what makes the current ‘crisis’, sound much more apocalyptic. When folks are put in desperate situations, they do desperate things. There are a number of instances this has played out in history, and many of those instances were bloody.
So, what does a normal guy do? How do you get food, and service when green money has no value? I’m jumping a few steps here, I know. However, I can’t see any other outcome, than a complete devaluation of printed money from this. I could be wrong (actually, I am quite likely completely wrong).
But seriously, if money has no value, then what does?
Welcome to a bartering society. What can you barter? Sex always sells. Drugs will sell. Food will sell. Post-economic collapse, it’s likely that they will sell in that order too.
Sad fact about all of that, all of the progress our society has made in tolerance, civil rights, equal protection under law; forget it. The entire basis of our society’s ability to enforce these ideas depends on the general populace’s willingness to abide by them. When folks can’t find their next meal, you can forget it. Outside of divine intervention, we will plunge into the sort of violence most people normally associate with the third world. You might hope that we would all come together in the worst of times. History does not bear that idea out. Remember, if you don’t learn from history …
So, what does a normal guy do? Get in shape, stock food, stock ammo, and hedge any investments you have with tangible worth. When society fails, you’ll need to provide worth in a society that will only require services that provide immediate security and well-being.