File path too long for Windows

When the stream test warns File path too long for Windows, at least one file in your zip has a path so long that, once it is unpacked on our streaming machines, it goes over Windows' limit of 260 characters. Your app may still stream in the test. This page explains why it matters, how to find those files, and how to fix the build.

What the warning means

Windows, as it is set up on most computers and on our streaming machines, cannot open a file whose full path is longer than 260 characters (259 plus an end mark). The full path is the folder we unpack your build into, followed by the path of the file inside your zip:

C:\0.apps\<your account>\<your app>\<version>\  +  MyGame\Samples\PixelStreaming\WebServers\...\file.js
|------------- our folder (about 35-70 characters) -------|   |---------- the path inside your zip ----------|

So the room left for your build's own paths is shorter than 260. The stream test measures every file against the longest folder your build can land in (the test machine's folder is the longest). As a rule of thumb, a path inside your zip may be about 220 characters, minus the length of your account name and of your app's name. Example: account VanishingPoint3D (16) and app Podfigurator (12) leave 192 characters.

The warning names the longest file and how many more there are, for example:

Your build contains a file path too long for Windows: MyGame\Samples\PixelStreaming\WebServers\Extras\
mediasoup-sdp-bridge\node_modules\mediasoup\worker\deps\...\file.cc (275 characters on our machines,
more than Windows' limit of 259) (and 15 more such file(s)).

Today this is a warning: the test still runs, and a build that streams is published. It is shown in the upload window, in the test report pop-up and in the test result email.

What can go wrong

WhereWhat can happenWhat your viewers notice
Copying the build to our shared drivesThe copy cannot unpack the over-long files, so the build never reaches the drives every streaming machine reads fromEach machine has to download and unpack the whole build itself the first time: the first viewer on each machine waits 1 to 6 minutes instead of seconds
Unpacking on a streaming machineSome unpacking tools cannot write paths this long and leave those files out, or stopThe app does not start, or starts with files missing
Your app while it runsA Windows program may fail to open a file whose path is too longMissing content or a crash, but only if the app really uses that file

If the long files are ones the app never uses (like Unreal's sample web server), the app itself is fine. The slow first start and the failed copies still happen, so it is worth removing them.

How to find the long paths in your build

Open PowerShell on your Windows computer and run one of the two commands below. Each lists the 30 longest paths over 150 characters, longest first, with their length. Replace the example path with your own.

In the zip you are about to upload

This reads only the zip's list of files; nothing is unpacked. It counts exactly what we count.

Add-Type -AssemblyName System.IO.Compression.FileSystem; $z = [IO.Compression.ZipFile]::OpenRead("C:\Builds\MyGame.zip"); $z.Entries | Where-Object { $_.FullName.Length -gt 150 } | Sort-Object { $_.FullName.Length } -Descending | Select-Object -First 30 @{n='Chars';e={$_.FullName.Length}}, FullName | Format-Table -AutoSize -Wrap; $z.Dispose()

In the packaged build folder, before you zip it

Go into the folder you are going to zip first (cd C:\Builds\Windows), then:

$b = (Get-Location).Path; Get-ChildItem -LiteralPath "\\?\$b" -Recurse -File | ForEach-Object { $_.FullName.Substring($b.Length + 5) } | Where-Object { $_.Length -gt 150 } | Sort-Object Length -Descending | Select-Object -First 30 | ForEach-Object { "$($_.Length)  $_" }

The \\?\ part lets the command read paths over 260 characters even on a computer where Windows' long-path support is off. Any path close to or above the room worked out above needs fixing.

How to fix it

Where the long paths areWhy they are thereFix
Samples\PixelStreaming\WebServers\...\node_modules\... (or PixelStreaming2)Unreal copies the Pixel Streaming plugin's sample web servers into the package. If someone ran their setup scripts on the engine, thousands of node_modules files with very deep paths come alongIn the packaged build, keep only WebServers\get_ps_servers.bat and delete everything else in WebServers (not just node_modules - none of it is used, and its many small files slow down copying your build to our machines). Eagle 3D Streaming runs its own servers, so the app does not need them. To stop it coming back, delete them from the engine's plugin folder too (Engine\Plugins\Media\PixelStreaming\Resources\WebServers, or PixelStreaming2)
Any other node_modules, .git or tool folderFolders added to the project or packaged as extra files by mistakeRemove them from the build, and from Project Settings > Packaging > Additional Non-Asset Directories to Package if they are listed there
Long folder or file names in your own contentDeep folder trees with long names, loose files (movies, data files) outside the .pakShorten the folder names, or keep content inside the .pak (Use Pak File on in Project Settings > Packaging)
A long project nameThe project name is the first folder of every pathA shorter project name for new builds
Extra folders around the build in the zipThe zip was made from a parent folder (Builds\Final\Windows\MyGame\...)Zip the packaged build folder itself, so the zip starts with the game folder and the .exe
Just over the limitYour account and app names count tooA shorter app name when you upload gives a few more characters, but shortening the build's own paths is the lasting fix

Why keep one file: the upload window and our stream test recognise a Pixel Streaming build by the Samples\PixelStreaming folder. If you delete the whole WebServers folder, or the whole Samples folder, the upload window no longer sees the Pixel Streaming plugin and asks you to type AGREE (see Pixel Streaming plugin not detected). The app still streams - but keeping WebServers\get_ps_servers.bat (any one small file in that folder works) avoids the question.

Then upload again

  1. Run the command above once more and check nothing is near the limit.
  2. Zip the build folder again.
  3. Upload it to the same app: upload from the Control Panel. The new test should pass without this warning.

Not sure?

Write to (Email / Discord) with your app's name and version. We can tell you which files the test found.

Related

Last updated