+4
Fixed

Failed to load unit options (and variant)

Necka 2 years ago updated by Lazlo Bonin (Lead Developer) 1 year ago 15 2 duplicates

Hello, 

I've got errors in 1.4 final (didn't get them in 1.4 Beta 3) 


For the Failed to load unit options from the screenshot here are the details:

Failed to load unit options.
Try to rebuild them with 'Tools > Bolt > Build Unit Options...'.

System.Threading.ThreadAbortException
  at Bolt.UnitBase.Load () [0x00123] in C:\Users\lazlo\Projects\Ludiq\Bolt.Flow\Editor\Options\UnitBase.cs:107 
UnityEngine.Debug:LogError(Object)
Bolt.UnitBase:Load() (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:116)
Bolt.UnitBase:AutoLoad() (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:36)
System.Reflection.MethodBase:Invoke(Object, Object[])
Ludiq.<>c__DisplayClass0_0:<.cctor>b__4() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:2480)
Ludiq.BackgroundWorker:Work() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:2449)
System.Threading.ThreadHelper:ThreadStart()

Then for the specific 3rd party asset unit options error (again, was working in last Beta - or at least it didn't throw errors)

Failed to load option 'Umbrace.Unity.PurePool.ComponentPool.DontDestroyOnLoad@get'.
System.InvalidOperationException: Missing parameter types.
  at Ludiq.Member.EnsureExplicitParameterTypes () [0x00008] in C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Runtime\Reflection\Member.cs:589 
  at Ludiq.Member.ReflectMethod (System.Collections.Generic.IEnumerable`1[T] candidates) [0x00007] in C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Runtime\Reflection\Member.cs:727 
  at Ludiq.Member.Reflect () [0x001b0] in C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Runtime\Reflection\Member.cs:668 
  at Ludiq.Member.EnsureReflected () [0x00008] in C:\Users\lazlo\Projects\Ludiq\Ludiq.Core\Runtime\Reflection\Member.cs:750 
  at Bolt.MemberUnitOption`1[TMemberUnit].Prewarm () [0x00006] in C:\Users\lazlo\Projects\Ludiq\Bolt.Flow\Editor\Framework\Codebase\MemberUnitOption.cs:106 
  at Bolt.UnitBase.Load () [0x000f3] in C:\Users\lazlo\Projects\Ludiq\Bolt.Flow\Editor\Options\UnitBase.cs:99 
UnityEngine.Debug:LogError(Object)
Bolt.UnitBase:Load() (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:106)
Bolt.UnitBase:AutoLoad() (at C:/Users/lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:36)
System.Reflection.MethodBase:Invoke(Object, Object[])
Ludiq.<>c__DisplayClass0_0:<.cctor>b__4() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:2480)
Ludiq.BackgroundWorker:Work() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:2449)
System.Threading.ThreadHelper:ThreadStart()

I think there is an issue with my unit options because they don't save.

If I add some custom ones, they don't stay after a restart of Unity apparently. The DLL ones stay (I have only one actually) but not the one from the second page

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):

Duplicates 2

Just open unity3d ~~~

After run a scene~~~ No,i never have a folder in C:/buildslave

(⊙︿⊙)

So sorry you're getting these day-1 issues! I must have made some last minute changes that triggered them.

Do they persist if you regenerate your unit database? (Tools > Bolt > Build Unit Database)

The error persisted after regenerating the database and after restarting unity yes.


I tried reproducing the issue but I don't get any error with iTween installed and in my unit options.

Can you provide reproduction steps? Thanks!

For the reproduction steps honestly there wasn't much outside importing Bolt and generating the unit options within the setup wizard

So I managed to get the errors despite a clean project (still lots of assets) 

The repro for me was:

-Unit Option wizard

-Add a DLL in the first page

-Add 2 Unit options in the second page (for a completely different asset)

-Generate

-No errors at this stage

-Quit Unity and Restart it

-Errors:


-Other Major issue with that is that the Unit options added disapeared from the Unit Option wizard. It's probably related

Basically it doesn't save the unit options after a restart


I have rollback to beta3

Working on Fix

Thanks for your repro steps for the failed unit options bug, but can you specify which third party plugin causes it?

I couldn't trigger it with iTween.

I want to issue a hotfix for this today!

I have problem with Bolt even on a new project, without any other plugins (except the default packages from Unity).

Nevermind! It works now. :)

Fixed

Found the causes & fixed them for today's hotfix. Also improved the general error recovery. In short:

  • Type and member deserialization is now more defensive and should "fail early", preventing hard to debug problems
  • Members won't try to reflect during unit options loading, greatly improving the speed of that operation
  • Error recovery code for unit options loading has been improved
  • A new less scary warning will replace these scary error messages when options fail to load:

Hi there,

I get this error sometimes when starting Unity together with the warnings "dictionary/variable assets failed" (which I read will be fixed in 2018.3, but have been before this error appeared). I'm currently on Unity 2018.2.14f and the latest Bolt version in Net 4.x.

I get randomly Unity crashes. I have no idea when, but with no other errors maybe this is the reason.

Greetz Marten


Failed to load unit options.
Try to rebuild them with 'Tools > Bolt > Build Unit Options'.


System.Threading.ThreadAbortException
at (wrapper managed-to-native) System.Threading.Monitor.Exit(object)
at Ludiq.BackgroundWorker.ReportProgress (System.String title, System.Single progress) [0x0001c] in <0828d6c22fd54865b8a825458bd741a9>:0
at Ludiq.ProgressUtility.DisplayProgressBar (System.String title, System.String info, System.Single progress) [0x0000f] in <0828d6c22fd54865b8a825458bd741a9>:0
at Bolt.UnitBase.Load () [0x0010a] in C:\Users\lazlo\Projects\Bolt1\Package\Bolt.Flow\Editor\Options\UnitBase.cs:107
UnityEngine.Debug:LogError(Object)
Bolt.UnitBase:Load() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Options/UnitBase.cs:138)
Bolt.UnitBase:AutoLoad() (at C:/Users/lazlo/Projects/Bolt1/Package/Bolt.Flow/Editor/Options/UnitBase.cs:37)
System.Reflection.MethodBase:Invoke(Object, Object[])
Ludiq.<>c__DisplayClass0_0:<.cctor>b__3()
Ludiq.BackgroundWorker:Work() (at C:/Users/lazlo/Projects/Bolt1/Package/Ludiq.Core/Editor/Plugin/Changelogs/Changelog_1_4_0.cs:58)
System.Threading.ThreadHelper:ThreadStart()

+1

Hi Elapse,

Please start a new thread for your report, this one has been closed many months ago.

Re: the ThreadAbortException, it seems related to the experimental "Automatically Update Unit Options" which you seem to have checked in the preferences. It's harmless, but it might show up sometimes if Unity reloads assemblies while the options are being updated.

As you mentioned, the DictionaryAsset/VariablesAsset error is on Unity's end and is fixed in 2018.3.

For the crashes, please submit a different report with reproduction steps!