Wildenhaus / IndexV2

A tool for browsing and extracting assets from Saber Interactive games such as Halo: Combat Evolved Anniversary and Halo 2 Anniversary.
23 stars 2 forks source link

SQLite Error 14: 'unable to open database file'. #10

Closed FurStaku closed 1 month ago

FurStaku commented 1 month ago

Installed .NET Versions: 6.0, 7.0, 8.0, 9.0 Version: v0.4.0.0 Steps to Reproduce:

  1. Downloaded and installed the application.
  2. Started the application for the first time.
  3. Encountered the error (see below).

Error:

Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 14: 'unable to open database file'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteConnectionInternal..ctor(SqliteConnectionStringBuilder connectionOptions, SqliteConnectionPool pool)
   at Microsoft.Data.Sqlite.SqliteConnectionPool.GetConnection()
   at Microsoft.Data.Sqlite.SqliteConnectionFactory.GetConnection(SqliteConnection outerConnection)
   at Microsoft.Data.Sqlite.SqliteConnection.Open()
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Sqlite.Storage.Internal.SqliteDatabaseCreator.Create()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
   at Index.App.Startup.InitializeDatabase()
   at Index.App.Startup.RunStartupFlow()
   at Index.App.Startup.Run()
   at Index.App.App.OnApplicationStartup(Object sender, StartupEventArgs e)
   at System.Windows.Application.<.ctor>b__1_0(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
Wildenhaus commented 1 month ago

Is it creating an index.db file in the same folder as the exe? The program might not have permission to write to whatever directory the app is in. Or the .db file could be corrupt, in which case you can just delete it and it will be re-created.

FurStaku commented 1 month ago

Yeah, it turned out the program didn’t have the necessary permissions. After fixing the permissions, everything works fine now. Thanks!