Monday, April 12, 2010

SQL Server refusing to start

Here's a weird one that boggled my brain for a long ol' time.

SQL Server on my development laptop was refusing to start.

I hadn't used it for months, but didn't think I'd changed anything that could affect it.

The error message was plain ol' weird :

"Windows could not start the SQL Server (SQLEXPRESS) on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 3417."

Well, that wasn't weird, but the associated Event Log entry sure was :

"The SQL Server (SQLEXPRESS) service terminated with service-specific error WARNING: You have until SQL Server (SQLEXPRESS) to logoff. If you have not logged off at this time, your session will be disconnected, and any open files or devices you have open may lose data."

Ah - aha? What's all this log off bizzo?

No makey sensey.

Searching the web found only one other website mentioning the problem. One, in the entire world. And their solution was basically to uninstall SQL Server, delete the remnants of the installation folder, and reinstall.

Well, thanks be to God, the answer dawned on me :

To save space on my SSD (where speed was brilliant but size was cramped), I had compressed all my program files.

That works a treat - program files are almost entirely read-only, so both with hard disks and with SSDs of all varieties, compressing program files usually brings a speed improvement, and certainly frees up a lot of disk space.

BUT, I suddenly recalled that SQL Server stores its "master databases" deep inside the Program Files. By itself, that's not a problem. But I also recalled from years ago that SQL Server uses a special type of low-level file system access that is incompatible with NTFS compression. The disk access used by SQL Server is designed to optimise database page caching for uncompressed data files. But it simply cannot work with NTFS-compressed data files. Full stop. (And there are ways to trick it into working, but believe you me, there are substantial write performance implications if you try.)

So I dug into the SQL Server installation folder, and uncompressed the *.mdf and *.ldf files in the Data folder, and all was merriment once more.

For the odd sailor out there cutting close to the wind like me, this might prove helpful. Enjoy! :o)

Sunday, April 11, 2010

The case of the waking laptop

My Sony Vaio Z - ah... bliss! This is a BRILLIANT laptop.

But it often wakes around 2am.

When on battery, it runs its battery down and starts hibernating.

But when its in my bag, the extra drain of running the fan at full speed in the bag (due to the heat in a closed bag) whilst it runs needlessly, means that the hibernation battery threshhold is not sufficient for a full hibernation to occur. (8GB of RAM takes a while to hibernate.)

Ergo, the battery drains, and I lose my software state and any unsaved work.

VERY frustrating, especially when it's supposedly the 21st century and all.

Windows 7 Ultimate 64-bit.

I thought it must be the fault of a Sony driver or something.

But previous attempts to resolve the problem have failed.

I've had the laptop nearly four months now, and this has been my major issue with it.

