+11
Fixed in Bolt 2

Setup Errors (sqlite3, UnitOptions.db, DisplayDialog)

Lazlo Bonin (Lead Developer) 8 months ago • updated 2 months ago 59 12 duplicates

Creating a megathread to discuss & address errors during first import and setup. 

Issues include:

  • UnitOptions.db is used by another process
  • SQLite errors during setup
  • Setup wizard restarting by itself
  • Unity hangs during type generation (force-quit required)
  • Cancelling DisplayDialog error

Workarounds that work for most users so far:

  • Restarting Unity
  • Skipping Inspector / Documentation Generation by hitting Next
    (those are not required for Bolt to run properly)

The following issues are not errors:

  • Wizard skips documentation generation on fresh projects
    (there is no documentation to generate on empty projects!)
  • Missing MSBuild / XBuild error when generating documentation
    (follow the link included in the error to download it on your machine)

My plan to fix these errors is to largely rework the unit options system and database, including new features like import-by-namespace and vastly improved performance with multithreading. Currently, this is slated for v.1.6, but considering the setup errors that occur right now, I'm considering moving it up to v.1.4.1 as a more urgent fix.

Bolt Version:
Unity Version:
.NET Version:

Duplicates 12

Under Review

Hi Allabreve,

Sorry you're having this issue. It seems something went wrong with the file lock over the unit options database somehow.

Can you try:

  1. Deleting Ludiq/Bolt.Flow/Generated/UnitOptions.db
  2. Restarting Unity
  3. Running Tools > Bolt > Build Unit Options

Let me know if that works for you!

Deleting, restarting and rebuilding didn't change the behavior.

I should mention that the build process seems to be successful despite the exception.
I still can use my classes and also update the code.

So it's rather an annoying red line in my console than a big issue.

Unity is not unresponsive in Task Manager

now


My execute Build Unit Options Unity stuck


Bolt version:1.3.0

Unity version:2018.1.0b13

forgot to add that the 1.3 wizard "generate types" cause me to freeze at the "converting code base to ....(i dont remember)" step. during the same session I install the package. 

after killing the process and restarting it, it install fine. 

Under Review

Hi Joel-Aimé,

Sorry you're having issues.

Did you read the 1.3 update instructions before updating? 1.3 is a manual update:

https://support.ludiq.io/communities/5/topics/1199-version-13-update-instructions

+1

Relaunching crashed project actually lets you complete the install, BUT, I did not generate documentation nor inspectors this time.

Console shows this on startup:

A default asset was created for 'Assets/Ludiq/Bolt.Flow/Generated/UnitOptions.db' because the asset importer crashed on it last time.
You can select the asset and use the 'Assets -> Reimport' menu command to try importing it again, or you can replace the asset and it will auto import again.

And after install it adds this error:

Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed 'Assets/Ludiq/Bolt.Flow/Generated/UnitOptions.db' Process cannot access file, because it is being used by another process.


+1

I was updating a project from 2017.3.1p4 to 2018.1.0f2 and got the exception too when I clicked build unit options. It was a basically empty project that only had bolt, which I had setup to do some tests.

Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file /Assets/Ludiq/Bolt.Flow/Generated/UnitOptions.db: The process cannot access the file because it is being used by another process.

It seems to happen also every time I try to build unit options.

When I try to generate inspectors within a fresh project with other 3rd party assets in it I get this in console:

