6 days of recovery – day 6: Recovering security permissions after restoring data on a new hard drive

Okay, I’ve now got the Windows system drive (C:) back up and running and using my trusty backup I have restored all my data onto the new data drive (A Seagate 1TB 7200RPM 32MB cache – nice and fast).  However, I now had a security problem:  all my old file permissions were now incorrect, and in the directory and file properties windows on the security tab I was getting “Account Unknown”:

Windows Vista Security file properties: Account Unknown

The problem was that although my user name was the same in the new Windows install, the unique Security ID (SID) used by my old Windows install was different from the unique Security ID created by the new Windows install.  This makes sense because the ID is a unique identifier (and is probably created based on the current time in milliseconds and lots of other things).

BTW, It’s possible to copy-and-paste that long numeric SID rather than trying to type it out.  From the file security property dialog box above click on the “Advanced” button, and then double-click on the “Account Unknown” in the “Permission entries” pane.  Then, you can copy the long numeric SID from the “Name” text box.

How to copy the numeric SID for an Account Unknown

My first approach was just to remove all the “Account Unknown” entries completely with the iacls command but I got a VERY frustrating message:

I tried about 50 different variations and got absolutely nowhere, which turned out to be very fortunate because I discovered that it’s possible to simply REPLACE the OLD broken SID with the working new one!  Phew.  A little Microsoft tool called subinacl.exe did the trick very nicely.  It requires installation (?!) and doesn’t put itself onto the path (which is good I guess) and after reading the help and trying a few different things I got it to work like this:

So it took a little while to solve the problem but it worked!  It’s also the ONLY Microsoft Vista command line tool I’ve ever seen that actually had a “fancy” little GUI:

Subinacl at work

The red is a little scary (because I assumed something bad had happened), but it was fine and my new HDD with all my data had all the security backed up correctly, and I didn’t have to muck around trying to remember and manually reset folder permissions.  Very elegant, although it took me about an hour to figure this out!

Robert

MS SQL Server 2005 SP3 Cumulative Hotfix (KB970892) – PAINFULL

What a pain!  Last Tuesday, 2009-10-13, Microsoft released a whole bunch of patches, my computer apparently needed 19 (?!) security patches.  One of them failed dramatically, and I’ve spent the last two weeks trying to get this security patch to install.  This is “MS SQL Server 2005 SP3 Cumulative Hotfix (KB970892)”, and I can not believe how difficult this has been to install.

My first approach was just to download the hotfix separately from here:
http://www.microsoft.com/downloads/details.aspx?familyid=0d878f4b-71e8-4170-9a14-1bce684811ce&displaylang=en

I’m running Vista Ultimate x64, so I downloaded the x64 version.  However, when I selected my database “MSSMLBIX – SQL Server Database Services 2005” the details section says that:

Setup cannot update SQL Server Database Services 2005 x86 on this computer. To proceed, run the Hotfix Setup program for the x86 platform instead.

(Which is odd, because later I tried a re-install of SQL Server Express 2005 and I could ONLY run the x64 bit version).   So I dutifully downloaded the x86 version of the KB970892 hotfix.  Here’s a video of the results:

[wpvideo aw36isXg]

Sigh.

Problem Event Name:   APPCRASH
Application Name:           hotfix.exe
Application Version:       1.4.1572.0
Application Timestamp:  4919b4d5
Fault Module Name:      StackHash_e52f
Fault Module Version:   0.0.0.0
Fault Module Timestamp: 00000000
Exception code:                c0000005
Exception Offset:             002d002d
Additional information 1:              e52f

The knowledge base article had links to a number of suggestions, such as setting ALL SQL Server windows services to start up automatically, however that didn’t work for me.

VERY BAD Microsoft Support

So yesterday, I finally called Microsoft Support at 1-866-PCSAFETY and I spent from 11am until 4:30pm on the phone!  Fortunately I just put them on speaker phone and worked on my laptop, but it was still an unbelievably frustrating experience!  First I talked with Lance, but after about 30 minutes the call was cut off and I was left with a dial tone.  I waited for about 20 minutes but he never called back.

