STSADM.EXE is not a valid Win32 application

by Kindler Chase 8. May 2008 19:22

As I'm working in my virtual MOSS environment using the stsadm.exe utility I am suddenly presented with an error:

C:\Program Files\...\STSADM.EXE is not a valid Win32 application. 

Huh?

After several more attempts at using the stsadm.exe utility and receiving the same error each time I stare at my screen… blankly. The error continues after I restart IIS. The error continues after I reboot the server.

Diagnosis

I traversed to the 12-hive's bin directory to take a look at the stsadm.exe utility's security permissions. But, before I even view the security permissions I notice that the stsadm.exe file no longer has the Windows logo as its icon. Something is amiss. Upon closer inspection, the size of the file is 0KB!

The stsadm.exe file has become corrupted.

Resolution

Grab an stsadm.exe file from another SharePoint environment and copy it over to the corrupted environment. Fixed!

Other Thoughts

I'm not sure how the stsadm.exe became corrupted. One minute I was running commands such as "stsadm.exe –o createsiteinnewdb <snip>", and the next minute Windows is telling me that "stsadm.exe is not a valid Win32 application." I tried to reproduce the error, but was unsuccessful. For now, this is being logged as an unknown bug.

If anyone else has encountered this error and/or has been able to reproduce it, please do post a reply.

Thanks!

Comments

6/4/2008 7:35:03 PM #

I've been running into a similar problem but with Excel and with shortcuts to spreadsheet files.  Rebooting solves the problem.  It's possible logging out and logging back in will solve the problem, but I haven't tried that.

One thing I've noticed is that it typically occurs after running something on the local machine that requires a lot of memory.  I've been testing some software I'm writing for my company written in C# that reads and writes to a SQL Server on another machine.

Oh, also, I've only ever seen this on Windows Vista (I'm running 32-bit Ultimate).  Not sure what you're running, but it might be relevant.

Thanks for blogging about this.  Hopefully we can get to the bottom of this.

David Potter United States

6/4/2008 8:31:27 PM #

David,

When I encounted the error, I was using Windows Server 2003 R2 in a virtual server environment running Sharepoint (MOSS). In my encounter with the error, it did not resolve itself with a re-boot. I had to replace the file itself from another build.

IIRC, I believe I had a browser open to administer SharePoint, SQL Server 2005 Management Studio open, and was running the STSADM utility in the command window to manipulate the SharePoint databases in SQL Server. No other apps were open.

It sounds like the commonality we have is SQL Server. fwiw, I haven't seen the error again.

Cheers!
::kindler::

Kindler Chase United States

7/2/2008 11:17:14 PM #

I've just had this today. Windows Server 2008 SE x64 web farm. Added MOSS 2007 SP1 to Sharepoint 3 SP1 and stsadm.exe became 0 bytes long. Wonderful.

I don't have another system to get it off, so I'm off to build one. No SQL on my server, so thats no longer a point of commonality. No applications open, reboot completed just before installation. Zero event log errors.

Riv New Zealand

10/3/2008 6:53:43 AM #

I just had this error. Windows Server 2008, SQLServer 2008, WSS 3.0 SP1. Fortunately I have another Sharepoint to copy it from.

Len United States

12/3/2008 6:42:45 PM #

I saw the same error. Win 2K3 R2 Stnd, WSS3, Embedded SQL database only. Restored the file from backup - glad I got in the habit of doing that Wink

BriGuy United States

12/17/2008 9:00:06 AM #

Got the error for the first time today after having deployed 50+ MOSS servers.
It happened after a restart initiated after having installed the .Net Framework 3.5 SP1 executable(!?).

Running on a VMWare ESX Server virtual environment!

Other than that, Win2k3R2 SP2 Ent, MOSS2007 with SP1.

Miklin Sweden

Kindler Chase

Kindler Chase
This is SharePoint's world. I'm only living in it.

Your host, on the right, with my better half, Sadi.