Tuesday, February 26, 2008

COM+ Server and Client's kernel32.dll 0xc000008f error

Today I had a terrible morning.

The first item on today’s to-do list was to publish a new version of a system at work.

This system in particular, is developed in VB6, accessing the business objects through a COM+ server. It’s comprised of an executable file, and 63 separated DLLs. One for each object (don’t ask me why).

Anyway, last week I proposed to the management to consolidate this 63 DLLs in two easier manageable DLLs, which was accepted and I fixed this in less than an hour. Just to consolidate the code, I've built two different DLLs, one for the data objects, another for the business objects.

So, today was the day to publish the new version.

To maintain a fallback approach I decided to create a separate COM+ application on the server to install these two new DLLs. The policy here at the company is that the developers don’t touch the servers, let alone create applications on the server. So this task was done by the company infrastructure guys, with a little bit of my supervision.

Because I wanted to create a new COM+ application, I decided to copy the properties of the original application, so it would make the transition easier.

Every single property matched… except for the user.

The original application used a local user on the server that, given the server’s age, the infrastructure guys didn’t have the password for it. So, they created a new user for this, and set this new user as the user for the new COM+ application.

The DLLs were installed and the system deployed.

Everything seemed to work fine… until, out of the blue, the system displayed a GPF, and every single user rang on my phone complaining that the system was faulty.

Darn, on the developer’s box the system ran fine. So I created a virtual machine from scratch to test the application. And lo and behold, the system crashed.

The reported GPF error was at the kernel32.dll with an error code of 0xc000008f. Google was no help to decipher this error.

The only different point was the COM+ server between the client’s boxes and the developer’s box.

So, something was wrong with the COM+, but all the settings seemed OK, exactly the same as the original application.

I installed a developer’s set on the virtual machine in an attempt to debug the problem.

Running in debug mode the GPF was averted, but the VB reported an Access Denied error.

And that shed some light into the problem.

Because the users were different, the infrastructure guy that created the new user didn’t copy all the properties from the original user.

So the code attempted to access some code that was protected, or somehow unavailable, at a lower user access.

The basic problem is that the object didn’t report the Access Denied error in the first place; instead the application generated a GPF.

OK, now you have it.

If you ever use a COM+ and have an application throwing a GPF you can also check the user’s permission at the COM+ server.

Saturday, February 23, 2008

Follow up to mySQL Connector/NET bug

Thanks to the bug report I posted, the bug will be fixed on the next update of the mySQL Connector/NET.

Related Posts

Friday, February 22, 2008

The end of wires?

Just as I got to work today I received one of my email newsletters that I subscribe, one of the news there caught my eyes:

Wireless Power
Physicist Marin Soljacic is working toward a world of wireless electricity.

For generations we’ve dreamed of such thing. Dozen sci-fi flicks exploit this. I can even remember some Star Trek episodes where the transferring of energy between ships across space.

But can it really be?

I have a background in electronics and ever since I started learning about electrons and energy, there were wires.

For what I could gather from the article it requires a special setup using resonance to accomplish the transmission and, so far, what was accomplished was to make a light bulb goes on.

It seems a little, but you need to remember that Edison marveled us with the very same feat.

Transmitting energy always involves some degree of lost power due the transmission itself. Transmitting it wirelessly, according to the article, has a huge energy loss. Actually around 50% of the energy is lost during the transmission. And they will settle if they are able to reduce the waste to 20%.

In a world that is struggling for renewable energy sources, creating a new way to transmit energy that has a huge amount of loss seems a little off the mark.

However, we always seem willing to pay a little extra for comfort.

If we only knew how much will be the price tag…

Monday, February 11, 2008

If you are over 30...

You probalbly remember some of the most famous artists joining together to sing a... well how should I call it... piece of... cra.. er... music?

Today I found that not ony them did this, but also some very friendly and heavy (at least on drinks) punk rock guys too.

Enjoy.



And just in case you're not over 30... here's the (ugh!) original.

Sunday, February 10, 2008

Workaround to the mySQL Connector/NET bug.

As I reported here, the mySQL Connector/NET 5.2 breaks the Membership Provider if installed on a machine without the mySQL installed.

To workaround this problem (while they don't fix this issue) you can do the following setps.

Let's say that you wat to use the SqlMembershipProvider on your website.

At the web.config file locate or create the membership element and inside the providers element add a clear element.

So your new web.config will look something like this:

<membership defaultProvider="myProvider">
<providers>
<clear />
<add
name="myProvider"
type="System.Web.Security.SqlMembershipProvider"
... />
</providers>
</membership>

This way you can use your desired provider without any grief from mySQL Connector/NET.

mySQL Connector/NET breaks Membership Provider List.

I'm currently developing a small personal project that uses the ASP.NET Membership Provider.

And yesterday I needed to install the mySQL Connector/NET 5.2.0 for a completely unrelated project. I don't have the mySQL Server installed on my machine. It is installed on another machine on my small network.

After installing the mySQL Connector my other project started to present an initialization error related to the MySQLMembershipProvider.

As it is the mySQL Connector/NET installation procedure updates the machine.config on the box it is installed adding the afore mentioned membership provider (without asking to which server to point the damn thing). So when is does not find the mySQL installed on the box, it add an empty Connection String and the damn software dos not accept an empty connection string.

I just downloaded the source code to see if I can mane any sense of that thing.

Edited to Add: Apparently the mySQL Connector/NET does not validate the connection string configured on the machine.config on the initialization of the MySqlMembershipProvider class.

I've opened a bug report on the mySQL website. You can check it here.

Saturday, February 09, 2008

SQL Server 2005 Troubleshooting

Yesterday I noticed that the SQL Server 2005 installed on my dev box was not working, so like a good sys admin I rolled up my sleeve and started to gather WTF was going on.

Recently I installed Visual Studio 2008 and with all the default options it installs the SQL Server 2005 Express Edition, which is good when you don't have it already installed.

After that (I guess) the previous instance of SQL Server stopped working.

Before I dwell on what was wrong, let me tell you what's my current setup.

I have the SQL Server running on a specially created account. Using this account I can have the SQL Server process to communicate with other computers on the network (after all it does not present itself as an anonymous account).

The SQL Express edition, installed with the defaults, run on the NETWORK SERVICES account, which is good, once I don't have plans for this instance.

Anyway, when I detected that the SQL Server was not working that was the message present at the Event Viewer:

FCB::Open: Operating system error 5 (Access is denied.) occurred while creating or opening file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf'. Diagnose and correct the operating system error, and retry the operation.
I scratched my head... "WTF?! How the heck the Access Denied on master db?"

I checked the permission for the master.mdf and LO & BEHOLD, the account used for SQL Server does not have permission on the file.

So, I granted MODIFY permission on the folder containing the master.mdf file and...

TA-DA!! Nothing happened!!

The freaking SQL Server still refused to start, giving the same error message.

Just to make sure it was still an Access Denied problem I changed the SQL Server service account to NETWORK SERVICES and it started nicely.

OK, it was still a question of permissions, so I granted FULL CONTROL permission on the SQL Server install path to the SQL Server account I use, and it worked.

Now I need to thinker a bit with the permissions to know where the permission need to be set in order for it to work properly.