locked
Workflow Initialization: Failed to start a process or script in SQL MP 6.7.31.0 RRS feed

  • Question

  • I have been seeing a lot of Workflow Initialization: Failed to start a process or script warnings.Failed to create process due to error '0x80070020 : The process cannot access the file because it is being used by another process.
    ', this workflow will be unloaded.

    this is mainly on SQL 2008 and SQL 2012 servers. Most failed scripts are:GetSQL2012DBFilesFreeSpace, GetSQL2008DBFilesFreeSpace.


    Monday, January 8, 2018 3:07 PM

Answers

  • This is going to be a challenge as there is no mention which file is in use. Based on the error you would expect this error to happen when the script tries to write to a file that is already being written to, because normally there should be no problem accessing a file that is already opened by another one. I went briefly through the script and I can't find anything quickly that could be the cause.

    You could try to use ProcessMonitor to identify which file is the culprit. 
    You could also run a trace in SCOM to find a possible cause: https://support.microsoft.com/en-us/help/942864/how-to-use-diagnostic-tracing-in-system-center-operations-manager-2007 

    Both options are not direct answer options, it could be a time consuming thing. 
    When did this start for you? I see that there are some changes to this script in between version 6.7.20.0 and 6.7.31.0. 

    • Marked as answer by SCOM 10 Tuesday, January 9, 2018 3:33 PM
    Tuesday, January 9, 2018 8:02 AM
  • Hi,

    Is there anti-virus software installed on SQL server ?

    If yes , please try to disable it to see if the issue persists .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by SCOM 10 Tuesday, January 9, 2018 3:33 PM
    Tuesday, January 9, 2018 8:50 AM
  • Hi,

    Is there anti-virus software installed on SQL server ?

    If yes , please try to disable it to see if the issue persists .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Good one, forgot about that one. 
    If that is the case follow the long term instruction to make exclusions: https://support.microsoft.com/en-us/help/975931/recommendations-for-antivirus-exclusions-that-relate-to-operations-man
    • Edited by RuudvdH Tuesday, January 9, 2018 8:52 AM
    • Marked as answer by SCOM 10 Tuesday, January 9, 2018 3:33 PM
    Tuesday, January 9, 2018 8:52 AM

