Running Windows job error U00029006 File ... cannot be deleted, error code '32',
search cancel

Running Windows job error U00029006 File ... cannot be deleted, error code '32',

book

Article ID: 273081

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

Windows jobs are ending not okay.  The Messages window and activation report shows:

 U00029006 File '1452688' cannot be deleted, error code '32', error description: '32 - The process cannot access the file because it is being used by another process. >libcpprnt/src/Path.cpp#sys::Path::remove:449<'.

The windows agent log shows something like:

20230817/170735.217 - U02000009 Job 'JOB_NAME' with RunID '1433034' ended with return code '1'.
20230817/170735.217 - U00063046 Thread '6052' ended with return code '1'.
20230817/170735.279 - U02001026 Job 'JOB_NAME' with RunID '1433034' has been removed from the job table.
20230817/170735.279 - U00029000 Report '1432013' for file 'C:\Automicv21\Agents\windows\temp\OAADDNWS.TXT' has been started.
20230817/170735.279 -           Could not remove file 'C:\Automicv21\Agents\windows\temp\OAADDNWS.TXT', reason '32 - The process cannot access the file because it is being used by another process. >libcpprnt/src/Path.cpp#sys::Path::remove:449<'.

20230817/170735.279 - U00029006 File '1432013' cannot be deleted, error code '32', error description: '32 - The process cannot access the file because it is being used by another process. >libcpprnt/src/Path.cpp#sys::Path::remove:449<'.

Environment

Release : 12.3, 21.0

Resolution

Take note of which jobs run into this error.  Use the Windows OS Job Object on those jobs:

  1. Open the job job in the AWI's Process Assembly
  2. Go to the Windows tab
  3. Set the "Use Windows OS Job Object" option to "Yes"
  4. Save the changes

More information on this setting can be found in the following documentation page under point 5: https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/21.0.7/Automic%20Automation%20Guides/Content/AWA/Objects/obj_jobs_WIN.htm?cshid=pa_view_JOBS_WINDOWS

The thought here and the reason this could be happening is that the process is not fully finished writing to the report file when the agent gets the message that the job is finished.  By using the Windows OS Job Object set to Yes, the agent will wait until all sub-processes for the job are fully finished.

Setting "Use Windows OS Job Object" to "Yes" should resolve this issue.