Manager won't start with SQLite.SQLiteConnection exception

I upgraded to v16.12.16 on my Fedora 24 machine, and now the application is unable to start.

Running the Server from the command line throws the same error:

$ mono ./ManagerServer.exe
Manager Server [Version 16.12.16]
Copyright (c) 2016 NGSoftware.  All rights reserved.

Syntax:

    mono ManagerServer.exe [options]

Options:

    -port [number]     Set port on which HTTP server should listen on.
    -path [directory]  Set directory where Manager should look for data.

Examples:

    mono ManagerServer.exe 
    mono ManagerServer.exe -port 80
    mono ManagerServer.exe -port 80 -path "/home/samon/.local/share/Manager"

[11:59:25 AM] The type initializer for 'SQLite.SQLiteConnection' threw an exception. (TypeInitializationException)

I have tried emptying the ~/.local/share/Manager/ directory, but the issue continues. I have also tried installing this on another machine (Fedora 25) but the same issue occurs there too.

Is it possible to download and install a previous release instead? The last RPM that I have locally is quite old, and has the NameResolution issue sending emailsā€¦

Are you running 32-bit or 64-bit OS?

Here are the last versions of desktop edition for Linux without SQLite which should work until the problem is fixed in the latest version.

Manager.deb (7.1 MB)

Manager.rpm (7.5 MB)

1 Like

Do you remember what your last version of manager was? I.e. how long ago did you last update?
Can you report back your mono version: mono --version

if it is 3.x you need to update mono to the latest versionā€¦

I have Ubuntu 16.04 32bit with Manager which I have upgraded to v17 - it threw the same exception. I have rolled back to 16.12.1 without sqlite as above which works fine - except I cannot load my backups due to ā€˜invalid file formatā€™!! Please help :wink:

You cannot go backwards and import a backup created by a later version.

Thanks for the reply - tbh I cannot remember the exact version of Manager I had prior when all was OK. I upgraded to v17 today but it did not work at all. So I saw this thread relating to the same sqlite issue and I used the uploaded .deb to roll back. I therefore donā€™t know if 16.12 was before or after my original version. I installed that version from what was the most current version about two months ago.

Resolved - kind of. I have found my original .deb - i was on v16.12.56. Still, unresolved issue that I cannot then upgrade to v17 without this sqlite issue. Bummer.

Hi @lubos, thanks for getting us a workaround until this issue is fixed.

Unfortunately I bought a used, old 32-bit laptop that I threw Linux onto before I found out about this 32-bit issue with sqlite. Is there any chance of getting the same version of Manager for Windows to match your 32-bit Linux ā€œfixā€ (16.12.1)?

In case you are wondering why; Iā€™m keeping my Windows machine (what I used before the laptop) around as a backup & would like to keep their versions in sync.

@CyberScooby, the issue has been already addressed in library Manager is using 3 weeks ago. Unfortunately, new version of that library hasnā€™t been released yet. As soon as new version is released, I will include it in Manager which will make it run on 32-bit Linux again.

If you want to make the latest version of Manager to run on 32-bit Linux, you can, but you will need to delete file libe_sqlite3.so which is compiled for 64-bit Linux and replace it with 32-bit file which you can download from https://github.com/ericsink/SQLitePCL.raw/raw/master/linux/x86/libe_sqlite3.so

Sorry I forgot to reply here! I am running a 64-bit OS. Downgrading to the pre-SQLite version did work.

I have since moved to a new machine, and thought Iā€™d try the latest version, seeing as itā€™s 6 months laterā€¦ same problem!

$ cat /etc/redhat-release 
Fedora release 25 (Twenty Five)

$ uname -srv
Linux 4.11.3-202.fc25.x86_64 #1 SMP Mon Jun 5 16:38:21 UTC 2017