EndLayoutGroup: BeginLayoutGroup must be called first.
UnityEngine.GUILayout:EndVertical()
Ludiq.LudiqGUI:EndVertical() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Interface/LudiqGUI.cs:1868)
Ludiq.GeneratePropertyProvidersPage:OnContentGUI() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/GeneratePropertyProvidersWindow/GeneratePropertyProvidersPage.cs:70)
Ludiq.Page:DrawContent() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/Page.cs:71)
Ludiq.SinglePageWindow`1:OnGUI() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/SinglePageWindow.cs:74)
Ludiq.WrappedEditorWindow:OnGUI() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Windows/WrappedEditorWindow.cs:52)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

And I get the same thing Andrew did above trying to manually generate units after project restart:

Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file C:/gamedev/CrowsPlatformer/Assets/Ludiq/Bolt.Flow/Generated/UnitOptions.db: The process cannot access the file because it is being used by another process.



Under Review

Hi annoyed,

Sorry you're having issues. Bolt 1.3 should work on 2018 with some minor GUI quirks, but you shouldn't get errors.

(Full 2018 support will come with Bolt 1.4)

What errors are you getting exactly? Can you paste stack traces or show screenshots?

hi thanks i reinstalled the version of unity you reccomend on the store page but now i'm getting: dllnotfound exception: sqlite3 yet when i check the path it references i can'#t see any problem. This happens everytime i run the wizard it just throws the error and wont complete, any fix for this or know how i can get this to work.?

Ludiq.Dependencies.Sqlite.SQLiteConnection:Dispose(Boolean) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:1540)
Ludiq.Dependencies.Sqlite.SQLiteConnection:Dispose(Boolean) (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:1539)
Ludiq.Dependencies.Sqlite.SQLiteConnection:Finalize() (at C:/Users/lazlo/Projects/Ludiq/Ludiq.Core/Editor/Dependencies/SQLite/SQLite.cs:1528)


seems to be a path or can't find some file, is bolt written using nodejs?

Bolt isn't using NodeJS. Can you paste the entire stack trace for this error? This seems only partial.

Hi Lazio, i installed the latest version of unity on my laptop this time (windows 10)and everything seems fine.. i still wonder about my desktop tho? anyway i had a lot of software installed on that desktop it was probably a conflict of some sort, i'm sure if i did a fresh reinstall of windows 10 on the desktop everything would be fine. You can mark this resolved, so far from playing with bolt i was easily able to transform a cube and so on - it's fast and logical in a graphic way. Thanks for the great software.

If you start a new project it works. I had to run the wizard a couple of times on already made projects while closing/reloading unity

Ouch and double ouch!

Using: Unity 2017.4.3f1 - Bolt 1.4 Alpha. Fresh new Project.

After Importing into Unity 2017.4.3f1 into a brand new project, the Bolt wizard popped up. I clicked Next on Human Naming and it skipped Documentation. I clicked Generate Inspectors and it jumped straight to 
Assemblies without really saying it did anything. Then the Wizard closed and reopened back to Naming.

2nd Time through it did the same.

3rd time through I skipped hitting Generate on Assemblies and moved on to Types. The wizard then finished.

This error popped up during either Assemblies or Types.

InvalidOperationException: Operation is not valid due to the current state of the object
System.Collections.Stack.Pop () (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections/Stack.cs:329)
UnityEngine.GUILayoutUtility.EndLayoutGroup () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:323)
UnityEngine.GUILayout.EndVertical () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:342)
UnityEditor.HostView.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:114)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at C:/buildslave/unity/build/Runtime/UIElements/Managed/IMGUIContainer.cs:182)

Under Review

In a brand new project, there is no documentation from your scripts to generate, hence why it skips. Are you not able to generate types because of that error?

The Types did seem to generate even with the error popping up. I'll play with it more in a bit and see if I can provide more info.

This is happening on 2017.3 and 2018.1 as well. Same exact behavior, warning messages and all. I cannot generate Types. Attempting to do so crashes Unity and I have to force quit to get out.


Mac OS High Sierra 10.13.4

Bolt 1.3.0

Unity 2017.3, 2017.4 and 2018.1

Hi,

I´m on Unity 2017.4.2f2 with OSX 10.9.5 Mavericks and for me it´s fine...

I finally got it to work today. I don't know why it wasn't working, but all I did was import the asset delete the asset folder and import it once more and it all works now.

@TC, me too. UnitOptions.db in use. I will retart Unity after rerunning generator for newly add GOs and js code.

I restarted Unity and problem gone at dev start up. The initial was probably my fault, although Bolt devs should look at this. These are the steps.

I started a new project.

I imported an obj from Wings3d. This works. I do this all the time.

I added some gameobjects to the scene.

I then ran the Bolt generator

This is where the error fell.

I restarted Unity and error relieved.

I need to pull in another js code snip and rerun generator. Could be another set of headaches.


Stopped using Unity Hub - the error gone alongside with errors from other packages. The hub itself is malicious - it looks like it triggers slow memory leak time to time, having it working is dangerous.

I restarted and all is fine. I am now trying to use an existing script connection into Bolt.

Under Review

I'm having a really hard time reproducing these issues (because they only happen on first import/setup usually), but I'm thinking of moving up the 1.5 part of the Roadmap earlier. Basically, I want to rework the entire UnitOptions.db system, and I would take extra care to make sure there is no file lock or thread lock on it. 

I am not labelling this as critical because restarting Unity after first import fixes it, but rest assured it is a high priority for me!

I deleted EVERYTHING related to Unity and then downloaded and installed the latest Unity LTS version 2017.4.4f1 and then downloaded and imported Bolt 1.3. It ran the setup correctly.

Is there a compatibility matrix anyway on this site that shows what Unity versions are stable to use with the current version of Bolt? There REALLY needs to be one to remove any ambiguity about compatibility issues.

Under Review

Hi Greg! The editor hang isn't a Unity version compatibility issue, however I haven't been able to trace its cause. I will rework the entire type generation code to avoid any potential deadlocks or file locks. 

I did not take any macro from the forum, but I got the same error.

It doesn't seem to have anything to do with macros. When I start play mode, Bolt takes a few seconds to load up, and sometimes that process seems to take too long, and that's when I get the error. Also, I had an asset bundle download at start, and it may have possibly caused or worsened the problem. However, it still happens even when I move the download method out of Start and into a button call.

I can imagine that this issue is a real pain as I looked through my log files immediately after the editor hang and nothing jumped out at me as relevant, unfortunately.

So, you're saying that Bolt 1.3.0 SHOULD work fine with Unity 2018.1.2?

If they should work fine together, then I believe the problem may be in either some of Unity's or Bolt's cache or preference files. I did trash all of those files before I reinstalled, if that helps for you to know. Other than that, I don't have anything further.

If it happens again, I'll try trashing the cache & pref files for Bolt and then Unity to see if it fixes the issue and advise you.

Thanks for the reply - I REALLY do LOVE using BOLT!

Yeah, per my reply, it seems to be an issue with startup. If I do anything at startup, before bolt finishes doing whatever it does when I enter play mode, it crashes. I have a Flow State setup on my FPS controller prefab so that I can deal with some of the cursor issues that come with using WebGL, so maybe that's the issue.

Under Review

What do you mean "at startup" / "before Bolt finishes"? What exactly are the reproduction steps to get a crash?

Only unity is using it

Working on Fix

I will be working on a definitive fix for this problem in v.1.4.1.

In the mean time, most users with this issue report that restarting Unity allows them to generate unit options. 

If that doesn't work, try generating unit options from the Unit Options Wizard instead of the Setup Wizard.

Thanks,I roll back to 1.3,and it returned to normal.

I think I might have found why these errors occur, I'm asking if anybody knows more about it here:

https://forum.unity.com/threads/initializeonload-called-during-asset-import-since-2018.540292/

If my theory is right, something changed in Unity 2018 that causes the Bolt plugin to initialize at the wrong time, even during import.

I have the same problem with the restarting setup wizard after trying to generate inspectors. While I was able to generate units over the "Unit Options Wizard", the "Generate Custom Inspectors" always stops abruptly, even if I try to start it over 'Tool->Bolt->Generate Custom inspectors'. Tried a couple of times to reimport Bolt (Version 1.3 and 1.4) and also tried the same procedure in a (couple of) completely new unity projects(Unity 2018.1 and 1018.2), but the result is mostly the same. The error messages on the other hand are not really consistent(sometimes there are none) but more often then not this is what pops up in the console:

I also am getting this error whenever I attempt to build units.
I get it through the "Build Unit Options" command as well as through the "Setup Wizard".

Hi, this happened to me too on v1.4 and I am adding the errors to the thread for reference. After restarting, Bolt appears to be working.

I am using Unity 2018.1.6f1. I added Bolt to a new project (only a few C# scripts existed in the project at the time), and after the set-up wizard tried to build the units, I received the error below. Only Unity was running at the time.

 

I hit the Force Quit and received this:

 

I Quit Unity at this point. When I repopened Unity, there was the following Console message:

"A default asset was created for 'Assets/Ludiq/Bolt.Flow/Generated/UnitOptions.db' because the asset importer crashed on it last time.

You can select the asset and use the 'Assets -> Reimport' menu command to try importing it again, or you can replace the asset and it will auto import again."


I ran through the set-up Wizard again, and this time it completed, but the following Console message appeared:

"Assertion failed: Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file D:/Unity Projects/RayCastPlatformer/HeroSquad/HeroSquad/Assets/Ludiq/Bolt.Flow/Generated/UnitOptions.db: The process cannot access the file because it is being used by another process"


Take care.

Working on Fix

This is seemingly harmless, but I'll try to get rid of it once and for all.

I'm having the same issue on the latest 2018 build. Startup wizard for Bolt restarts every time it gets to the "Assemblies" stage.

EDIT: I managed to workaround this by just generating Inspectors during the build wizard, then closing the wizard and using "Unit Options Wizard" in the Bolt menu to generate the units (this, for some reason, doesn't have the same layout issue even though it's basically the same dialogue).

Working on Fix

Will investigate on a fresh build in the latest Unity tomorrow.

Here's what I gather from what's happening:

  1. Bolt tries to load or update the unit options database in a background thread
  2. There is another process already locking the database file, which causes the error "The process cannot access the file because it is being used by another process"
  3. Unity intercepts this error and tries to show it in a dialog with its own DisplayDialog
  4. DisplayDialog fails on secondary threads like many Unity methods
  5. Unity logs this error as "cancelling" its display

The fix here has to be applied at the root of the problem, that is, step 1 or 2. I'm refactoring the unit database generation in v.1.4.1 to avoid file locks and thread locks, but it's a big endeavor, so it won't make it in a hotfix for v.1.4.0.

Harmless

Hi Jenni,

I wasn't able to reproduce the issue on Unity 2018.2.3f1 and Bolt v.1.4.0f4.

However, the error log does seem like a harmless layout error that occurs after AOT Pre-Build.

If the AOT stubs and linker file are generated in Ludiq/Ludiq.Core/Generated, you can safely ignore the error.

I will try to entirely eliminate these errors in v.1.4.1 when I refactor Bolt's window management.

Thanks for looking in to this. I thought the problem was that a reference to an item wasn't set, as the issue disappeared. When I opened the project later I had about 10 of these show as errors, and couldn't figure out how to get past it. I didn't try AOT Pre-Build. For now I took out Bolt in this project and will figure it out in another project when I have more time.

Still having problems with this even with Bolt 1.4. Specifically "UnitOptions.db is used by another process". I've tried both .NET versions as well as different Unity version - latest 2018.2 and also 2018.1.9. 

That said the setup still completes successfully after pressing cancel button.

Hi Xav!

Usually these are harmless, but we're working on getting them fixed in v.1.4.1. You can restart the setup wizard at any time through Tools > Bolt > Setup Wizard. If you're having errors with the wizard being unable to complete, try skipping Inspector and Documentation generation.

Hi, this is my first attempt with Bolt. I´m using Unity 2018.2.11.f1 and Bolt_1_4_0f8_NET3

I just opened a new project and imported the Bolt package.

Error Message

Hi, again.

I solved the problem, just replacing the original sqlite3.dll with another downloaded directly from the site https://www.sqlite.org/download.htm



+1

Hi Odair! Glad you got it fixed. It is a known issue and we will be fixing it in a future version. 

Version 1.4.0f10 will include the new 2018 64-bit DLL of sqlite3 in hopes to fix the known issue. Hopefully that won't cause issues for anybody! (In theory it shouldn't, since the Unity editor is 64-bit only anyway).

Fixed in Bolt 2

Bolt 2 now uses purely managed code to handle setup, extraction and loading, so there shouldn't be any file lock or threading errors with SQLite3.

Is there a reason I would continually get the Bolt setup dialog box repeatedly popping up?  Everytime I open Unity, I use the Asset Tab or my scene rebuilds something, I get the Setup Dialog box as if I just installed Bolt.  It doesn't seem to matter how many times I go through the Dialog box, it pops up again in minutes sometimes if I go into play mode and then stop.

Do you get these warnings? If so, it might be that the preferences get reset because Unity fails to load them, causing Bolt to reopen the setup wizard. According to Unity QA, this issue is on their end and is fixed in 2018.3.

Yeah, that sounds a lot like what is going on. I'll just keep skipping for now until I upgrade to 2018.3.  Everything seems to be working aside from that odd behavior. Thank you!
Good news Zyrathius, I just got an email from Unity QA and the fix has been backported to 2018.2.18f1, if you want to stick to a more stable version. :)