Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

The file 'archive:...' is corrupted!

Discussion in 'Asset Bundles' started by PW_Dave, May 8, 2019.

  1. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    25
    We're getting the following error on Android with our live app: The file 'archive:/CAB-921e3cfff8c441f0e54875bdf0a9325e/CAB-921e3cfff8c441f0e54875bdf0a9325e' is corrupted! Remove it and launch unity again!
    We're early in the process of debugging and trying to figure out what's happening, but we have noticed that when we load the bundle and view it in the inspector in the editor there is a "Missing (Object)" entry in the Preload Table. This seems concerning.
    upload_2019-5-8_13-31-24.png
    The problem we're having though, is that there's no way to tell what that entry should be. The bundle contains 11 textures and 1 FBX file. The textures are all accounted for, but the FBX expands into 2 assets (a skinned mesh renderer and an Object?). The FBX assets each contain the Missing (Object) entry in the Preload Table.
    upload_2019-5-8_13-32-4.png
    The build log simply shows the asset files and does not provide enough info to track this down.
    upload_2019-5-8_13-34-55.png
    How can I dig into this and figure out what the missing object is, or is that a normal occurrence with asset bundles?
     

    Attached Files:

  2. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    25
    So, it doesn't appear that the Missing (Object) is necessarily causing any issues, though it still seems questionable.

    We're getting a couple of reports with the message that (the corrupted file differs in each report):
    05-09 22:38:40.479 13383 13406 E Unity : The file 'archive:/CAB-e3dab49ebf95bf1a92a070b5c208b682/CAB-e3dab49ebf95bf1a92a070b5c208b682' is corrupted! Remove it and launch unity again!
    05-09 22:38:40.479 13383 13406 E Unity : [Position out of bounds!]

    Which is followed immediately by:
    05-09 22:39:12.474 13383 13406 E Unity : Could not allocate memory: System out of memory!
    05-09 22:39:12.474 13383 13406 E Unity : Trying to allocate: 941621248B with 16 alignment. MemoryLabel: Serialization
    05-09 22:39:12.474 13383 13406 E Unity : Allocation happened at: Line:551 in
    05-09 22:39:12.474 13383 13406 E Unity : Memory overview

    Now, I'm not sure why Unity is trying to allocate 941GB of memory, but that is causing the crash. Unfortunately, it does not appear that we get any exception or notification so that we can handle this in the app, it simply dumps to the home screen. I've been able to manually corrupt the cached bundle on the device and sometimes it gives me the corrupted file message, but other times Unity fails to load the bundle/asset and I'm able to recover by deleting the cached file and downloading it again.

    What causes the "The file '...' is corrupted!" message? And more importantly, how can we catch this at runtime so that we can delete the cached file and download it again? Could this possibly be caused by running out of storage space while downloading bundles?
     
  3. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    193
  4. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    193
    As for detecting corrupted files at runtime, the Asset bundle build process returns CRC values for each built bundle, when you use the UnityWebRequest api to download or load from cache an Asset bundle, you can pass in the CRC to validate the bundle is correct before loading.
     
  5. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    25
    I took a look at the issue that you linked, but I'm not sure if that's what is happening in our case. At least, we don't seem to have a race condition, unless the race is fixed. Since it happened consistently once it did occur.

    We do use the CRC from the build process and pass that along with a CacheAssetBundle to the UnityWebRequestAssetBundle.GetAssetBundle() call. If we happen to get bad data in the cache, usually we get a null AssetBundle or Asset when we try to load, and we can clear the file out of the cache and download it again. This is what happens most of the time. We actually had to deal with this due to using a version of Unity that has this issue: https://issuetracker.unity3d.com/is...ces-dot-resources-or-dot-ress-will-be-0-bytes

    It turns out that the device in question was in our QA dept., but it had the cache cleared before we were able to get the file off of it. If it happens again, and we're able to get more info from the test device, then I'll update our findings. Thanks for the response.
     
  6. Unity_Joseph

    Unity_Joseph

    Unity Technologies

    Joined:
    Nov 3, 2016
    Posts:
    8
    Dave, would you mind sharing a minimal repro case?
     
  7. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    25
    If I get some free time, I'll see if I can put one together. If QA comes across it again before I can get to it, I'll send it along.
     
  8. mr-bulldops

    mr-bulldops

    Joined:
    Dec 2, 2016
    Posts:
    10
    We've recently been experiencing this issue as well. I posted it here: https://answers.unity.com/questions/1629395/various-loadasset-errors-after-upgrading-to-unity.html

    We've since upgraded to 2019.1.3f1 and are still gettin the error. It seems to be very intermittent when it happens.

    • Mismatched serialization in the builtin class 'Sprite'. (Read 216 bytes but expected 768 bytes)

    • Mismatched serialization in the builtin class 'Sprite'. (Read 216 bytes but expected 592 bytes)

    • Mismatched serialization in the builtin class 'Sprite'. (Read 216 bytes but expected 584 bytes)
    I've noticed this error when trying to load an AnimationController as well as when loading a prefab from the asset system.

    I've also gotten the following errors, although slightly less frequently:

    • Size overflow in allocator.

    • The file 'archive:/CAB-36db8643db0f557b9bda530dd653a3c9/CAB-36db8643db0f557b9bda530dd653a3c9' is corrupted! Remove it and launch unity again!
    We've also gotten the huge allocation request error:
    Could not allocate memory: System out of memory!
    Trying to allocate: 18446744071980738646B with 16 alignment. MemoryLabel: String
    Allocation happened at: Line:314 in ./Runtime/Core/Containers/StringStorageDefault.h
    Memory overview

    Any suggestions on how to further diagnose and fix the error would be greatly appreciated.