$ mono --version
Mono JIT compiler version 4.4.2 (Stable 4.4.2.11/f72fe45 Tue Aug  2 08:14:37 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:           __thread
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none
Misc:          softdebug 
LLVM:          supported, not enabled.
GC:            sgen

$ manager-accounting 

Is there a consensus on what actually causes this issue? Is it a particular version of SQLite?

It has been over six months since I initially raised this issue, and the answer at the time was simply ā€œuse this older versionā€ā€¦ which as a stop-gap was okay, but now that weā€™re on a whole new ā€˜majorā€™ version (confirmed still not working on v17.6.39) and the issue is still present, is it possible to get some investigation into what is causing this and therefore how to resolve it?

This issue is confirmed to be on 32-bit Linux.

Unfortunately it seems like 32-bit Linux will remain being unsupported since the library Manager is using wonā€™t be adding 32-bit Linux support. The developer of the library has tried to make this happen but it ended up being too hard after he dug into it deeper.

There is a workaround to make Manager work on 32-bit Linux but I guess thatā€™s for another topic.

As for why Manager cannot start on 64-bit Linux, I have no idea because I canā€™t reproduce the issue. What I would try is to install server edition since that could give more detailed error. Actually I believe the latest version of Manager should give more detailed error on desktop edition too. Not just one liner as previously posted.

Thanks for the reply, @lubos!

As you noted, Iā€™m running this on a 64 bit system, in this case, a fresh Fedora 25 installation.

Running the server edition returns the same error:

$ mono /opt/manager-accounting/ManagerServer.exe
Manager Server [Version 17.6.39]
Copyright (c) 2017 NGSoftware. All rights reserved.

[4:52:11 PM] TypeInitializationException: The type initializer for ā€˜SQLite.SQLiteConnectionā€™ threw an exception.

Press any key to exit ā€¦

Enabling mono tracing for the ā€˜SQLiteā€™ expression shows the following:

$ mono --trace=SQLite mono --trace=SQLite /opt/manager-accounting/ManagerDesktop.exe
[0x7f04cc46a780:] EXCEPTION handling: System.DllNotFoundException: e_sqlite3
[0x7f04cc46a780:] EXCEPTION handling: System.TypeInitializationException: The type initializer for ā€˜SQLite.SQLiteConnectionā€™ threw an exception.

Can you check and make sure your binary folder contains the following files?

  • libe_sqlite3.so
  • SQLite-net.dll
  • SQLitePCLRaw.batteries_green.dll
  • SQLitePCLRaw.core.dll
  • SQLitePCLRaw.provider.e_sqlite3.dll

Okay - so libe_sqlite3.so is missing! Iā€™ve compiled that from sqlite3.c and dropped it into the binary folder, and now it works as desired :slight_smile: I assume this just means that the Fedora package is missing that one file?

libe_sqlite3.so is actually included in Manager. Not sure why it didnā€™t extract into your install folder.

Are you sure? I suspect the Fedora RPM is missing this. Here is a list of all files within the freshly downloaded Manager.rpm package:

$ rpm -qlp ./Manager.rpm
/opt/manager-accounting
/opt/manager-accounting/AngleSharp.dll
/opt/manager-accounting/Apitron.PDF.Kit.dll
/opt/manager-accounting/DotLiquid.dll
/opt/manager-accounting/Eto.Gtk2.dll
/opt/manager-accounting/Eto.dll
/opt/manager-accounting/FluentValidationNA.dll
/opt/manager-accounting/HtmlAgilityPack.dll
/opt/manager-accounting/HttpFramework.dll
/opt/manager-accounting/LumenWorks.Framework.IO.dll
/opt/manager-accounting/Manager.dll
/opt/manager-accounting/ManagerDesktop.exe
/opt/manager-accounting/ManagerServer.exe
/opt/manager-accounting/Newtonsoft.Json.dll
/opt/manager-accounting/SQLite-net.dll
/opt/manager-accounting/SQLitePCLRaw.batteries_green.dll
/opt/manager-accounting/SQLitePCLRaw.core.dll
/opt/manager-accounting/SQLitePCLRaw.provider.e_sqlite3.dll
/opt/manager-accounting/manager-accounting
/opt/manager-accounting/protobuf-net.dll
/usr/bin/manager-accounting
/usr/share/applications
/usr/share/applications/manager-accounting.desktop
/usr/share/icons
/usr/share/icons/hicolor
/usr/share/icons/hicolor/128x128
/usr/share/icons/hicolor/128x128/apps
/usr/share/icons/hicolor/128x128/apps/manager-accounting.png
/usr/share/icons/hicolor/16x16
/usr/share/icons/hicolor/16x16/apps
/usr/share/icons/hicolor/16x16/apps/manager-accounting.png
/usr/share/icons/hicolor/32x32
/usr/share/icons/hicolor/32x32/apps
/usr/share/icons/hicolor/32x32/apps/manager-accounting.png
/usr/share/icons/hicolor/64x64
/usr/share/icons/hicolor/64x64/apps
/usr/share/icons/hicolor/64x64/apps/manager-accounting.png
/usr/share/licenses/manager-accounting
/usr/share/licenses/manager-accounting/LICENSE

Yes, I also see that both source packages (manager-accounting.zip or Manager.src.rpm ) are also missing libe_sqlite3.so. Manager.deb is the only package that contains libe_sqlite3.so. In the meantime, for those who really want/need the latest release, you can grab a working fedora 25 rpm release here: Releases Ā· agrez/manager-accounting Ā· GitHub.

Hi Lubos - I am interested in learning about this workaround as I am working on a 32bit machine and using the newest version that still worked on 32 bit (16.12.1). It would be great to update to a newer version, if that is possible.

Thanks!

Zak

@agrez did good work to fix Fedora package so it will work on machines with x86 or ARM processor. Now, the same will need to be done for Debian package. I hope to dive into this before end of this month.