+1
Fixed

Can't update unit options

Nanda 3 years ago updated by Lazlo Bonin (Lead Developer) 3 years ago 9

Hello,
After upgrading bolt to version 1.2.2 I am having an issue when I try to update my unit options. First of all, I noticed that when I open Play Mode I got the following error in my console:

MissingValuePortInputException: Missing input value for 'distanceToTarget'.

When I checked my flow graph, I noticed my connections were missing, as well as some of my flow units:


Basically, what it is supposed to do, is get the transform position values of the Origin and Target objects. Now, it's not just the connections that are missing.

I use the Ultimate Isometric Toolkit plugin, meaning that I don't use transform.position to get the object's position, but I use

GetComponent<IsoTransform>().Position

instead. That worked just fine earlier. I added the plugin's classes to the Type Options and it worked just fine. (Had the connections working, too; I didn't remove them myself).

(I don't think it has something to do with the Ultimate Isometric Toolkit plugin, but thought I'd mention it anyway).

However, it seems that after updating Bolt, these Types are no longer in the Type Options list. So I figured I would just need to use either Build Unit Options or Update Unit Options to fix this.

That's when I found out I can't use either of these features anymore since updating to version 1.2.2. When I try to do this, the following message is displayed in my console:

IOException: Sharing violation on path D:/Projects/Games/Parallel Dreams RPG/Unity Project/Assets\Generated/Bolt.Flow\UnitOptions.db

I noticed this issue a few days ago, but haven't had much time to play around with the new Bolt version so I kind of forgot about it until just now, when I got that MissingValuePortInputException error message.

I'd also like to note that since updating to Bolt 1.2.2 I haven't changed any settings, nor have I changed my project files.

Thanks for your help!

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

Uhh i had yesterday the same problem.

Original Project was Bolt 1.2.1 the i installed the Update to 1.2.2. No Problems till now.

Then i created a new Project and installed Bolt directly with 1.2.2.
When importing now my Macros every connection and some units are lost. And yes i added all the types i need for my macro, before importing that macro.

At the End it took me a goog houre to rebuild my macro in the new project.

Pending Review

Wow, that's really worrisome! Why didn't you submit a bug report Elin?

Did either of you have warnings or errors when updating? About the loss of connections?

About the Sharing Violation error: does restarting Unity help? This error means that something else is already using the unit options file (usually another process, not the same, but just in case).

Hello!

I just opened Unity and the first error in my console I get is:

Failed to update unit options. SQLite.cs

When I select it, at the bottom part of the console it says:

Failed to update unit options. Retry with 'Tools > Bolt > Update Unit Options...'. System.Threading.ThreadAbortException at (wrapper managed-to-native) Ludiq.Dependencies.Sqlite.SQLite3:Step (intptr) (at ?) at Ludiq.Dependencies.Sqlite.SQLiteCommand+d__12`1[T].MoveNext () [0x0016f] in C:\Users\Lazlo\Projects\Ludiq\Ludiq.Core\Editor\Dependencies\SQLite\SQLite.cs:2137 at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x00077] in <9c9f068c46c64ffd91fda7af157b4d15>:0 at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00018] in <11c1c8f1ba1046b191f565f88728429e>:0 at Ludiq.Dependencies.Sqlite.SQLiteCommand.ExecuteQuery[T] () [0x00000] in C:\Users\Lazlo\Projects\Ludiq\Ludiq.Core\Editor\Dependencies\SQLite\SQLite.cs:2096 at Ludiq.Dependencies.Sqlite.SQLiteConnection.Query[T] (System.String query, System.Object[] args) [0x00009] in C:\Users\Lazlo\Projects\Ludiq\Ludiq.Core\Editor\Dependencies\SQLite\SQLite.cs:717 at Bolt.UnitBase.GetDeletedScriptGuids () [0x00036] in C:\Users\Lazlo\Projects\Ludiq\Bolt.Flow\Editor\Options\UnitBase.cs:709 at Bolt.UnitBase.Update () [0x000d6] in C:\Users\Lazlo\Projects\Ludiq\Bolt.Flow\Editor\Options\UnitBase.cs:235 at Bolt.UnitBase.Load () [0x00037] in C:\Users\Lazlo\Projects\Ludiq\Bolt.Flow\Editor\Options\UnitBase.cs:55 UnityEngine.Debug:LogError(Object) (at ?) Bolt.UnitBase:Load() (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:60) Bolt.UnitBase:AutoLoad() (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:35) System.Reflection.MethodBase:Invoke(Object, Object[]) (at ?) Ludiq.<>c__DisplayClass0_0:<.cctor>b__4() (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Threading/BackgroundWorker.cs:55) Ludiq.BackgroundWorker:Work() (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Threading/BackgroundWorker.cs:142) System.Threading.ThreadHelper:ThreadStart() (at ?) Object: Filename: SQLite.cs

I updated my unit options, which seemed to work this time, but nothing happened. So I clicked Build Unit Options (which also seemed to work), but that didn't fix this error either. I am not sure if this issue is related, but from the looks of it (and I am just looking at the console, so I could be wrong), I can run Update Unit Options (or Build Unit Options) but it doesn't seem to do anything?

By the way, the Types that were previously missing and couldn't be added appear to be working now (and again, I haven't changed any of the project files or settings, I just tried to add the Types and Update Unit Options and that's about it). It's just this error that won't go away now.

(In case you need this info: I'm on Windows 10 64-bit, I use Unity version 2017.2.0f3 and the script runtime version in Unity's Player settings is set to .NET 4.6).

Thanks again for your help!

Edit:
For some reason I completely forgot to answer your questions. A restart did not fix the problem. I'm not sure what happened that fixed it but when I posted the issue I had already tried to restart Unity a few times (the first time this problem occurred was actually right before the weekend, but I didn't have the chance to look at it properly until yesterday, which is why I haven't posted this earlier.
So although this problem kept occurring even after a few restarts, somehow the Types I tried to re-add were added after a few tries. I don't think I did anything different the last time I tried to add them, but they seem to work fine now.

Also, when updating to Bolt 1.2.2, I did have an issue at first where I tried to download the latest version, and imported it, but it kept saying I was already using the latest version (1.2.1). After a few tries I did manage to install the update.

Actually, now that I am taking a closer look at the console, a number of errors are popping up. At first I thought they were errors caused by the Odin Inspector plugin, but it could have something to do with Bolt as well. I am not sure if this is related, but it seems to have something to do with the UnitBase.cs file:

The type 'Sirenix.Utilities.ProjectPathFinder' is defined in multiple scripts. UnitBase.cs

I think UnitBase.cs is a Bolt file? This is not the only error that shows up. There's more, but it's all 'The type [something] is defined in multiple scripts'. Here's the full error that shows up when selecting it in the console:

The type 'Sirenix.Utilities.ProjectPathFinder' is defined in multiple scripts. This may cause issues with incremental unit database regeneration. Redefine: Assets/Plugins/Sirenix/Assemblies/NoEditor/Sirenix.Utilities.dll Previous: Assets/Plugins/Sirenix/Assemblies/Sirenix.Utilities.dll UnityEngine.Debug:LogWarning(Object) (at ?) Bolt.<>c:b__18_0() (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:604) Ludiq.UnityAPI:Await(Action, Nullable`1) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Utilities/UnityAPI.cs:69) Ludiq.UnityAPI:AwaitForever(Action) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Editor/Utilities/UnityAPI.cs:62) Bolt.UnitBase:UpdateTypeMappings() (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:576) Bolt.UnitBase:Build() (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Options/UnitBase.cs:152) Bolt.UnitOptionsWizard:BuildUnitOptions() (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/Windows/UnitOptionsWizard.cs:45) Object: Filename: UnitBase.cs