All replies

  • Is this the full error? Can you post the full error message?
    Tuesday, January 9, 2018 7:00 AM
  • Failed to create process due to error '0x80070020 : The process cannot access the file because it is being used by another process. ', this workflow will be unloaded. Command executed: "C:\Windows\system32\cscript.exe" /nologo "GetSQL2008MirroredDBState.vbs" "SSXXXXXX\SQL200802" "SSXXXXXX" "SQL200802" "61501" Working Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Monitoring Host Temporary Files 22\5542\ One or more workflows were affected by this. Workflow name: Microsoft.SQLServer.2008.Mirroring.DatabaseStateMonitor Instance name: CSeries Instance ID: {D6B69369-41C3-6A8D-1189-642C23FD69AF} Management group: XXXXX 

    ------------------

    Failed to create process due to error '0x80070020 : The process cannot access the file because it is being used by another process. ', this workflow will be unloaded. Command executed: "C:\Windows\system32\cscript.exe" /nologo "GetSQL2008DBFilesFreeSpace.vbs" "XXXXXXXX\SQL200802" " XXXXXXXX " "SQL200802" "61501" Working Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Monitoring Host Temporary Files 22\39094\ One or more workflows were affected by this. Workflow name: Microsoft.SQLServer.2008.DBLogFile.FileAllocatedSpaceLeftPercent.Collection Instance name: MSDBLog Instance ID: {7AEFF68A-0262-ECA1-4C37-C500CFE9C8F8} Management group: XXXXXXXX

    Tuesday, January 9, 2018 7:33 AM
  • This is going to be a challenge as there is no mention which file is in use. Based on the error you would expect this error to happen when the script tries to write to a file that is already being written to, because normally there should be no problem accessing a file that is already opened by another one. I went briefly through the script and I can't find anything quickly that could be the cause.

    You could try to use ProcessMonitor to identify which file is the culprit. 
    You could also run a trace in SCOM to find a possible cause: https://support.microsoft.com/en-us/help/942864/how-to-use-diagnostic-tracing-in-system-center-operations-manager-2007 

    Both options are not direct answer options, it could be a time consuming thing. 
    When did this start for you? I see that there are some changes to this script in between version 6.7.20.0 and 6.7.31.0. 

    • Marked as answer by SCOM 10 Tuesday, January 9, 2018 3:33 PM
    Tuesday, January 9, 2018 8:02 AM
  • Hi,

    Is there anti-virus software installed on SQL server ?

    If yes , please try to disable it to see if the issue persists .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by SCOM 10 Tuesday, January 9, 2018 3:33 PM
    Tuesday, January 9, 2018 8:50 AM
  • Hi,

    Is there anti-virus software installed on SQL server ?

    If yes , please try to disable it to see if the issue persists .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Good one, forgot about that one. 
    If that is the case follow the long term instruction to make exclusions: https://support.microsoft.com/en-us/help/975931/recommendations-for-antivirus-exclusions-that-relate-to-operations-man
    • Edited by RuudvdH Tuesday, January 9, 2018 8:52 AM
    • Marked as answer by SCOM 10 Tuesday, January 9, 2018 3:33 PM
    Tuesday, January 9, 2018 8:52 AM
  • I have the MP 6.7.31.0 and the scom(2016) is fresh installation, I have plenty of these alerts and it triggeres everyday. I have never read the trace logs before I will try to do that.

    I found one of the Kevin's blogs where its mentioned that try to change the running time of the affected workflow so that the workflow can run in different time. I looked up for the Rules\monitors which are using this script but not successful.(Mentioned in the comments)

    https://blogs.technet.microsoft.com/kevinholman/2011/12/12/opsmgr-network-utilization-scripts-in-baseos-mp-version-6-0-6958-0-may-cause-high-cpu-utilization-and-service-crashes-on-server-2003/

    I will check the Antivirus from few blogs found that MecAfe antivirus causes the issue, but server has Symantec antivirus running.

    I have just checked the Operations event log and I see lot of scripts are failing on this server

    Management Group: XXX. Script: ModuleAction Module: DBDiskLatencyDataSource.ps1 Version: 6.7.31.0 :

    Computer Name = XXXX WMI = 'ComputerManagement10' Service Name = 'MSSQL$SQL200802' SQL Instance Name = 'SQL200802' Connection String = 'XXXXXX\SQL200802' Tcp Port = '61501'

    Error occurred during DB Disk Latency data source executing.

    Computer:XXXXXX.XXXXXX.com

    Reason: Unable to get counter "\LogicalDisk(*)\Avg. Disk sec/Write": Unable to connect to the specified computer or the computer is offline.

    "margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none;">Offset:9

    Instance:SQL200802

    Detailed error output: Unable to get counter "\LogicalDisk(*)\Avg. Disk sec/Write": Unable to connect to the specified computer or the computer is offline.

    --------

    Unable to connect to the specified computer or the computer is offline.

     

    --------------------------------------

    not sure what is causing this issue.

    Tuesday, January 9, 2018 3:32 PM
  • I have the MP 6.7.31.0 and the scom(2016) is fresh installation, I have plenty of these alerts and it triggeres everyday. I have never read the trace logs before I will try to do that.

    I found one of the Kevin's blogs where its mentioned that try to change the running time of the affected workflow so that the workflow can run in different time. I looked up for the Rules\monitors which are using this script but not successful.(Mentioned in the comments)

    https://blogs.technet.microsoft.com/kevinholman/2011/12/12/opsmgr-network-utilization-scripts-in-baseos-mp-version-6-0-6958-0-may-cause-high-cpu-utilization-and-service-crashes-on-server-2003/

    I will check the Antivirus from few blogs found that MecAfe antivirus causes the issue, but server has Symantec antivirus running.

    I have just checked the Operations event log and I see lot of scripts are failing on this server

    Management Group: XXX. Script: ModuleAction Module: DBDiskLatencyDataSource.ps1 Version: 6.7.31.0 :

    Computer Name = XXXX WMI = 'ComputerManagement10' Service Name = 'MSSQL$SQL200802' SQL Instance Name = 'SQL200802' Connection String = 'XXXXXX\SQL200802' Tcp Port = '61501'

    Error occurred during DB Disk Latency data source executing.

    Computer:XXXXXX.XXXXXX.com

    Reason: Unable to get counter "\LogicalDisk(*)\Avg. Disk sec/Write": Unable to connect to the specified computer or the computer is offline.

    "margin-bottom:0in;margin-bottom:.0001pt;line-height:normal;text-autospace:none;">Offset:9

    Instance:SQL200802

    Detailed error output: Unable to get counter "\LogicalDisk(*)\Avg. Disk sec/Write": Unable to connect to the specified computer or the computer is offline.

    --------

    Unable to connect to the specified computer or the computer is offline.

     

    --------------------------------------

    not sure what is causing this issue.

    Tuesday, January 9, 2018 3:33 PM