Then I talked with Angie (who seemed to be much more persistent and friendly), and after trying a bunch of stuff (some of it the same as Lance) she transferred me to Ruchi, who seemed to be slightly more knowledgeable.  Ruchi  tried to uninstall SQL Server 2008.  The SQL Server 2005 instance that’s running on my machine was installed with Microsoft Office Small Business, and I’ve also installed SQL Server 2008 express as part of my development environment.   Unfortunately most of the SQL Server 2008 stuff failed to uninstall half way through the uninstall; she had also renamed a bunch of directories (c:\windows\SoftwareDistribution and c:\windows\system32\catroot), and run a few batch files that changed directory permissions to “Everybody” so that when the call was disconnected (!) my machine was left in a very indeterminate/messy state!!  All the calls (obviously to somewhere very far away) had very bad connections, and the line was full of static, crackles and pops and I could barely hear them and they could barely hear me, so I’m not terribly surprised that these calls kept being disconnected, except that I didn’t have a case number and now I had a computer in a really bad state.   What was (slightly) amusing is that they all kept saying, “is your phone okay, it seems to be bad” – how strange that if I call anybody in Canada or the USA my phone seems just fine…

Anyway, about an hour after that call was disconnected another gentleman called me and asked me a bunch of questions and had no interest in using Microsoft Easy Assist to connect to my computer (he actually trusted me).  However he finally gave up and suggested I try the paid SQL Server support team’s support.  It doesn’t seem “right” to pay for help fixing the mess their support people created on my computer trying to fix a security fix that they wrote that apparently lots of other people are having problems with!

Trying myself (again)

So I thought about the problem for a while, and decided to uninstall SQL Server 2005 – I haven’t used the small-business side of Office for a while, and I secretly wondered if it might not connect to a (repaired) SQL Server 2008 instance instead.  Unfortunately  I couldn’t uninstall SQL Server 2005, because it said there was a registry problem.

So instead I decided to re-install SQL Server 2005, and I downloaded it from here: http://www.microsoft.com/Sqlserver/2005/en/us/express-down.aspx

I figured after my previous experience with the hot fix installer that I needed the x86 version, but that wouldn’t install so I downloaded the x64 version and that installed just fine.

Then Windows Update said it successfully installed the update!  Unfortunately, after rebooting and asking Windows Update to “Check for Updates” it found “MS SQL Server 2005 SP3 Cumulative Hotfix” again!!  Sigh.

So I then installed the KB update that I had downloaded again (the x86 one that crashed in the video above) and it worked!!    This time there was two instances of the database present, the SQL Express version which the hot fix installed indicated was already updated, but the MSSMLBIX version was “Upgradable”.  The update didn’t crash, and everything seemed to be working.  I rebooted the computer and did another Windows Update and it immediately said that 1 important update was available – the same one!!  Wow, this is almost impossible to fix!

I now just found now found this on Google:  http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/c7d0a234-763b-4f9c-b7ec-3a40df6340a8.  I decided to try their suggestion (voted on by several people) of the Microsoft Installer cleanup utility to remove ALL SQL installation files and then running the update again:  http://support.microsoft.com/kb/290301

I used this tool to remove the following:

Microsoft SQL Server 2005 Express Edition [9.3.4035.00] (I had two copies of this?  I removed both – in hindsight maybe removing just one would have been best)

Microsoft SQL Server 2005 Tools Express Edition [9.3.4035.00]

Microsoft SQL Server Native Client [9.00.4035.00]

Microsoft SQL Server Setup Support Files (English) [9.00.4035.00]

So I tried running the update from Windows Update (as recommended in the blog post), and that seemed to work.  Unfortunately after I rebooted and it STILL had 1 important security update!!  Sigh.

Apparently this also broke Office, because Office now has to “install” and re-configure itself.  It’s now done this twice and it still won’t start.  I now get the error message, “Microsoft Office Word has not been installed for the current user.  Please run setup to install the application”:

Microsoft Office Word has not been installed for the current user.  Please run setup to install the application
Microsoft Office Word has not been installed for the current user. Please run setup to install the application

I popped in  my MS-Office 2007 DVD and clicked “Repair”, but unfortunately even that failed!

So I decided to try and re-install SQL Server 2005.  Unfortunately, now I get the error:

Error 1603 installing Microsoft SQL Server 2005 Setup Support Files.

So after fighting with that bug for a while I’ve decided to buy a 1TB drive (I was getting low on space anyway) and reinstall Windows.  This SUCKS!!!

 

2009-10-31:  Update

I just received this nice little form e-mail from Microsoft support.

Dear Robert,

Thank you very much for your reply. I’m glad to hear that the issue is resolved. It was a pleasure working with you and I hope you will continue to enjoy using our products.

We always strive to provide a high level of support to our customers and hope you are satisfied with the entire process of this service request. If there is anything you are not satisfied with, please don’t hesitate to let us know. Your feedback is very valuable in helping us to improve our service process and quality. Our goal is to provide first class customer service to you. We do our best to keep improving our Service Level.

At the same time, I have some tips for you if Windows Update issues are encountered in the future.

