I am packaging a game with store in pak checked and some Primary Asset Labels in the content browser to generate separate pak files for different areas of the game.
Packaging runs fine until txt files with what assets need to be packed into what pak file are generated. After that I get hundreds of Warnings “LogPakFile: Warning: Missing file xyz will not be added to PAK file.” xyz is the absolute path to a cooked file in Saved/Cooked/… . I checked some of the paths and all the files exist. The generated pak files are all 1KB except pakchunk0-Windows.pak which has 17MB and entries to all the engine/plugin content but no reference to anything in the content folder.
I deleted the Saved and Intermediate folders, but that didn’t solve the problem. Reinstalling the engine solved the problem for some time, but it reappeared.
Reinstalling the engine narrowed it down.
I found this part in the log:
LogPakFile: Display: Found Pak file ../../../Engine/Content/Paks/pakchunk1004-Windows.pak attempting to mount.
LogPakFile: Display: Mounting pak file ../../../Engine/Content/Paks/pakchunk1004-Windows.pak.
LogPakFile: Display: Mounted Pak file '../../../Engine/Content/Paks/pakchunk1004-Windows.pak', mount point: '../../../Tii2/Content/'
LogPakFile: Display: Mount point: '../../../Tii2/Content/' is not mounted to a valid Root Path yet, assets in this pak file may not be accessible until a corresponding UFS Mount Point is added through FPackageName::RegisterMountPoint.
Which looks like it is trying to read a pak file from an engine folder.
One of the pak files was copied over into this engine folder UE_5.1\Engine\Content\Paks. It looks like paks in this folder are mounted and maybe because all the paks have the same mount point it disrupts the build process. I don’t know how or why the pak file got there but after deleting it, building works again.
Edit: Found out how the pak got there. I am using a plugin to download the pak. Executing the download in the editor puts the file there, because the execution path of the editor is somewhere in the engine folder.
Why that would affect the packaging process in that manner I do not know.