Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Addressables.InitializeAsync takes 300s with slow internet connection

Discussion in 'Addressables' started by Arvtesh, Oct 7, 2020.

Thread Status:
Not open for further replies.
  1. Arvtesh

    Arvtesh

    Joined:
    Aug 16, 2014
    Posts:
    94
    Hey there, first of all, thank you for all the good job with Addressables. Is makes content management so much easier.

    Recently we had an unexpected problem with latest version of addressables (I believe this applies to all versions).

    The app we develop uses addressable assets stored both locally and on remote CDN. We initialize addressables explicitly and then start loading local assets. This works fine with normal internet connection and with no internet, but on our test cases with slow internet the Addressables.InitializeAsync() call takes 300s to end (this is default UnityWebRequest timeout as far as I understand).

    We did set Disable catalog update on start checkbox and all our addressable groups are marked as not changeable after release. Also all of them have download timeouts set to non-default values.

    After further debugging the problem was the InitializeAsync call attempted to download a remote catalog hash file and silently failed after the default timout value. We were able to fix the problem settings the timeout for this request in Addressables code.

    So the questions:
    • Is downloading remote catalog hash during initialize call an expected behaior, even though catalog should not be updated on start and we do not load any remote content?
    • Is there a workaround for this other than changing Addressables source code?
    The short app start times are very improtant for us, and we do need an ability to at least be able to manage the request timeouts for all web requests sent by Addressables.

    Looking forward to your feedback.

    P.S. Here is a link to another thread with similar issue: https://forum.unity.com/threads/add...ote-bundles-from-cache-if-no-internet.888553/.
     
  2. abogarsukov-braingames

    abogarsukov-braingames

    Joined:
    Jul 23, 2020
    Posts:
    40
    We have this problem as well, can we have comments from Unity team please?
     
  3. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Hey there! I'll flag this with the team, and share any insight or guidance they have!
     
    Arvtesh likes this.
  4. Viacheslav28

    Viacheslav28

    Joined:
    Oct 17, 2019
    Posts:
    2
    We have the same issue! it Is super annoying to be able to forget to change the timeout before the build, so the app does not work as expected. Pls let us know about any progress regarding the issue!
     
  5. pavelk_unity

    pavelk_unity

    Joined:
    Aug 12, 2020
    Posts:
    1
    Did you fix or handle it somehow? I have the same problem.
     
  6. IgorkoSitinReality

    IgorkoSitinReality

    Joined:
    Apr 3, 2019
    Posts:
    1
  7. avindak

    avindak

    Joined:
    Mar 5, 2019
    Posts:
    11
    Hi,
    We have a game on production and we have been struggling with this issue for a while.
    This is hurting our business!
    Is there an ETA for this ?
    Please respond
     
  8. unity_C_9CapJne4sysg

    unity_C_9CapJne4sysg

    Joined:
    Aug 8, 2019
    Posts:
    1
    Hi, yeah, we have the same problem. We spent a lot of time doing some workarounds, but it didn't work properly. This thing is very important to us.
    Please let us know what we can do now to resolve this.
     
  9. vasily_m

    vasily_m

    Joined:
    Oct 19, 2020
    Posts:
    1
    Have same issue on prod. Will be helpfull to hear something
     
  10. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    Hey all, it sounds like there's a bug in the Disable catalog update on start feature. I'll get a ticket made if there's isn't one already and we'll look into this soon. If anyone with the problem wants to also file a bug it'll help us reproduce issues and drive priority.
     
  11. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    Hey all, I just wanted to say I've been trying to look into this and am having some issue reproducing. Just to be clear, when you're starting the app if you have any remote bundles that haven't been previously cached, checking Disable catalog update on start won't prevent Addressables from looking for those remote bundles online. That simply prevents us from looking for a new remote catalog. @Arvtesh I know you said you dug into the code more and pinpointed it to the remote catalog download so I'm not saying that this is your problem specifically. I just wanted to clarify for anyone else.

    The web requests to download the remote catalogs don't have a way to set the timeout so we can at least get something in for that.

    If anyone wants to file a bug and give us a project that we can reproduce the Disable catalog update on start issue please do and we'll look more into it.
     
    Arvtesh likes this.
  12. Arvtesh

    Arvtesh

    Joined:
    Aug 16, 2014
    Posts:
    94
    Thank you for the clarification, so existing Disable catalog update on start behaviour is intended. Adding the catalog request timeout settings should resolve my issue.

    That said, is there a way to use Addressables in offline-like mode until some point and then allow online calls with an explicit API call?
     
  13. ASVO

    ASVO

    Joined:
    Feb 27, 2018
    Posts:
    3
    Hi, Arvtesh, I got the same issue on iphone, it costs about 70 seconds to raise the Exception when call the Addressables.Initialize() and my CDN server cannot be reached. And I reduced the time by setting timeout in Addressables code too.

    Oddly on my android devices, it costs no more than 3 seconds.
    (I think it's default WebReuqest behavior on different Operation System. On safari, it realy costs about 70s to return error code when visit my shutted down CDN server.)

    So I'm looking forward to the Addressables Load Catalog timeout setting interface...

    Anything new about this?
     
    Last edited: Dec 17, 2020
  14. Arvtesh

    Arvtesh

    Joined:
    Aug 16, 2014
    Posts:
    94
    There’s no news as far as I know. We still have to set the timeout manually before each build.
     
  15. ASVO

    ASVO

    Joined:
    Feb 27, 2018
    Posts:
    3
    All right. Thanks for your reply. Hope it works fine.
     
    Most_Incredible likes this.
  16. Calabash_Boy

    Calabash_Boy

    Joined:
    Aug 6, 2019
    Posts:
    2
    So, Is there a workaround for this issue than changing Addressables source code? We had been troubled by this issue for a while.
     
  17. Arvtesh

    Arvtesh

    Joined:
    Aug 16, 2014
    Posts:
    94
    @davidla_unity, is there any ETA for the fix? We need at least the ability to set download timeouts for the remote catalog.
     
  18. PumpKlN

    PumpKlN

    Joined:
    Sep 21, 2020
    Posts:
    1
    We have the same, Can I set download .hash file timeout?
     
  19. NNSkelly

    NNSkelly

    Joined:
    Nov 16, 2015
    Posts:
    35
    Tangential problem: my limited experience with Addressables (as of July/Aug) is that builds will happily wait only about 30 seconds if there's NO internet connection before failing and letting the app load. However, if there's some internet and we do get the catalog... the underlying curl async retrieval of the Addressable payload will time out and give up in 3000ms if the complete asset package has not been downloaded. I'm not even finding the catalog timeout setting, let alone content timeout settings, but it seems lopsided that the default behavior is to give a kilobyte-sized file dozens of seconds to load, but megabyte-sized files only get 3 seconds...
    Edit: turns out asset timeout is buried in the Advanced drawer of each individual asset group bundle schema... once ouu even figure out where those are and how they're attached.
     
    Last edited: Aug 23, 2021
Thread Status:
Not open for further replies.