1: Windows Update issues can be temporarily. We can try restarting the computer to test if the is the issue is solved.

2: When Windows Update issues are encountered, it’s best to try suggestions given by the website first, because these suggestions are most often found to resolve the issue.

3: If one update fails, we can try manually downloading it from Microsoft Download Center: http://www.microsoft.com/downloads/Search.aspx?displaylang=en

I also would like to share more resources. Please check the Microsoft Knowledge Base, which provides a wealth of information that you can use to troubleshoot an issue or answer a question:

Search the Support Knowledge Base:

http://support.microsoft.com/kb/242450

http://support.microsoft.com/search

Another good resource is Microsoft Newsgroups:

http://www.microsoft.com/communities/newsgroups/default.mspx

Based on the current status, I will go ahead and close the case. If you need further assistance from me, please feel free to send emails directly to srxmail@css.one.microsoft.com with the Case ID in the subject line. This issue will then be reactivated for me to follow up with immediately. I appreciate the opportunity to be of assistance.

Your satisfaction to my overall service is my first priority.

Again, thank you for using Microsoft Online Support Service.

Have a nice day.

Best Regards,

 

OnCreated not called when created

I’m using Microsoft .NET RIA Services to build a Silverlight application, and today I had a bug.  At first it looked like the DataGrid’s RowDetailsTemplate wasn’t working, but that wasn’t it.

After debugging it for a little while I realized that the property I had data bound to, “FullName” wasn’t being set by the OnCreated() method,  which is a partial method called by the class’s constructor.

Apparently .NET RIA Services is using reflection in  such a way that it doesn’t call the constructor when it is creating client side objects from a server response.  This is possible using the serialization method: FormatterServices.GetUninitializedObject().  So when .NET RIA Services is de-serializing objects from the server it doesn’t call the constructor and the objects are created without their OnCreated() method being called.

In my case, the solution was simply to move the initialization of the derived  FullName property into the property getter rather than in OnCreated() method.  Then I had to implement the appropriate partial methods for the “FirstName”, “LastName” “SpouseFirstName” and “SpouseLastName”properties so that they would raise the property changed event for the “FullName” property.

Nice and easy, however it’s still a shame there’s no way for an object to know when it has been newly retrieved from the server.

VS2010 MSDN Accouncement and pricing

Microsoft just had some major announcements about VS2010 MSDN subscriptions:

1. New SKUs:
http://arstechnica.com/microsoft/news/2009/10/visual-studio-2010-simplified-to-four-skus-beta-2-arrives.ars

2. “Free” upgrade
http://www.microsoft.com/visualstudio/en-us/products/msdn/default.mspx#roadmap

Here’s a quick price comparison matrix/chart that I put together that will probably mean I’ll ditch NCover and buy MSDN premium instead, picking up Expression Studio 3 and the full version of Office 2010 in the process.

Upgrading to Visual Studio 2010
MSDN Premium
(with Ultimate offer)
MSDN Professional
MSDN subscription cost: $2,499 $1,199
Code Coverage included $658 (NCover complete)
Test prioritization included n/a
Code analysis / optimization included n/a Microsoft code contracts (watch the video)
DB dev & testing tools included n/a
Expression Studio 3 included $600
Office included $540 (Ultimate upgrade price)
Windows OS included included (Windows 7 Ultimate upgrade price)
$2,499 $2,997
$498
Other links:
Current subscriptions http://msdn.microsoft.com/en-us/subscriptions/subscriptionschart.aspx
VS in only 4 SKUs http://arstechnica.com/microsoft/news/2009/10/visual-studio-2010-simplified-to-four-skus-beta-2-arrives.ars

2009-10-30: Update!

I just watched this amazing profiling video:  http://channel9.msdn.com/posts/DanielMoth/VS2010-Parallel-Computing-Features-Tour/

Recently I was talking with RedGate about their profilers:

  1. Performance profiler: http://www.red-gate.com/products/ants_performance_profiler/index.htm $500
  2. Memory profiler:  http://www.red-gate.com/products/ants_memory_profiler/index.htm ANOTHER $620

While Parallel Tasks and Parallel Stacks are available in Pro and above, it’s not immediately clear about the profiling, but I’d guess it’s only in Premium and above, which differentiates itself from the professional version by another $1120 for a total savings of about $1620 AND its all nicely integrated inside Visual Studio.

2010-02-04: Update

For Code Contracts: “The one that includes the static checker requires VS 2010 Premium or VS 2010 Ultimate.

Static code-contract checking is amazing – I think this could save a lot of debugging time.