Batch icon indicating copy to clipboard operation
Batch copied to clipboard

Enable Win32/NTFS long paths by default in all Windows images that support it

Open letmaik opened this issue 7 years ago • 5 comments

The group policy option "Enable Win32 long paths" is not enabled in the standard Windows Server 2016 Datacenter image for Azure Batch. This is problematic since Batch has quite a deep folder hierarchy for task folders and application packages, hitting 260 characters easily. I don't think there are any downsides in enabling this by default, and it would remove common headaches.

Side note: I wanted to use the Data Science VM image (a Batch adaptation I assume) but this is still at Windows Server 2012 which doesn't have the long paths option.

letmaik avatar Jul 19 '18 16:07 letmaik

Are you experiencing this with Azure Batch tasks proper? Internally, Azure Batch uses Universal Naming Convention for file paths on Windows, so you shouldn't observe this issue in task execution (outside of the process execution logic itself).

Otherwise, the recommendation is to enable group policies that you need via a start task.

Marketplace VM images are not controlled by Batch unless our team publishes the VM images. DSVM images are not published by Batch.

alfpark avatar Jul 26 '18 18:07 alfpark

I experienced this with the standard Windows Server 2016 image during extraction of an app package. We're currently trying to work around it by changing the relevant registry key within the start task and doing a reboot. A reboot is required since the new registry key only applies to new processes and the Batch agent that decompresses app packages in regular tasks would be the same process that ran the start task.

letmaik avatar Jul 26 '18 19:07 letmaik

We'll need to get our team to understand why this is happening in your scenario. Can you create a Portal support incident with a repro? If you can issue an upload service logs request and attach these log files to your support ticket, it would be of great help.

As a potential workaround, is it possible to capture a VM with the relevant registry policy applied and use a custom image to provision your pool? That would avoid the restart cost.

Regarding enablement of this policy, this is something we could explore adding as a feature to the API for Windows pool configurations.

alfpark avatar Jul 26 '18 19:07 alfpark

I've already created a support incident last week, the latest status from Monday is that the support has to check with the "Batch Product Group". The issue is really quite simple, just create a zip file which has folder/file paths longer than 240 characters or so and try to use that zip file as app package. The location where Batch tries to extract it to already has a length of 30 or more, so this then exceeds 260 easily and leads to the mentioned issue.

letmaik avatar Jul 26 '18 20:07 letmaik

Thanks for the info, we can investigate further.

alfpark avatar Jul 26 '18 23:07 alfpark