(Lots of people are mentioning very similar problems, and other websites do give answers that work for others, but didn't solve the problem in my case.)

I think I've found the solution at last :

Open : Task Scheduler

Expand : Task Scheduler Library

Expand : Microsoft

Expand : Windows

Select in the LHS tree : Media Center

Select in the RHS list : mcupdate_scheduled

Note that it defaults to 2am daily. 2am daily!

Right-click "mcupdate_scheduled" and select "Properties".

Go to the fourth tab, and find the checkbox named "Wake the computer to run this task".

It is checked.

Yes, can you believe it, checked.

This particular scheduled task just checks for software updates.

That's not very critical.

Some numbskull at Microsoft decided that Media Center software updates are so critical that your computer should be woken from sleep at 2am, EVERY DAY!!!

This explains another problem. Whilst I have the laptop docked, I get woken in the middle of the night with my screen turning on, as a result of the laptop turning on. That'll be why.

So hopefully I'll have fewer interrupted sleeps.

Anyhows, this particular scheduled task is set to only start when the computer is plugged into power - which is the case when it's docked and I get the laptop turning on and the screen turning on and waking me in the middle of the night - but it doesn't explain why it wakes at around 2am on battery.

... or does it?

Someone else commenting on a similar problem said they noticed that the Windows 7 final release had a bug related specifically to the "Balanced" power profile. Somehow or other, the bug didn't seem to affect the "Performance" power profile. And I happen to use the "Balanced" power profile nearly all the time.

So here's my suspicion : the stupid Media Center scheduled task was causing the laptop to wake at 2am daily, and even though the settings said it should only happen when plugged into power, I suspect a bug somewhere in the Balanced power profile resulted in this scheduled task waking the computer even when it was on battery.

But of course "the proof is in the pudding". I definitely have solved at least one problem, but whether it will prove to have solved the main problem, we're yet to see...

Wednesday, April 7, 2010

ebay iPhone buy-it-now issue

Are we the only ones in the world affected?

My wife was on her iPhone using the ebay app, scrolling through a listing, and all of a sudden she was told she had won the item via buy-it-now.

She did not see any buy-it-now confirmation request either.

It just happened.

The iPhone's design inherently means that scrolling requires touching parts of the page you are scrolling through, and from time to time this must inevitably mean the iPhone mistakes an attempted scroll for a click.

So designing an iPhone app in such manner that an attempted scroll can instantly become a multi-hundred-dollar buying commitment, is ridiculous.

I also suggest it is illegal - that any attempt to enforce the purchase at law would be void, due to the absence of a contract. (There was clearly no intention to enter into a contract, nor to represent an intention to enter into a contract - it was a case of poor app design.)

Now, I don't know ('coz I always use ebay in a browser on a larger computer), but it might be that ebay will turn around and claim that they always present a confirmation request for buy-it-now on the iPhone. For sure I cannot find any option to enable or disable such confirmations in the app's settings (nor even in my account settings when I log in using a browser - but the account settings are not very intuitive to me, so there is a chance I missed the relevant setting).

But if the ebay app DID present a confirmation request, it was deemed accepted and dismissed so quickly - probably in the same swipe that triggered the "buy it now" button in the first place - that my wife saw nothing.

One moment scrolling.

The next moment on the hook for hundreds of dollars for a product she was just investigating.

If ebay does not ask for confirmations for "buy it now" on the iPhone, then they are negligent.

If ebay DOES ask for confirmations for "buy it now" on the iPhone, then they are negligent once again by implementing the confirmation step in such manner as it can be so easily dismissed without even being seen. They should e.g. have it appear for at least a second with buttons disabled before enabling the buttons.

But in my attempts to find others with the same problem, and how they resolved it, my Google searching turned up nada, zip, zero. Are we the only people on the planet who have hit this snag?

I Googled for things like "ebay iPhone buy-it-now accident", "ebay buy-it-now mistake", and other combinations of words, but no, I'm not finding anyone reporting this particular problem. And of course the ebay help was useless on the topic.

Come to think of it, ebay and PayPal are bedfellows, and we had a run in with PayPal's incompetence a few years ago - still partially unresolved despite PayPal's repeated claims that they have completely remedied the problem.

So I guess it shouldn't surprise me at all if ebay too proves worse than useless in resolving the issue.

There is an ebay help article on canceling a sale for sellers who find themselves unable to complete the transaction, but nothing it seems for buyers.

And no mention of the possibility of unintentional buy-it-now activation, anywhere in the help (yet surely that must frequently occur).

And the "dispute resolution center" gives no useful options at least for the time being - it says we must wait 10 days before even contacting the dispute resolution center!

We've contacted the seller, explained the situation, and I even offered to cover his lost listing fees.

So now we're in a situation where, depending on the good graces of the seller, we might :

a) end up with merely a truckload of wasted time. Yeah, thanks ebay for facilitating that.

or

b) end up with even a bit more wasted time trying to pay whatever few dollars it turns out to be in compensation (when we were not at fault in the first place) to the seller who is as much a victim in the circumstances as we are - but we don't want ebay's negligence to spiral on and affect others, so we're willing to cover the lost listing fees, even though it is ebay's fault.

or

c) end up with a strong negative feedback with no good opportunity to defend ourselves (so much for due process) when we do very few ebay transactions, have fabulous feedback so far, and thus one strong negative would be a substantial (and unwarranted) mar on our ebay reputation.

So, we'll see how it turns out, but based on my interactions with PayPal, I'm doubting ebay will have any conscience in this regard.