Describe Behaviour
The Windows Worker Agent on CMF when running in a service context (It's default behaviour) does not support long paths. This is due to pywin32 pythonservice.exe which is used to run the Worker Agent as a service not being long path aware.
Expected Behaviour
Long paths registry key is enabled on the host, and the Worker Agent can access scene files, assets and output files that are long paths.
Current Behaviour
Long paths registry key is enabled on the host, and the Worker Agent cannot access scene files, assets and output files that are long paths.
Here is an example of the Worker trying to do a job attachments sync where a long file path cannot be accessed.
Failed to sync job output attachments for sessionaction-25baa4e656d34dbbb573345667333235-1: [WinError 3] The system cannot find the path specified: 'C:\\ProgramData\\Amazon\\OpenJD\\session-25baa4e656d34dbbb57395ac1304356786746452\\assetroot-6b8e732a578945789643\\output_dir\\longpath_testoutput_4k_fibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibfibbo.exr.f307214C'
Reproduction Steps
Submit a job that uses a scene file, asset or output file that is 250 characters long.
Possible Solution
The path forward to work around this issue is to make the pythonservice.exe long path aware using an application manifest. We will use the mt.exe tool from Windows SDK to embed the longPathAware Windows setting into pythonservice.exe. To do this you need to make an additional modification during AMI creation.
Requirements:
- Worker Agent is installed
- Long Paths Registry Key is enabled.
Steps:
- Install Windows SDK using the installer.
- Specifically install Windows SDK for Desktop C++ x86 Apps
- Go to the python installation location of your environment where the Worker Agent is installed (
Default: C:\Program Files\Python311), there should be an executable there called pythonservice.exe
- Create a new file called
pythonservice.exe.manifest in the same location and add the following contents:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="pythonservice" processorArchitecture="x86" version="1.0.0.0"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
</assembly>
- Run the following command using command prompt with the path to
pythonservice.exe.manifest :
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\mt.exe" -manifest pythonservice.exe.manifest -outputresource:pythonservice.exe;#1
- Expected return value:
Microsoft (R) Manifest Tool
Copyright (c) Microsoft Corporation.
All rights reserved.
The Worker should now be able to access long paths. At this point you can cleanup the pythonservice.exe.manifest file and the SDK installation and proceed with the AMI creation.
Package Version
deadline-cloud-worker-agent 0.22 or later
Language Version
Python 3.*
Dependencies
No response
Operating System
Windows
Other information
Upstream PyWin32 Issue: mhammond/pywin32#2455
Describe Behaviour
The Windows Worker Agent on CMF when running in a service context (It's default behaviour) does not support long paths. This is due to pywin32
pythonservice.exewhich is used to run the Worker Agent as a service not being long path aware.Expected Behaviour
Long paths registry key is enabled on the host, and the Worker Agent can access scene files, assets and output files that are long paths.
Current Behaviour
Long paths registry key is enabled on the host, and the Worker Agent cannot access scene files, assets and output files that are long paths.
Here is an example of the Worker trying to do a job attachments sync where a long file path cannot be accessed.
Reproduction Steps
Submit a job that uses a scene file, asset or output file that is 250 characters long.
Possible Solution
The path forward to work around this issue is to make the
pythonservice.exelong path aware using an application manifest. We will use the mt.exe tool from Windows SDK to embed the longPathAware Windows setting intopythonservice.exe. To do this you need to make an additional modification during AMI creation.Requirements:
Steps:
Default: C:\Program Files\Python311), there should be an executable there calledpythonservice.exepythonservice.exe.manifestin the same location and add the following contents:pythonservice.exe.manifest:The Worker should now be able to access long paths. At this point you can cleanup the
pythonservice.exe.manifestfile and the SDK installation and proceed with the AMI creation.Package Version
deadline-cloud-worker-agent 0.22 or later
Language Version
Python 3.*
Dependencies
No response
Operating System
Windows
Other information
Upstream PyWin32 Issue: mhammond/pywin32#2455