Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Remote catalog bundle hash sometimes different than generated bundle hash

Discussion in 'Addressables' started by Peter77, Aug 7, 2021.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,438
    Unity 2019.4.20f1, Addressables 1.18.13, Android Player

    When I build Addressables Content and a Player, the remote catalog sometimes contains the wrong hash for a random bundle. I'm unable to reliably reproduce this issue, it occurs randomly and I only notice it when I try to download all content with
    Addressables.DownloadDependenciesAsync
    :
    Code (CSharp):
    1. RemoteProviderException: Unable to load asset bundle from : https://xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.client-api.unity3dusercontent.com/client_api/v1/buckets/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/release_by_badge/latest/entry_by_path/content/?path=Android/r-level-high_coast_00-scenes_scenes_assets/scenes/high_coast_00/high_coast_00+audio.unity_150747b2fab3020da720d72993cf955c.bundle
    2. Rethrow as OperationException: GroupOperation failed because one of its dependencies failed
    3. Rethrow as ResourceManagerException: ProvideResources failed
    4. Rethrow as OperationException: ChainOperation failed because dependent operation failed
    I checked the build server and Unity Cloud Content Delivery. The bundle that the build generated is the bundle that was uploaded to Unity Cloud Content Delivery.
    However, the remote catalog somehow contains a different bundle hash than the bundle that was actually generated.

    Addressables requests:
    high_coast_00+audio.unity_150747b2fab3020da720d72993cf955c.bundle

    Asset bundle that was built and uploaded for this version is:
    high_coast_00+audio.unity_43f74bed67452edf315eb4ab0e4bb721.bundle


    How can I fix or workaround this problem?
     
    Last edited: Aug 7, 2021
    CineTek and Driven like this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,438
    After a few days of trial&error, I found it's related to the
    Bundle Mode
    setting. Using
    Pack Separately
    on an AssetGroup that contains multiple scenes, always causes that a random scene from this group can't be downloaded. Changing the
    Bundle Mode
    to
    PackTogether
    works around the issue.

    I tried the last couple of hours to reproduce it in a new project, but it doesn't reproduce. Perhaps it's related to a certain complexity of the AssetGroup setups and assets in the project?

    @TreyK-47 can you please forward this information to the Addressables developers. Perhaps they have an idea why the Bundle Mode setting somehow causes that a different hash is stored in the remote catalog than the bundle is actually named.

    upload_2021-8-10_7-54-28.png

    EDIT: Yesterday I ran into this problem again. It was again a scene that could not be loaded, but this time the bundle mode wasn't even "Pack Separately". My workaround was to delete the Cache Server content, the Library folder and other Unity cache directories. This got rid of the problem for now, but I guess it was just luck and the issue will occur again eventually.
     
    Last edited: Aug 12, 2021
  3. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,795
    Forwarding this to the team!
     
    Peter77 likes this.
  4. Driven

    Driven

    Joined:
    May 31, 2013
    Posts:
    77
    Any updates on this? I can confirm that every other build the hashes of some assets are wrong and cause errors when trying to download them.It started happening only from version 1.18.13 and worked in 1.18.11.
     
    CineTek and Peter77 like this.
  5. unity_krista

    unity_krista

    Unity Technologies

    Joined:
    Apr 28, 2020
    Posts:
    40
    Hmmm, I'll create a ticket to look into it. There was an update to bundle hashing between 1.18.13 and 1.18.1, could be related. Sounds like it may be difficult to reproduce, but would either of you be able to share a repro project?
     
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,438
    Thank you for the reply. Did you have a chance to look into it yet?

    I wish I had a reproduce! I thought it's related to "Pack Separately", but the issue occurs with "Pack Together" too. The problem seems totally random. Sometimes a few builds in a row are affected and sometimes days go by (tens of builds) without this issue at all.
     
  7. unity_krista

    unity_krista

    Unity Technologies

    Joined:
    Apr 28, 2020
    Posts:
    40
    I've been unable to reproduce it so far. But I have been trying on Windows standalone, it may be that it is Android specific, I'll check with someone who has an Android to test.
     
  8. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    Hey all, I just wanted to pop in and say that Krista and I both have tried to reproduce this issue on various platforms, including Android. No luck so far. We'll keep and eye out for this, but if you can provide any more info, or preferably submit a bug with a repro project (Peter, I know you said you didn't have a good repro project at the time, but just if you do get a consistent repro) that'd be awesome.

    I apologize for the inconvenience. Hopefully we can get something figured out.
     
  9. CineTek

    CineTek

    Joined:
    Jul 12, 2013
    Posts:
    98
    We are in a closed beta environment and are also facing this issue - we have packed seperately as a setting.
    If that helps, the game is currently "live" in a closed access environment. Some players can download a remote update without an issue, some others are receiving the hash error mentioned above and have to manually clear their cache where remote content is stored. Affects all platforms, iOS, Android, PC, Mac
     
    Peter77 likes this.
  10. Mad_Max_Sharecare

    Mad_Max_Sharecare

    Joined:
    Jun 1, 2020
    Posts:
    6
    Hi!
    Not sure if this a right thread to post (may be I should create a separate thread or file a bug).
    May be you'll find this useful, in regard to "randomness" of hashes for remote catalog.
    I've noticed that, sometimes, the hash of remote catalog (and even generated) seems to depends on what scene is opened in Editor at the time of build (?!!).
    Probably I'm wrong, but I've thought that if build made on the same machine ( ;) ) and nothing was changed in the related files - the hashes and bundles, and the catalog will be identical each time...

    Thanks! ;)

    Here is the video from my test (Unity 2021.2.7, Addressables 1.19.19) and the test project. Tested this on Mac and Windows on my side.

    Addressables_Test_2.gif
     

    Attached Files:

  11. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    I had similar issue before, but I figured out that it was because of the remote catalog wasn't being downloaded successfully, so the Addressables used the fallback catalog in the device which contained old hashes from previous build. But Addressables handled this silently, which gave me a false sense that everything worked fine. I ended up using Fiddler to check if the remote catalog was really being downloaded, if not, there might be a problem with the remote catalog path.
     
  12. unitypsycurio

    unitypsycurio

    Joined:
    Apr 20, 2020
    Posts:
    2
    We had similiar issues Android