ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

PMImport fails. The process cannot access the file 'C:\Altiris\Patch Management\' because it is being used by another process.

book

Article ID: 184748

calendar_today

Updated On:

Products

Patch Management Solution

Issue/Introduction

PMImport is failing. 

According to the NS logs, the following log entries were present:

Entry 1:

Failed to update Tools\WindowsPatchData.zip

The process cannot access the file 'D:\Program Files\Altiris\Patch Management\packages\windowsvulnerabilityscan\WindowsPatchData.zip' because it is being used by another process.
   [System.IO.IOException @ mscorlib]
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at Altiris.PatchManagement.Tasks.WindowsImportTask.DownloadPackageFiles(ICollection`1 listOfFiles, String destination)

Entry 2:

Failed to update assessment files for: 'Import Patch Data for Windows' (c27dbb50-6ddf-4125-87c1-d8f5b588491d)

The process cannot access the file 'D:\Program Files\Altiris\Patch Management\packages\windowsvulnerabilityscan\WindowsPatchData.zip' because it is being used by another process.
   [System.IO.IOException @ mscorlib]
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at Altiris.PatchManagement.Tasks.WindowsImportTask.DownloadPackageFiles(ICollection`1 listOfFiles, String destination)
   at Altiris.PatchManagement.Tasks.WindowsImportTask.UpdateAssesmentPackage(ICollection`1 listOfFiles)
   at Altiris.PatchManagement.Tasks.WindowsImportTask.RunImport(String cabUrl)

Cause

Many open files of WindowsPatchData.zip and other packages in shared folder.

 

Resolution

Our suggestion is to try the following:

1. We are assuming there are many open files related to patch management and other packages in the shared folder (under Computer Manager> Shared folders> Open files).

2. In order to stop all those connections or possible programs holding the file, try the following:

A) Stop all Altiris Services:

Altiris Support Service

Altiris Client Message Dispatcher

Altiris File Receiver

Altiris Event Receiver

Altiris Service

Altiris Object Host Service

Altiris Service Hoster

Altiris Event Engine

B) Stop IIS (iisreset /stop)

C) Stop Symantec Management agent service on the SMP server.

D) Try to delete the folder which is shown in the error  you are receiving. Here it was ':\Program Files\Altiris\Patch Management\packages\windowsvulnerabilityscan\WindowsPatchData.zip'. but in your case it could be other folders or files under '\Program Files\Altiris\Patch Management'.  If It will not let you delete it because the file is still in use by some process, go to the next step.

E) On your SMP Server, Go to  "Computer Manager> Shared folders> Open files" and see if you have any references for 'D:\Program Files\Altiris\Patch Management\' file. If you do, delete them.

F) Start the services that you stop it above.

G) Run the PMImport again

 

Note:

If the issue keeps reoccurring where this WindowsPatchData.zip file keeps getting locked, try to identify what is locking it. Some ideas on how to do this:

Option 1:

1. Download Microsoft Process Explorer: https://docs.microsoft.com/ru-ru/sysinternals/downloads/process-explorer

2. Check if the WindowsPatchData.zip file is still locked.
Steps for finding:
Go to File, and select "Show Details for All Processes" option
Go to Find > Find Handle or DLL.
In the "Handle or DLL substring:" text box, type the path to the file (e.g. "C:\path\to\file.txt") and click "Search".
All processes which have an open handle to that file should be listed.

3. If nothing is locking the file, try to run PMImport again and when you see the error in the NS logs for this error:

The process cannot access the file 'D:\Program Files\Altiris\Patch Management\packages\windowsvulnerabilityscan\WindowsPatchData.zip' because it is being used by another process.

Then open Microsoft Process Explorer and see if it shows what it is.

https://www.windowscentral.com/how-delete-locked-files-windows-10

Option 2:

Try the following article:

http://woshub.com/managing-open-files-windows-server-share/