# Assertion failed on OnUnmountPak.Execute()

**URL:** <https://forums.unrealengine.com/t/assertion-failed-on-onunmountpak-execute/397628>\
**Category:** C++\
**Tags:** patch, dlc, assertion-failed, UE4-15, unreal-engine, CPP, question\
**Created:** [July 19, 2017, 12:01pm UTC](https://forums.unrealengine.com/t/assertion-failed-on-onunmountpak-execute/397628 "2017-07-19T12:01:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wingedrobin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wingedrobin](https://forums.unrealengine.com/u/wingedrobin)\
**Post date:** [July 19, 2017, 12:01pm UTC](https://forums.unrealengine.com/t/assertion-failed-on-onunmountpak-execute/397628/1 "2017-07-19T12:01:20Z")

</div>

Hi,

I’m using FCoreDelegates::OnMountPak and FCoreDelegates::OnUnmountPak function to handle my patch/DLC pak file. But in ue 4.15, when i execute the FCoreDelegates::OnUnmountPak.Execute( ) to unmount the pak file. It will encounter an assertion failed. Follow are the call stack of the android platform:

```
07-19 18:59:32.516: D/UE4(16133): Assertion failed: PakPrecacherSingleton [File:C:\UnrealEngine-4.15\Engine\Source\Runtime\PakFile\Private\IPlatformFilePak.cpp] [Line: 1006] 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!FDebug::LogAssertFailedMessage(char const*, char const*, int, wchar_t const*, ...) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!FPakPlatformFile::Unmount(wchar_t const*) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!UPatchingSystem::UnmountOutOfDatePaks(TArray<FString, FDefaultAllocator>&) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!UPatchingSystem::Synchronize(TArray<FObjectSyncInfo, FDefaultAllocator> const&) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!void ZResponseProcessor::Process<(unsigned char)140, FAwsS3SyncMessageObject>(FAwsS3SyncMessageObject const&, bool) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!void UMMOGameplayHttp::DispatchResponse<FAwsS3SyncMessageObject>(unsigned char, FAwsS3SyncMessageObject const&, bool) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!void UMMOGameplayHttp::Response<FAwsS3SyncMessageObject>(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!decltype ((((*this).Obj)->*((*this).MemFunPtr))((Forward<TSharedPtr<IHttpRequest, (ESPMode)0>&>)({parm#1}), (Forward<TSharedPtr<IHttpResponse, (ESPMode)1>&>)({parm#1}), (Forward<bool&>)({parm#1}))) TMemberFunctionCaller<UMMOGameplayHttp, void (UMMOGameplayHttp::*)(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool)>::operator()<TSharedPtr<IHttpRequest, (ESPMode)0>&, TSharedPtr<IHttpResponse, (ESPMode)1>&, bool&>(TSharedPtr<IHttpRequest, (ESPMode)0>&, TSharedPtr<IHttpResponse, (ESPMode)1>&, bool&) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!decltype ({parm#1}((Forward<TSharedPtr<IHttpRequest, (ESPMode)0>&>)({parm#2}), (Forward<TSharedPtr<IHttpResponse, (ESPMode)1>&>)({parm#2}), (Forward<bool&>)({parm#2}))) TTupleImpl<TIntegerSequence<unsigned int>>::ApplyAfter<TMemberFunctionCaller<UMMOGameplayHttp, void (UMMOGameplayHttp::*)(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool)>, TSharedPtr<IHttpRequest, (ESPMode)0>&, TSharedPtr<IHttpResponse, (ESPMode)1>&, bool&>(TMemberFunctionCaller<UMMOGameplayHttp, void (UMMOGameplayHttp::*)(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool)>&&, TSharedPtr<IHttpRequest, (ESPMode)0>&, TSharedPtr<IHttpResponse, (ESPMode)1>&, bool&) const 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!TBaseUObjectMethodDelegateInstance<false, UMMOGameplayHttp, TTypeWrapper<void> (TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool)>::Execute(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool) const 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!TBaseUObjectMethodDelegateInstance<false, UMMOGameplayHttp, void (TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool)>::ExecuteIfSafe(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool) const 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!TBaseDelegate<void, TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool>::ExecuteIfBound(TSharedPtr<IHttpRequest, (ESPMode)0>, TSharedPtr<IHttpResponse, (ESPMode)1>, bool) const 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!FCurlHttpRequest::FinishedRequest() 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!FHttpManager::Tick(float) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!FTicker::Tick(float) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!FEngineLoop::Tick() 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!AndroidMain(android_app*) 
07-19 18:59:32.516: D/UE4(16133): libUE4.so!android_main() 
07-19 18:59:32.516: D/UE4(16133): libUE4.so![Unknown]() 
07-19 18:59:32.516: D/UE4(16133): libc.so![Unknown]() 
07-19 18:59:32.516: D/UE4(16133): libc.so![Unknown]() 
07-19 18:59:32.516: D/UE4(16133): [2017.07.19-10.59.32:534][0]Assertion failed: Assertion failed: PakPrecacherSingleton [File:C:\UnrealEngine-4.15\Engine\Source\Runtime\PakFile\Private\IPlatformFilePak.cpp] [Line: 1006] 
07-19 18:59:32.526: D/UE4(16133): [2017.07.19-10.59.32:543][0]LogWindows: FAndroidMisc::RequestExit(1)

```

I found the assertion is cause by PakPrecacherSingleton (in file IPlatformFilePak.cpp) equal to NULL.

![192328-pakprecachersingleton_is_null.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/8/1/48129fc57bc8c7ee9f9253998744f9ac00591f52.jpeg)

And I also found:

`#define USE_PAK_PRECACHE (!IS_PROGRAM && !WITH_EDITOR) // you can turn this off to use the async IO stuff without the precache`

at line 50 (also in IPlatformFilePak.cpp) seems can be disable to skip the precache.

![192327-gpakcache_enable_is_true.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/5/0551eae26d77243d3374fbb93d3523a08e07e830.jpeg)

But I really don’t want to modify the source code of the engine. Is there any way to resolve this issue? Thanks. 🙂

Here is the code how I use FCoreDelegates::OnUnmountPak

 ![192329-unmount_pak.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/0/f/b0f4bc85f16727c587e1ac8605e1a753790622ea.jpeg)

PS: DebugGame and Shipping has the same issue.

---

<div class="post-metadata">

**Author:** ![SlimeQ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SlimeQ](https://forums.unrealengine.com/u/SlimeQ)\
**Post date:** [August 2, 2017, 11:18pm UTC](https://forums.unrealengine.com/t/assertion-failed-on-onunmountpak-execute/397628/2 "2017-08-02T23:18:42Z")

</div>

figure anything out?

---

<div class="post-metadata">

**Author:** ![RahulHighavenue](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rahulhighavenue/32/88719_2.png) [@RahulHighavenue](https://forums.unrealengine.com/u/RahulHighavenue)\
**Post date:** [December 1, 2021, 11:24am UTC](https://forums.unrealengine.com/t/assertion-failed-on-onunmountpak-execute/397628/3 "2021-12-01T11:24:54Z")

</div>

**The sad thing is this problem still persists in 4.27, in IOS. The precacher is null causing the whole application to crash.  
This is the error shown by the log file:**

[UE4] [2021.11.28-14.37.18:548][136]LogPakFile: PakFile FullDirectoryIndexSize=1209

[UE4] [2021.11.28-14.37.18:548][136]LogShaderLibrary: Display: ShaderCodeLibraryPakFileMountedCallback: PakFile ‘/var/mobile/Containers/Data/Application/9A9E3962-79DA-418D-BB02-DB9FD8242646/Documents/Saved/pakchunk1001-ios.pak’ (chunk index 1001, root ‘…/…/…/TestingFirebase/Content/’) mounted

[UE4] [2021.11.28-14.37.18:550][136]LogMetal: Display: No .metalmap file found for global\_chunk1001\_sf\_metal!

[UE4] [2021.11.28-14.37.18:551][136]LogMetal: Display: Failed to create library: Error Domain=MTLLibraryErrorDomain Code=6 “library not found” UserInfo={NSLocalizedDescription=library not found}

[UE4] [2021.11.28-14.37.18:552][136]LogPakFile: OnPakFileMounted2Time == 0.003340

[UE4] [2021.11.28-14.37.18:552][136]LogBlueprintUserMessages: [DefaultPawn\_BP\_C\_2147482535] Mounted File

[UE4] [2021.11.28-14.37.18:553][136]LogStreaming: Display: FlushAsyncLoading: 1 QueuedPackages, 0 AsyncPackages

[UE4] [2021.11.28-14.37.18:553][136]LogPackageLocalizationCache: Processed 1 localized package path(s) for 1 prioritized culture(s) in 0.000065 seconds

[UE4] [2021.11.28-14.37.18:553][136]LogOutputDevice: Warning:

[UE4] Assertion failed: PakPrecacherSingleton [File:/Users/build/Build/++UE4/Sync/Engine/Source/Runtime/PakFile/Private/IPlatformFilePak.cpp] [Line: 1462]

[UE4] [2021.11.28-14.37.18:553][136]Assertion failed: PakPrecacherSingleton [File:/Users/build/Build/++UE4/Sync/Engine/Source/Runtime/PakFile/Private/IPlatformFilePak.cpp] [Line: 1462]

[UE4] [2021.11.28-14.37.18:556][136]LogGenericPlatformMisc: FPlatformMisc::RequestExit(1)

**I would love for a solution or workaround for this. If anyone from the unreal team or outside could give a solution for this, it would be great.**

---

<div class="post-metadata">

**Author:** ![Heesun\_Lee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Heesun\_Lee](https://forums.unrealengine.com/u/Heesun_Lee)\
**Post date:** [May 18, 2022, 8:36am UTC](https://forums.unrealengine.com/t/assertion-failed-on-onunmountpak-execute/397628/4 "2022-05-18T08:36:32Z")

</div>

Has anyone solved this problem?

I have same problem in Windows Platform on 4.27.2
