Search Unity

1.8.3 crashes on switch, calls CreateDirectory function

Discussion in 'Addressables' started by dizzy2003, Apr 28, 2020.

  1. dizzy2003

    dizzy2003

    Joined:
    Nov 25, 2013
    Posts:
    108
    OnCatalogLoaded calls CreateDirectory Unity 2019.3.f10f1





    [Switch - il2cpp/os/File.cpp - File::GetFileAttributes] Trying to redirect 'rom:/com.unity.addressables' write to 'host:/com.unity.addressables'
    [Switch - il2cpp/os/File.cpp - File::GetFileAttributes] Trying to redirect 'rom:/com.unity.addressables' write to 'host:/com.unity.addressables'
    [Switch - il2cpp/os/Directory.cpp - Directory::Create] Trying to write to 'rom:' mount path 'rom:/com.unity.addressables'!
    Host I/O operation failed on com.unity.addressables with Windows API error 5. Please refer to Windows System Error list.
    [Switch - il2cpp/os/File.cpp - Directory::Create] Redirected 'rom:/com.unity.addressables' write to 'host:/com.unity.addressables'
    IOException: Win32 IO returned 167. Path: /com.unity.addressables
    at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00000] in <00000000000000000000000000000000>:0
    at System.IO.Directory.CreateDirectory (System.String path) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp.OnCatalogLoaded (UnityEngine.AddressableAssets.ResourceLocators.ContentCatalogData ccd) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.AddressableAssets.ResourceProviders.ContentCatalogProvider+InternalOp.<Start>b__5_1 (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] op) [0x00000] in <00000000000000000000000000000000>:0
    at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
    at DelegateList`1[T].Invoke (T res) [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].InvokeCompletionEvent () [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1[TObject].UnityEngine.ResourceManagement.AsyncOperations.IAsyncOperation.InvokeCompletionEvent () [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.ResourceManagement.ResourceManager.ExecuteDeferredCallbacks () [0x00000] in <00000000000000000000000000000000>:0
    at UnityEngine.ResourceManagement.ResourceManager.Update (System.Single unscaledDeltaTime) [0x00000] in <00000000000000000000000000000000>:0
    at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0
    at MonoBehaviourCallbackHooks.Update () [0x00000] in <00000000000000000000000000000000>:0
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    DelegateList`1:Invoke(AsyncOperationHandle`1)
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:InvokeCompletionEvent()
    UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:UnityEngine.ResourceManagement.AsyncOperations.IAsyncOperation.InvokeCompletionEvent()
    UnityEngine.ResourceManagement.ResourceManager:ExecuteDeferredCallbacks()
    UnityEngine.ResourceManagement.ResourceManager:Update(Single)
    System.Action`1:Invoke(Single)
    MonoBehaviourCallbackHooks:Update()
     
  2. dizzy2003

    dizzy2003

    Joined:
    Nov 25, 2013
    Posts:
    108
    Note I have Build Remote Catalog enabled, because the whole need for addressables is to patch the switch build later

    I found I could bypass the call to CreateDirectory by setting the top level group settings for catalog
    BuildPath BuildTarget
    LoadPath BuildTarget

    previosuly they were set to
    BuildPath LocalBuildPath
    LoadPath LocalLoadPath

    which I thought would put the catalog on the local device but apparently the catalog code appears to still think its remote and tries to make a cache folder for it regardless of whether the device supports it.
     
  3. dizzy2003

    dizzy2003

    Joined:
    Nov 25, 2013
    Posts:
    108
    Actually I'm no longer sure that fixed it, I may have just had enable host IO on the next build. disabling catalog fixed it for sure.
     
  4. KAJed

    KAJed

    Joined:
    Mar 15, 2013
    Posts:
    122
    Bumping this thread because making this work should be a fix in the Addressables system. Two places need to change in order to make it work in 1.18.x.

    TextDataProvider needs to do
    Code (CSharp):
    1. else if (ResourceManagerConfig.ShouldPathUseWebRequest(path))
    before File.Exists (because File.Exists explodes on the switch when checking if a catalog at an IP exists)

    OnCatalogLoaded in ContentCatalogProvider should be changed because it tries to do what you're describing and write the remote hash to a local file (which it can't do because there is no file system mounted). This section could be probably be omitted on the switch as I'm not even sure that file is every used again anyway.

    @TreyK-47 it would be great if the devs could have a look at this so that remote updates work (even if it's just for quick iterations locally)
     
    Last edited: Jul 27, 2021
  5. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Flagging for the team.
     
  6. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    gotcha, this makes sense. Thanks for the info. I'll make a ticket for us to look at. Thanks all