hydralauncher / hydra

Hydra is a game launcher with its own embedded bittorrent client
MIT License
10.63k stars 2.48k forks source link

[BUG] App Fails to Launch Due to SqliteError: Database Disk Image is Malformed #795

Closed anefzaoui closed 1 week ago

anefzaoui commented 3 months ago

Describe the bug

When attempting to launch the app on a Windows 11 machine, the GUI does not open. Instead, an error is thrown indicating a SqliteError: database disk image is malformed. The error traceback shows that this issue originates from the typeorm module used within the application.

Error Log:

Ahmed@DESKTOP-IJ4CFHS MINGW64 ~/AppData/Local/Programs/Hydra
$ ./Hydra.exe

09:09:26.097        > Unhandled rejection QueryFailedError: SqliteError: database disk image is malformed
    at BetterSqlite3QueryRunner.query (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\driver\better-sqlite3\BetterSqlite3QueryRunner.js:103:19)
    at async BetterSqlite3QueryRunner.executeQueries (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\query-runner\BaseQueryRunner.js:425:13)
    at async BetterSqlite3QueryRunner.recreateTable (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\driver\sqlite-abstract\AbstractSqliteQueryRunner.js:1481:9)
    at async BetterSqlite3QueryRunner.addColumns (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\driver\sqlite-abstract\AbstractSqliteQueryRunner.js:386:9)
    at async RdbmsSchemaBuilder.addNewColumns (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\schema-builder\RdbmsSchemaBuilder.js:570:13)
    at async RdbmsSchemaBuilder.executeSchemaSyncOperationsInProperOrder (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\schema-builder\RdbmsSchemaBuilder.js:169:9)
    at async RdbmsSchemaBuilder.build (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\schema-builder\RdbmsSchemaBuilder.js:66:13)
    at async DataSource.synchronize (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\data-source\DataSource.js:211:9)
    at async DataSource.initialize (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\data-source\DataSource.js:156:17)
    at async file:///C:/Users/Ahmed/AppData/Local/Programs/Hydra/resources/app.asar/out/main/index.js:5455:3
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
QueryFailedError: SqliteError: database disk image is malformed
    at BetterSqlite3QueryRunner.query (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\driver\better-sqlite3\BetterSqlite3QueryRunner.js:103:19)
    at async BetterSqlite3QueryRunner.executeQueries (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\query-runner\BaseQueryRunner.js:425:13)
    at async BetterSqlite3QueryRunner.recreateTable (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\driver\sqlite-abstract\AbstractSqliteQueryRunner.js:1481:9)
    at async BetterSqlite3QueryRunner.addColumns (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\driver\sqlite-abstract\AbstractSqliteQueryRunner.js:386:9)
    at async RdbmsSchemaBuilder.addNewColumns (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\schema-builder\RdbmsSchemaBuilder.js:570:13)
    at async RdbmsSchemaBuilder.executeSchemaSyncOperationsInProperOrder (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\schema-builder\RdbmsSchemaBuilder.js:169:9)
    at async RdbmsSchemaBuilder.build (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\schema-builder\RdbmsSchemaBuilder.js:66:13)
    at async DataSource.synchronize (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\data-source\DataSource.js:211:9)
    at async DataSource.initialize (C:\Users\Ahmed\AppData\Local\Programs\Hydra\resources\app.asar\node_modules\typeorm\data-source\DataSource.js:156:17)
    at async file:///C:/Users/Ahmed/AppData/Local/Programs/Hydra/resources/app.asar/out/main/index.js:5455:3

Steps to Reproduce

  1. Open a terminal (e.g., Git Bash or Command Prompt) on a Windows 11 system.
  2. Navigate to the Hydra application directory using the command:
    cd ~ Hydra Location on System
  3. Launch the Hydra application by running:
    ./Hydra.exe
  4. Observe that the GUI does not open and an error message is displayed in the terminal.

Expected behavior

The app should launch and display the graphical user interface (GUI) without any errors, allowing the user to interact with the application as intended.

Screenshots

image

Operating System

Windows 11

Hydra Version

v2.0.3 and all previous versions.

Additional Information

Both options of installing for All Users & This User Only + Installing on a different partition + SSD & HDD result in the same output.

JackEnx commented 2 months ago

we are investigating the cause of this.

anefzaoui commented 2 months ago

Hi @JackEnx any update on this?

JackEnx commented 2 months ago

Sorry for the delay in responding, if you want to immediately fix the problem, you will have to delete the database in %appdata%/hydra/hydra.db (do a backup before deleting), the problem maybe occur due to automatic update, especially if you try to install a update on an already installed version, unfortunately we do not have a way to recover the corrupted db for now, if you have a account you can recovery the data saved on cloud

zamitto commented 1 week ago

Closing issue as no response in a long time