GNOME Bugzilla – Bug 356983
When starting, get a Fatal Error: database is locked
Last modified: 2008-05-28 23:31:03 UTC
I start with an kubuntu dapper (6.06) linux distro. I did a apt-get build-dep banshee to get all the dependencies built. I then followed the instructions on the banshee-project site for getting the 0.11 cvs build and built it. Upon first start, I get the start image and then the error dialog. The following is the trace I get: An unhandled exception was thrown: database is locked in <0x00106> Mono.Data.SqliteClient.SqliteCommand:GetNextStatement (IntPtr pzStart, System.IntPtr pzTail, System.IntPtr pStmt) in <0x000d0> Mono.Data.SqliteClient.SqliteCommand:ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32 rows_affected) in <0x0001c> Mono.Data.SqliteClient.SqliteCommand:ExecuteNonQuery () in <0x00072> Banshee.Database.QueuedSqliteCommand:Execute () .NET Version: 2.0.50727.42 Assembly Version Information: System.Data (2.0.0.0) Mono.Data.SqliteClient (2.0.0.0) pango-sharp (2.8.0.0) dbus-sharp (0.60.0.0) Mono.Posix (2.0.0.0) Banshee.Widgets (0.11.0.36546) glade-sharp (2.8.0.0) gnome-sharp (2.8.0.0) gconf-sharp (2.8.0.0) gdk-sharp (2.8.0.0) System (2.0.0.0) atk-sharp (2.8.0.0) glib-sharp (2.8.0.0) gtk-sharp (2.8.0.0) Banshee.Base (0.11.0.36548) banshee (0.11.0.36556) mscorlib (2.0.0.0) Platform Information: Linux 2.6.15-23-386 i686 unknown GNU/Linux Disribution Information: [/etc/debian_version] testing/unstable [/etc/lsb-release] DISTRIB_ID=Ubuntu DISTRIB_RELEASE=6.06 DISTRIB_CODENAME=dapper DISTRIB_DESCRIPTION="Ubuntu 6.06 LTS"
What version of sqlite?
# pkg-config --modversion sqlite3 3.2
Are you still experiencing this with the latest banshee?
Actually, I am. I just pulled the latest code down about 2 nights ago and am getting exactly the same problem.
Does this happen every time? Also, can you open the database with the command line utility sqlite3. Try the following: $ sqlite3 ~/.gnome2/banshee/banshee.db SQLite version 3.3.10 Enter ".help" for instructions sqlite> select * from tracks limit 1; This should work, if it doesn't, then we have a good clue where to look.
This did not work. I recieved the same "SQL error: database is locked"
I even attempted to remove the banshee.db file and let it be recreated. It was recreated, but I got the same error starting banshee.
I've seen this error a few times now (about 4-5 times in the last 1-2 weeks). But *never* at the startup. I thought it had something to do with fetching podcasts but it just now happened while banshee was playing in the background (and btw it still is playing!): An unhandled exception was thrown: The database is locked. at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt, System.Int32& cols, System.IntPtr& pazValue, System.IntPtr& pazColName) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteNonQuery () [0x00000] at Banshee.Database.QueuedSqliteCommand.Execute () [0x00000] .NET Version: 2.0.50727.42 This error is presented in a nice "fatal error" box, if I click on close banshee exits.
I get this exception every hour or two with Banshee SVN on Ubuntu Feisty when it's trying to increment the play count in the db. It carries on playing, and I can chnage tracks via the notification tray icon, so presumably this isn't as fatal as it makes out.
Created attachment 101465 [details] Strace of banshee startup under a normal user.
I get this exception as well when starting as a normal user. If there is no banshee.db file in place one gets created but it is of size zero (0kb). When started under an X session for root, the program works normally. I've included a strace of both starting banshee as well as attempting to access a database created by root and copied(and chown'd, etc) into a user account. The database is not accessible even under root when copied into a user directory. Here for example is the root banshee.db midgard:/# cd .config/banshee midgard:~/.config/banshee# sqlite3 banshee.db SQLite version 3.5.4 Enter ".help" for instructions sqlite> .databases seq name file --- --------------- ---------------------------------------------------------- 0 main /root/.config/banshee/banshee.db sqlite> And this is using root to access the user DB. (which is the root DB copied to the user directory with changed file permissions) Root should still be able to access this should I not? midgard:~/.config/banshee# cd /home/dan/.config/banshee midgard:/home/dan/.config/banshee# sqlite3 banshee.db SQLite version 3.5.4 Enter ".help" for instructions sqlite> .databases Error: database is locked sqlite> This looks like an sqlite problem to me but I don't know how to fix it. Also see my sqlite strace and banshee strace to see if they are of any use.
Created attachment 101466 [details] strace of sqlite3 cli attempt to access banshee.db
(In reply to comment #11) > I get this exception as well when starting as a normal user. If there is no > banshee.db file in place one gets created but it is of size zero (0kb). Is your disk full?
No. The home directory is network shared, but no other programs are having problems writing to my home directory. My distro is also Debian btw. lenny/sid (which I guess is rougly equivalent to testing/unstable on Ubuntu).
Is this still a problem in current trunk? What are the ownership and permissions of banshee.db?
I have personally never seen it happen in Trunk, but perhaps I'm just still not using it long enough...
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!
*** Bug 525729 has been marked as a duplicate of this bug. ***
reproductible with today's trunk (Apr 7, 2008). An unhandled exception was thrown: The database is locked. at Mono.Data.SqliteClient.SqliteCommand.ExecuteStatement (IntPtr pStmt, System.Int32& cols, System.IntPtr& pazValue, System.IntPtr& pazColName) [0x00000] at (wrapper remoting-invoke-with-check) Mono.Data.SqliteClient.SqliteCommand:ExecuteStatement (intptr,int&,intptr&,intptr&) at Mono.Data.SqliteClient.SqliteDataReader.ReadpVm (IntPtr pVm, Int32 version, Mono.Data.SqliteClient.SqliteCommand cmd) [0x00000] at Mono.Data.SqliteClient.SqliteDataReader..ctor (Mono.Data.SqliteClient.SqliteCommand cmd, IntPtr pVm, Int32 version) [0x00000] at (wrapper remoting-invoke-with-check) Mono.Data.SqliteClient.SqliteDataReader:.ctor (Mono.Data.SqliteClient.SqliteCommand,intptr,int) at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior, Boolean want_results, System.Int32& rows_affected) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader (CommandBehavior behavior) [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteReader () [0x00000] at Mono.Data.SqliteClient.SqliteCommand.ExecuteScalar () [0x00000] at Hyena.Data.Sqlite.HyenaSqliteCommand.Execute (Hyena.Data.Sqlite.HyenaSqliteConnection hconnection, Mono.Data.SqliteClient.SqliteConnection connection) [0x0006d] in /home/sde/src/banshee/banshee/src/Libraries/Hyena/Hyena.Data.Sqlite/HyenaSqliteCommand.cs:101 Exception has been thrown by the target of an invocation. at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] at System.Activator.CreateInstance (System.Type type) [0x00000] at Mono.Addins.TypeExtensionNode.CreateInstance () [0x00000] at Mono.Addins.InstanceExtensionNode.CreateInstance (System.Type expectedType) [0x00000] at Banshee.Sources.SourceManager.LoadExtensionSources () [0x00021] in /home/sde/src/banshee/banshee/src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs:68 at Banshee.ServiceStack.Application.Run () [0x0004e] in /home/sde/src/banshee/banshee/src/Core/Banshee.Services/Banshee.ServiceStack/Application.cs:69 at Banshee.Gui.GtkBaseClient.Initialize (Boolean registerCommonServices) [0x000b7] in /home/sde/src/banshee/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:106 at Banshee.Gui.GtkBaseClient..ctor (Boolean initializeDefault, System.String defaultIconName) [0x00013] in /home/sde/src/banshee/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:68 at Banshee.Gui.GtkBaseClient..ctor () [0x00000] in /home/sde/src/banshee/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:60 at Nereid.Client..ctor () [0x00000] at <0x00000> <unknown method> at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] Exception has been thrown by the target of an invocation. at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] at System.Activator.CreateInstance (System.Type type) [0x00000] at Banshee.Gui.GtkBaseClient.Startup () [0x00000] in /home/sde/src/banshee/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/GtkBaseClient.cs:55 at Hyena.Gui.CleanRoomStartup.Startup (Hyena.Gui.StartupInvocationHandler startup) [0x00048] in /home/sde/src/banshee/banshee/src/Libraries/Hyena.Gui/Hyena.Gui/CleanRoomStartup.cs:54 .NET Version: 2.0.50727.42 OS Version: Unix 2.6.22.17 Assembly Version Information:
When you get that, could you run an lsof to find out if other applications are using the database?
hey ruben, as I said in bug #525729, bug #520714 allow multiple banshee-1 instances. so the other application is banshee-1 itself. solving 520714 will hide this bug, but I still think the exception had to be caught to avoid subtle bugs in the future...
If there are lock issues between banshee instances, that's desirable and the crash is warranted. The point of single instance is to avoid this, though if you know what you are doing you can run multiple instances safely by passing --disable-dbus and --db=something to a second instance. I'm closing this since the single instance code is now committed.