# Critical error: Serial size mismatch

**URL:** <https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026>\
**Category:** Audio\
**Tags:** unreal-engine, UE5-0\
**Created:** [July 22, 2021, 5:10pm UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026 "2021-07-22T17:10:11Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaspi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kaspi](https://forums.unrealengine.com/u/Kaspi)\
**Post date:** [July 22, 2021, 5:10pm UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/1 "2021-07-22T17:10:11Z")

</div>

Hey guys, having trouble with this sound asset when running the shipping dedicated server of the game, which was converted from a UE4 project to UE5. The asset works just fine in the UE5 editor and the builds/cooks/packs successfully, but when I try to start the game’s dedicated server, I get:

```auto
Fatal error: [File:C:/Users/Test-Rend/Desktop/UE5/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncLoading.cpp] [Line: 3246] 
[2021.07.22-17.07.29:812][0]LogWindows: Error: SoundWave /Game/SurvivalGameKitV2/Sounds/Wav/S_Click1.S_Click1: Serial size mismatch: Got 52, Expected 3724

```

[Log.txt](https://forums.unrealengine.com/uploads/short-url/2e9uf6PqjIVf8kcuHgj7PIJKNoa.txt) (48.5 KB)

Tried re-saving and renaming + re-saving the asset, didn’t help. Any other ideas to try? Thanks in advance. 🙂

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [July 23, 2021, 11:47am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/2 "2021-07-23T11:47:02Z")

</div>

> [@Kaspi](#):
>
> `AsyncLoading.cpp` error Line: 3246

The source code for the procedure in  
FAsyncPackage::

> EventDrivenSerializeExport  
> (int32 LocalExportIndex)

UE5 and UE4.26 seems to be the same for both versions.

The log of output is interesting in that the name of the failing file is given

> [2021.07.22-17.07.29:812][0]LogWindows: Error:

> SoundWave /Game/SurvivalGameKitV2/Sounds/Wav/S\_Click1.S\_Click1

Serial size mismatch: Got 52, Expected 3724

I believe this could mean that the file sound have been incorrectly exported with only 52 bytes sent instead of 3724 bytes.

Would it be possible to examine file files in Windows File Explorer and check they are the same size and not corrupted.  
Maybe you could copy the file over from UE4 to UE5 project to see if that fixes it.

---

<div class="post-metadata">

**Author:** ![Kaspi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kaspi](https://forums.unrealengine.com/u/Kaspi)\
**Post date:** [July 24, 2021, 2:28pm UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/3 "2021-07-24T14:28:18Z")

</div>

Hi there!

Seems like the file size changes during the cooking/packing process. On the screenshot attached, the left is project Content folder while on the right there’s the packed game’s content folder. You can see that the .uasset file sizes are different.

Any idea what may cause this?

 ![Screenshot_1](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/d/ddb5cecc5c217b0c2873ee312cd725aaa3f77e58.png)

---

<div class="post-metadata">

**Author:** ![Kaspi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kaspi](https://forums.unrealengine.com/u/Kaspi)\
**Post date:** [July 27, 2021, 8:24am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/4 "2021-07-27T08:24:58Z")

</div>

If I try to copy S\_Click1.uasset from the Content directory to the packed game’s content directory, I get this error instead:

```auto
Assertion failed: CurrentPos + Count <= TotalSizeOrMaxInt64IfNotReady() [File:C:/Users/Test-Rend/Desktop/UE5/Engine/Source/Runtime/CoreUObject/Private/Serialization/AsyncLoading.cpp] [Line: 7962] 
Error: Seeked past end of file /Game/SurvivalGameKitV2/Sounds/Wav/S_Click1 (6542 / 6541)

```

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [August 4, 2021, 12:48pm UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/5 "2021-08-04T12:48:06Z")

</div>

Hi @Kaspi ,  
After examining the code for many days I may have come up with a fix. It involves patching the source and rebuilding the UE5 EA.  
I have noticed in the supplied dump that many other files have been corrupted on the move, but the one in your message has seeked too far hence the report.  
I have a patch that may work.

Open the UE5 EA source build and enter “AsyncLoading.cpp” in the Solution Explorer  
When the code opens type Control + G, in the Go To Line box type 7961 and enter  
Edit the code so as seen below adding the “+1”

> checkf(CurrentPos + Count \<= _ **1 +** _ TotalSizeOrMaxInt64IfNotReady(), TEXT(“Seeked past end of file %s (%lld / %lld)”), \*PackagePath.GetDebugName(), CurrentPos + Count, TotalSize());
> 
> ![Screenshot (60)](https://d3kjluh73b9h9o.cloudfront.net/original/3X/3/f/3f7f41c2b7633d22605c6c8ce8035b0729e081ce.png)

I have put this patch on my UE5EA Vs2022 archive as described in  
[Visual Studio 2022 Preview is 64 bit and compiles and runs UE 5.0 EA approximately 20% FASTER - Development Discussion / Unreal Engine 5 Early Access - Unreal Engine Forums](https://forums.unrealengine.com/t/visual-studio-2022-preview-is-64-bit-and-compiles-and-runs-ue-5-0-ea-approximately-20-faster/237164/12)  
If you need to used it, but simply changing the source file would be an easier fix and keep you close to the original.  
It it works I will try and enter a bug report.

---

<div class="post-metadata">

**Author:** ![Tbjbu1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tbjbu1](https://forums.unrealengine.com/u/Tbjbu1)\
**Post date:** [April 21, 2022, 8:19pm UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/6 "2022-04-21T20:19:21Z")

</div>

Hello, I had this exact issue and found the solution.  
Package your game to Server build target and use those files to start the server.

 ![Screenshot_98](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/0/b/50b6928e79150e0da7da67120a61e3f26366eeae.png)

---

<div class="post-metadata">

**Author:** ![JakeTee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakeTee](https://forums.unrealengine.com/u/JakeTee)\
**Post date:** [May 27, 2022, 7:34am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/7 "2022-05-27T07:34:43Z")

</div>

Having the exact issue on UE 5.0 with run-time mounting pak file. The weird thing here is that only sound wave files trigger the issue, as long as no wave sounds are used, everything else can be loaded normally (i.e class, textures, materials)

---

<div class="post-metadata">

**Author:** ![JakeTee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakeTee](https://forums.unrealengine.com/u/JakeTee)\
**Post date:** [July 28, 2023, 2:22am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/8 "2023-07-28T02:22:05Z")

</div>

Update: Does not work with 5.0.3. I realize even til 5.2, they still dont change it

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [July 28, 2023, 5:52am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/9 "2023-07-28T05:52:27Z")

</div>

Hi @JakeTee ,  
I agree but they say its not a high on the list of bugs to be fixed in 5.2 even Lighting Shadows wont work. I am working on 5.3/5.4 now so just dont know

---

<div class="post-metadata">

**Author:** ![JakeTee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@JakeTee](https://forums.unrealengine.com/u/JakeTee)\
**Post date:** [August 5, 2023, 1:25am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/10 "2023-08-05T01:25:11Z")

</div>

Is it working by adding 1 to the the `checkf` because mine doesn’t work ☹

---

<div class="post-metadata">

**Author:** ![Jimbohalo10](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jimbohalo10/32/961440_2.png) [@Jimbohalo10](https://forums.unrealengine.com/u/Jimbohalo10)\
**Post date:** [August 5, 2023, 6:31am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/11 "2023-08-05T06:31:06Z")

</div>

sorry but the patches wont work any more

---

<div class="post-metadata">

**Author:** ![Kaspi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kaspi](https://forums.unrealengine.com/u/Kaspi)\
**Post date:** [August 5, 2023, 9:49am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/12 "2023-08-05T09:49:08Z")

</div>

This was apparently caused by packaging various versions of the game with the `-iterate` flag on automation tool. For example, if I cooked windows client after linux dedicated server, this happened. The solution for me was to remove the `-iterate` flag from the RunUAT scirpt (automation tool).

My understanding is that the `-iterate` flag/argument makes the cooking process to use the previously cooked resources, which may have been cooked for a different platform/target and fails. Then the client and server have a mis-matched size on cooked assets (one of which was cooked normally and the other has no/empty asset files).

If I am correct, the `-iterate` flag is added automatically if you cook from the editor. For full control over the packaging process, you can use the RunUAT script with the parameters you can find in the Output log after you start the packaging process (without the `-iterate` flag), [example](https://github.com/kasp1/dozer-pipelines/blob/main/sample-pipelines/microsoft-store/deploy.yaml#L36).

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [September 4, 2023, 9:49am UTC](https://forums.unrealengine.com/t/critical-error-serial-size-mismatch/242026/13 "2023-09-04T09:49:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
