Script or Executable Failed to run - Failed to create System.PropertyBagData
Trying to troubleshoot an alert I'm getting on one of my SQL servers. The server is running Windows 2008 x64 and I've got SQL 2005 x64 installed on it. This alert comes up ever day or so and I'm wondering if it may have something to do with x64 or x86 OpsMgr agent issues.

Alert: Script or Executable Failed to run

Source: DevServerSql001.da.ocgov.com

Path: DevServerSql001.da.ocgov.com

Last modified by: System

Last modified time: 5/26/2009 7:55:20 PM Alert description: The process started at 7:53:50 PM failed to create System.PropertyBagData, no errors detected in the output. The process exited with 0

Command executed: "C:\Windows\system32\cscript.exe" /nologo "GetSQL2005DB.vbs" DevServerSql001

Working Directory: C:\Program Files (x86)\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 16\7776\

One or more workflows were affected by this.

Workflow name: many

Instance name: many

Instance ID: many

May 27th, 2009 3:21pm

Which version of SCOM and SQL Server MP you have? Do you have the latest one?
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 3:23pm

We're running SCOM SP1 and the SQL MP is 6.0.6569.0 - this looks like the latest one.
May 27th, 2009 3:31pm

Have you tried running that script locally on that machine like:

cscript cscript.exe" /nologo " C:\Program Files (x86)\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 16\7776\ GetSQL2005DB.vbs" DevServerSql001

Mind that numbers 16 and 7776 might've changed.
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 3:35pm

Hi Sandy

The SQL scripts are in my opinion quite likely to timeout - the message does state that there were no errors in the output. Are any databases discovered on that SQL Server? If so, try running the command locally on the SQL Server that generates the error:

Cd c:\Program Files (x86) \System Center Operations Manager 2007\HealthService State\Monitoring Host Temporary Files 16\7776\

Then

"C:\WINDOWS\system32\cscript.exe" /nologo "GetSQL2005DB.vbs"DevServerSql001

Does it execute ok? What is the output?

Cheers

Graham

May 27th, 2009 3:39pm

Looks like it ran ok. I ran

cscript GetSQL2005DB.vbs from the

C:\Program Files (x86)\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 16\7776\

directory and it returned to the cmd prompt, no errors at all. I'm assuming this is success? I couldn't see anything in the OpsMgr event log, is there somewhere to look on the server to see if the script was successfull on that end?
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 3:46pm

Hello Graham,

I checked and the databases on that server are showing in OpsMgr. I ran your command line and as before, it just returns to a cmd prompt which I suppose is success (?).

May 27th, 2009 3:51pm

Well I'm getting used to these new forums and I accidentally proposed Sandy's last post as an answer, so please disregard that - lesson learned :).

First off, a blank result from this script is not a good result. You should expect to see some XML returned. You can confirm this by running the script from the command line again and then after it completes running the following:
echo %errorlevel%
That should return a non-zero number.

Anyhow, the failure here is most likely due to the fact that the SQL connection that get's spun up in the script is timing out. Currently the timeout value for the SQL connection is harded coded within the script to 15 seconds, and we've seen a number of cases where that timeout value is too small which leads to the script failing to execute. To test this idea you can manually alter the following line in the script and see if it completes:

cnADOConnection.ConnectionTimeout = 15
Try a huge value like 300 or something and see if that helps. If so then you're hitting the timeout problem and as of right now there isn't really a trivial workaround for it. We do intend on shipping a fix to this problem soon.

I hope this helps!
-Cory
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 4:12pm

I re-ran the script, from the server, at an Administrator command prompt and nothing showed, just a cmd prompt. I ran echo %errorlevel% and it returned 0. I did change thecnADOConnection.ConnectionTimeout to300 with the same result. I'm wondering if this has anything to do with howWindows 2008 allows / disallows runningvbscripts if you are not an admin? Perhaps I need tologin as the local admin to see if I get the same result?
May 27th, 2009 4:32pm

Looking at the script, I would have thought it would throw an error code of -1 if the connection failed rather than zero. So I would have thought thatit is unlikely to be a timeout on the connection in this instance.

If you connect to the SQL Server using SQL Management Studio and run the following sql statement, do you get a list of databases?

Select * from master.sysdatabases

Which service pack are you using for SQL 2005? Has this changed recently? Have you always had this alert on this server? The script has executed successfully in the past as you have a list of discovered databases in OpsMgr. How many times a day does the script fail? The script I think runs every 2 hours so if it is failing less often than this then the fact it is intermittent suggests a resource issue on the server. Check out the cpu \ memory \ disk io data. Is the agent folder excluded from Anti-Virus?

Cheers

Graham

Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 4:45pm

Are there any other databases on that server? What if you run that script against other DB?

cscript.exe /nologo "
C:\Program Files (x86)\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 16\7776\ GetSQL2005DB.vbs" [PUT-OTHER-DBNAME-HERE]

Should return XML, like others said. It means that PropertyBag was created. If it just shuts down, it means that script exists before it creates that PropertyBag. That also means, that script creator failed to include some exception :)
May 27th, 2009 6:30pm

Thanks for the suggestion. I ran it against a single database and still just got the nice cmd prompt, no xml. Any other way to troubleshoot this or should I open a support ticket on it?
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 6:59pm

Probably so at this point.
May 27th, 2009 7:14pm

Thanks for the noble effort! If I get a resolution, I'll put it on this post.
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2009 7:55pm

Hi there!

Any solution to this problem?
I've the same error in a workflow with my own vbscript.

Thanks,
Patrick

June 12th, 2009 7:52am

Hi, Is it a large script, else post it here and we will see if there is something incorrect in it. You can also try run your script outside of ops mgr. Then there is a couple of issues in some of MSFT MP where this alert will be raised.I have a couple of example scripts at my blog that use property bags if you want to take a look at them.
--

Anders Bengtsson
Microsoft MVP - Ops Mgr
www.contoso.se
Free Windows Admin Tool Kit Click here and download it now
June 12th, 2009 11:07am

Anders, thanks for your reply!

I have the error just sometimes.

This is the VBS:

On Error Resume Next
Dim oAPI, oBAG, Var, ProcessVar, QueryVar
ProcessVar = WScript.Arguments(0)
InstancesMinVar = WScript.Arguments(1)
InstancesMaxVar = WScript.Arguments(2)
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBAG = oAPI.CreateTypedPropertyBag(StateDataType)
QueryVar = "Select * from Win32_Process WHERE Name like '" & ProcessVar & "'"
Var = GetObject("WinMgmts:").ExecQuery(QueryVar).Count
If var > InstancesMinVar - 1 and var < InstancesMaxVar + 1 then
Call oBAG.AddValue("Process",ProcessVar)
Call oBAG.AddValue("State","GOOD")
Call oBAG.AddValue("InstanceMin",InstancesMinVar)
Call oBAG.AddValue("InstanceMax",InstancesMaxVar)
Call oBAG.AddValue("InstanceVal",var)
Else
Call oBAG.AddValue("Process",ProcessVar)
Call oBAG.AddValue("State","BAD")
Call oBAG.AddValue("InstanceMin",InstancesMinVar)
Call oBAG.AddValue("InstanceMax",InstancesMaxVar)
Call oBAG.AddValue("InstanceVal",var)
End If
Call oAPI.Return(oBAG)

Cheers,
Patrick
June 15th, 2009 9:12am

Hi Anders,

I ran my script and I cant see any result out of GetSQL2005DB.vbs.

Is there any fix from microsoft for this..?

Cheers..
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2009 4:15pm

I'm confused - why is this marked as the answer? It doesn't make sense to me at all.
March 31st, 2015 11:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics