locked
Script or Executable Failed to run - Failed to create System.PropertyBagData RRS feed

  • Question

  • 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


    Orange County District Attorney
    Wednesday, May 27, 2009 3:21 PM

Answers

  • Probably so at this point.
    --------------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of attachments are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
    Wednesday, May 27, 2009 7:14 PM

All replies

  • Which version of SCOM and SQL Server MP you have? Do you have the latest one?

    Ingrifo - We Do SCOM
    Wednesday, May 27, 2009 3:23 PM
  • We're running SCOM SP1 and the SQL MP is 6.0.6569.0 - this looks like the latest one.
    Orange County District Attorney
    Wednesday, May 27, 2009 3:31 PM
  • 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.

    Ingrifo - We Do SCOM
    Wednesday, May 27, 2009 3:35 PM
  • 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\Health Service 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

    Wednesday, May 27, 2009 3:39 PM
  • 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?

    Orange County District Attorney
    Wednesday, May 27, 2009 3:46 PM
  • 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 (?).


    Orange County District Attorney
    Wednesday, May 27, 2009 3:51 PM
  • 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
    Wednesday, May 27, 2009 4:12 PM
  • 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 the cnADOConnection.ConnectionTimeout to 300 with the same result. I'm wondering if this has anything to do with how Windows 2008 allows / disallows running vbscripts if you are not an admin? Perhaps I need to login as the local admin to see if I get the same result?
    Orange County District Attorney
    Wednesday, May 27, 2009 4:32 PM
  • 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 that it 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

    Wednesday, May 27, 2009 4:45 PM
  • 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 :)

    Ingrifo - We Do SCOM
    Wednesday, May 27, 2009 6:30 PM
  • 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?
    Orange County District Attorney
    Wednesday, May 27, 2009 6:59 PM
  • Probably so at this point.
    --------------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of attachments are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
    Wednesday, May 27, 2009 7:14 PM
  • Thanks for the noble effort! If I get a resolution, I'll put it on this post.
    Orange County District Attorney
    Wednesday, May 27, 2009 7:55 PM
  • Hi there!

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

    Thanks,
    Patrick

    Friday, June 12, 2009 7:52 AM
  • 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
    Friday, June 12, 2009 11:07 AM
  • 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
    Monday, June 15, 2009 9:12 AM
  • 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..
    Wednesday, July 8, 2009 4:15 PM
  • I'm confused - why is this marked as the answer? It doesn't make sense to me at all.
    Tuesday, March 31, 2015 3:56 PM