ChunkDownloader Error "no FCoreDelegates::MountPak bound" when trying to "MountChunk"

Hello!

I am trying to implement ChunkDownloader. I’ve been able to read the remote manifest, copy it, and also download the PAK files.

Now the issue is that when i try to run MountChunk I get they following error:

LogChunkDownloader: BeginLoadingMode
LogPatch: Display: Specific Chunk load complete
LogChunkDownloader: EndLoadingMode (0 files downloaded, 0 chunks mounted)
LogPatch: Display: OnSingleChunkDownloadComplete
LogPatch: Display: Patch Download Complete
LogChunkDownloader: Chunk 1234 mount requested (1 pak sequence).
LogChunkDownloader: Chunk 2005 mount requested (1 pak sequence).
LogChunkDownloader: Error: Unable to mount chunk 1234 (no FCoreDelegates::MountPak bound)
LogChunkDownloader: Error: Unable to mount chunk 2005 (no FCoreDelegates::MountPak bound)
LogChunkDownloader: Error: Chunk 1234 mount failed.
LogChunkDownloader: Error: Chunk 2005 mount failed.
LogPatch: Display: Single Mount failed

I’ve spent several days trying to figure out the issue, and I’ve been unable to do so.

Any Ideas?

Thanks!

1 Like

Did you solve this?

Hey @nicotango88 and @AndrewDanileyko I have the same problem and could not solve it. If you have an idea what the issue is then please let me know. I am digging into this since days now without any success.

Cheers

There is another thread about the same problem. Unfortunately also no solution there:

Okay, I solved it!

I was stepping through the code until I ended up in the

class FChunkDownloader::FPakMountWork : public FNonAbandonableTask

where in the void DoWork() function there is the following if statement:

if (FCoreDelegates::MountPak.IsBound())

which was not the case. So you can’t get past that if statement.

So the solution is to make sure the MountPak delegate is bound. To do so define this in your class:

TSharedPtr<FPakPlatformFile> PakPlatform;
class IPlatformFile* OriginalPlatform;

and before you do your patch operation:

// Store the platform file currently set
OriginalPlatform = &FPlatformFileManager::Get().GetPlatformFile();
// See if the pak platform is valid
if (!PakPlatform)
{
	PakPlatform = MakeShareable<FPakPlatformFile>(new FPakPlatformFile());
}

// Initialize the pak platform file. This is where the MountPak delegate gets set.
PakPlatform->Initialize(&FPlatformFileManager::Get().GetPlatformFile(), TEXT(""));

// Set initialized Pak platform file
FPlatformFileManager::Get().SetPlatformFile(*PakPlatform.Get());

Now you will pass the if statement mentioned before because the MountPak delegate is set.

What you did is to tell the platform file system to treat Pak files now.

Important: After patching you need to set the original platform file again:

// Set the original platform file again after doing the pak file update.
FPlatformFileManager::Get().SetPlatformFile(*OriginalPlatform);

Otherwise the system thinks it should still treat pak files even if that is not the case anymore. The system can crash if you don’t set back the original platform file.

I hope this helps :slight_smile:

For further explanations please have a look here. That link gave me the solution after digging through engine code for days and days:

https://programmer.ink/think/ue4-pak-package-hot-update.html

5 Likes

Only happend in editor ,no need to care

I have .ucas and .utoc files generated and downloaded through ChunkDownloader.
But, it fails to mount .ucas and .utoc files, but it successfully mounts the .pak files, but at the end it sends a failure for mount complete callback.

Anyone knows how to solve this?
It seems like for the .ucas and .utoc files, the Decryptor is not valid.

@Kande Were you successful mounting the .ucas and .utoc files as well?

Did you ever solve this? I’m hitting the same issue currently.

The .pak files gets mounted, and along with them is the .utoc files for those files.
.ucas files need not be mounted, it’s being referred through those .utoc and .pak files.

It gets mounted, after I checked the source code a bit.

But even if there is no change in the content, every build has a bit different size of .pak, .utoc and .ucas files. I don’t know why, but it’s observed.

Sounds like what I’m seeing too. I see all the unable to mount errors on the .utoc and .ucas files and it is organizing the files properly, plus content is fine. It just seems odd to throw those errors when it is fine. I guess a bug on Epic’s part.