Perhaps the Build/Update Unit Options not working has something to do with this?

Sorry Lazlo, i was too busy fixing other problems so i just reworked my lost macros.

Okay
Maybe its a different bug but here is how i can reproduce it.

Create embed SuperFlow in a embed flow maschine. Then i want do save my superflow as a macro. Create a new macro and paste alle my nodes. every connection is gone and i got this error:

KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,Bolt.ControlInput].get_Item (System.String key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
System.Collections.ObjectModel.KeyedCollection`2[System.String,Bolt.ControlInput].get_Item (System.String key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.ObjectModel/KeyedCollection.cs:119)
Bolt.UnitPortCollection`1[Bolt.ControlInput].Ludiq.IKeyedCollection<system.string,tport>.get_Item (System.String key)
Bolt.ControlConnection.get_destination ()
Ludiq.ConnectionCollectionBase`4[Bolt.ControlConnection,Bolt.ControlOutput,Bolt.ControlInput,Ludiq.GraphElementCollection`1[Bolt.ControlConnection]].Add (Bolt.ControlConnection item)
Ludiq.VariantCollection`2[Ludiq.IGraphElement,Bolt.ControlConnection].Add (IGraphElement item) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Collections/VariantCollection.cs:45)
Ludiq.MergedKeyedCollection`2[System.Guid,Ludiq.IGraphElement].Add (IGraphElement item) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Core/Runtime/Collections/MergedKeyedCollection.cs:141)
Ludiq.GraphClipboard.PasteOutside (Boolean reposition, Nullable`1 position) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Context/GraphClipboard.cs:177)
Ludiq.GraphClipboard.Paste (Nullable`1 position) (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Context/GraphClipboard.cs:110)
Ludiq.Canvas`1[TGraph].HandleClipboard () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Canvases/Canvas.cs:955)
Ludiq.Canvas`1[TGraph].HandleLowPriorityInput () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Canvases/Canvas.cs:170)
Bolt.FlowCanvas.HandleLowPriorityInput () (at C:/Users/Lazlo/Projects/Ludiq/Bolt.Flow/Editor/FlowCanvas.cs:154)
Ludiq.Canvas`1[TGraph].OnGraphGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Canvases/Canvas.cs:108)
Ludiq.GraphWindow.OnGUI () (at C:/Users/Lazlo/Projects/Ludiq/Ludiq.Graphs/Editor/Windows/GraphWindow.cs:312)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:245)</system.string,tport>
+2
Working on Fix

Lots of different issues going on here, so I'll separate them then close this thread.

  1. IOException: Sharing violation on path [...] UnitOptions.db:
    This would happen if the unit options database is already being updated. Wait for the previous update process to finish before starting a new one.
  2. ThreadAbortException on opening the Unity editor:
    This is related to the experimental "background update" feature. Disable Bolt > Editor Preferences > Flow Graphs > Update Units Automatically to get rid of it.
  3. Redefined ProjectPathFinder error:
    This is just a warning, but it indicates exactly what it implies. Odin seems to define some classes twice in different DLL's, and Bolt has trouble keeping track of the provided unit options when that happens. I actually think I can fix this warning, I'll try to include a fix for the next version.
  4. KeyNotFoundException
    That happens when trying to copy-paste input and output nodes, because the new graph doesn't have the same inputs/outputs configured. You can start a separate bug or idea thread if this is something you need to do often. For now, if you avoid copying the IO units, the connections should be preserved.
Fixed in Alpha

#3 is fixed in alpha.