milan-fabian / slideshow-support

Support and issue tracking for Slideshow software
https://slideshow.digital/
14 stars 1 forks source link

"Can't load database" error #29

Closed xilker206 closed 1 year ago

xilker206 commented 1 year ago

I installed the app for the first time. The app stays on the loading screen. I am getting the error "can't load database" java runtime exception.

I tried it on 3 devices. Android 9 and 10.

What is the cause of the error?

milan-fabian commented 1 year ago

@xilker206 Hi, could you please open the Android's device internal memory, folder Slideshow, grab file log.txt and post it here or via email on slideshow@milanfabian.com? I will check the logs and let you know the cause. Also, which version of the app are you installing?

xilker206 commented 1 year ago

I tried 3 versions. 3.23 (Play Store and https://slideshow.digital), old versiyons 3.22.1 and 3.19.0

Log text

2022-08-18 18:54:15 INFO sk.mimac.slideshow.StartupActivity - Starting Slideshow (version 3.19.0) 2022-08-18 18:54:15 ERROR sk.mimac.slideshow.settings.SettingsHelper - Can't load settings: file '/storage/emulated/0/slideshow/settings.xml' doesn't exist 2022-08-18 18:54:15 DEBUG sk.mimac.slideshow.database.DatabaseManager - Loading database: /storage/emulated/0/slideshow/database.mv.db 2022-08-18 18:54:15 INFO sk.mimac.slideshow.database.DatabaseChanger - Missing tables in database, creating 2022-08-18 18:54:15 ERROR sk.mimac.slideshow.StartupActivity - Can't initialize Slideshow java.lang.RuntimeException: Can't load database at sk.mimac.slideshow.database.DatabaseManager.loadDatabase(Unknown Source:18) at sk.mimac.slideshow.Initializer.initCommons(:2) at sk.mimac.slideshow.StartupActivity.run(:9) at java.lang.Thread.run(Thread.java:919) Caused by: org.h2.jdbc.JdbcSQLException: Table "ITEM" already exists; SQL statement: CREATE TABLE item (id integer PRIMARY KEY AUTO_INCREMENT, file_name varchar(255) NOT NULL, type integer NOT NULL, description varchar(255) NOT NULL, properties varchar(1023)); CREATE TABLE playlist (id integer PRIMARY KEY AUTO_INCREMENT, name varchar(255) NOT NULL, music INT default 0 not null, number integer); CREATE TABLE content (playlist integer NOT NULL, item integer NOT NULL, position integer NOT NULL, length integer NOT NULL,FOREIGN KEY (playlist) REFERENCES playlist(id), FOREIGN KEY (item) REFERENCES item(id)); CREATE TABLE grabber_data (id integer PRIMARY KEY AUTO_INCREMENT, file_name varchar(255), url varchar(255), clear_folder boolean NOT NULL); CREATE TABLE user (id integer PRIMARY KEY AUTO_INCREMENT, name varchar(50) NOT NULL, username varchar(50) NOT NULL, password varchar(128) NOT NULL, homeDir varchar(50) NOT NULL, role varchar(15) NOT NULL); CREATE TABLE file_data (id integer PRIMARY KEY AUTO_INCREMENT, file_name varchar(255) NOT NULL, start_when bigint, delete_when bigint, action varchar(150)); CREATE TABLE rss_server_message (id integer PRIMARY KEY AUTO_INCREMENT, title varchar(255) NOT NULL, description varchar(255) NOT NULL, start_when bigint, end_when bigint);CREATE TABLE screen_layout (id integer PRIMARY KEY AUTO_INCREMENT, name varchar(50) NOT NULL, rotation smallint NOT NULL, interval int NOT NULL); CREATE TABLE panel_item (id integer PRIMARY KEY AUTO_INCREMENT, screen_layout_id integer NOT NULL, name varchar(150) NOT NULL, background_color varchar(20) NOT NULL, x integer NOT NULL, y integer NOT NULL, height integer NOT NULL, width integer NOT NULL, main_panel boolean NOT NULL, animation_type varchar(30) NOT NULL, animation_length integer NOT NULL, properties varchar(1023), FOREIGN KEY (screen_layout_id) REFERENCES screen_layout(id));CREATE TABLE screen_layout_timing (day integer DEFAULT NULL, hour int NOT NULL, screen_layout integer NOT NULL);CREATE TABLE playing (day int DEFAULT NULL, hour int NOT NULL, playlist bigint NULL, panel_item_id integer NULL,FOREIGN KEY (playlist) REFERENCES playlist(id), FOREIGN KEY (panel_item_id) REFERENCES panel_item(id)); [42101-196] at org.h2.command.ddl.CreateTable.update(Unknown Source:75) at org.h2.command.CommandContainer.update(Unknown Source:24) at org.h2.command.Command.executeUpdate(Unknown Source:54) at org.h2.command.CommandList.update(Unknown Source:2) at org.h2.command.Command.executeUpdate(Unknown Source:54) at org.h2.jdbc.JdbcStatement.executeInternal(Unknown Source:87) at org.h2.jdbc.JdbcStatement.execute(Unknown Source:5) at com.zaxxer.hikari.proxy.HikariStatementProxy.execute(:1) at io.milton.common.FileUtils.process(Unknown Source:4) at sk.mimac.slideshow.database.DatabaseChanger.checkCreateDatabase(:1) at sk.mimac.slideshow.database.DatabaseManager.loadDatabaseInternal(:3) at sk.mimac.slideshow.database.DatabaseManager.loadDatabase(Unknown Source:9) at sk.mimac.slideshow.Initializer.initCommons(:2) at sk.mimac.slideshow.StartupActivity.run(:9) at java.lang.Thread.run(Thread.java:919)

milan-fabian commented 1 year ago

@xilker206 thank you for the data, I can see that the database is corrupted. Could you please uninstall the app, delete entire folder "slideshow" in the device's internal memory and try installing the app again?

xilker206 commented 1 year ago

I had previously tried deleting the slideshow folder and reinstalling it.

I found the because of the problem now! :)

The problem is with the system language. My device language is Turkish. I have set the language settings to English. problem is solved.

It would be great if the application works on Turkish systems. Would you consider adding Turkish language support? I would be happy to help with Turkish translation.

Thank you so much.

Milan Fabian @.***>, 18 Ağu 2022 Per, 21:41 tarihinde şunu yazdı:

@xilker206 https://github.com/xilker206 thank you for the data, I can see that the database is corrupted. Could you please uninstall the app, delete entire folder "slideshow" in the device's internal memory and try installing the app again?

— Reply to this email directly, view it on GitHub https://github.com/milan-fabian/slideshow-support/issues/29#issuecomment-1219815062, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3GSEVFRKN2G4HBETYOSGDVZZ7VZANCNFSM565UJRRQ . You are receiving this because you were mentioned.Message ID: @.***>

--

İlker Berberler

Tel : (212) 416 58 10 Pbx

Fax: (212) 679 19 51

milan-fabian commented 1 year ago

@xilker206 Thank you for the hint with the system language, I will try to replicate it on my test device and fix it.

If you would like to help adding Turkish localization to Slideshow app, please check https://github.com/milan-fabian/slideshow-localization for more details.

milan-fabian commented 1 year ago

The problem was caused by the fact that upper/lower case I/i is not same in Turkish as is in English. The bug has been fixed in Slideshow 3.24.2.

xilker206 commented 1 year ago

3.23 log file. Thankyou

18 Ağu 2022 Per 20:36 tarihinde Milan Fabian @.***> şunu yazdı:

@xilker206 https://github.com/xilker206 Hi, could you please open the Android's device internal memory, folder Slideshow, grab file log.txt and post it here or via email on @.***? I will check the logs and let you know the cause. Also, which version of the app are you installing?

— Reply to this email directly, view it on GitHub https://github.com/milan-fabian/slideshow-support/issues/29#issuecomment-1219757057, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3GSETVRYIHCHUKHBB6QVLVZZYB5ANCNFSM565UJRRQ . You are receiving this because you were mentioned.Message ID: @.***>

2022-08-18 21:14:58 INFO sk.mimac.slideshow.StartupActivity - Starting Slideshow (version 3.23.0) 2022-08-18 21:14:58 ERROR sk.mimac.slideshow.settings.SettingsHelper - Can't load settings: file '/storage/emulated/0/slideshow/settings.xml' doesn't exist 2022-08-18 21:14:58 DEBUG sk.mimac.slideshow.database.DatabaseManager - Loading database: /storage/emulated/0/slideshow/database.mv.db 2022-08-18 21:14:58 INFO sk.mimac.slideshow.database.DatabaseChanger - Missing tables in database, creating 2022-08-18 21:14:58 DEBUG sk.mimac.slideshow.database.DatabaseChanger - Creating default admin user 2022-08-18 21:14:58 INFO sk.mimac.slideshow.database.dao.AccessUserDao - User 'Default admin' added 2022-08-18 21:14:58 INFO sk.mimac.slideshow.database.DatabaseChanger - Missing table panel_item in database, creating 2022-08-18 21:14:58 ERROR sk.mimac.slideshow.StartupActivity - Can't initialize Slideshow java.lang.RuntimeException: Can't load database at sk.mimac.slideshow.database.DatabaseManager.loadDatabase(Unknown Source:18) at sk.mimac.slideshow.Initializer.initCommons(:2) at sk.mimac.slideshow.StartupActivity.run(:9) at java.lang.Thread.run(Thread.java:919) Caused by: org.h2.jdbc.JdbcSQLException: Table "SCREEN_LAYOUT" already exists; SQL statement: CREATE TABLE screen_layout (id integer PRIMARY KEY AUTO_INCREMENT, name varchar(50) NOT NULL); CREATE TABLE panel_item (id integer PRIMARY KEY AUTO_INCREMENT, screen_layout_id integer NOT NULL, name varchar(150) NOT NULL, background_color varchar(20) NOT NULL, x integer NOT NULL, y integer NOT NULL, height integer NOT NULL, width integer NOT NULL, main_panel boolean NOT NULL,FOREIGN KEY (screen_layout_id) REFERENCES screen_layout(id));CREATE TABLE screen_layout_timing (day integer DEFAULT NULL, hour int NOT NULL, screen_layout integer NOT NULL);ALTER TABLE playing ADD panel_item_id integer DEFAULT 1;ALTER TABLE playing ADD FOREIGN KEY (playlist) REFERENCES playlist(id);ALTER TABLE item ADD properties varchar(1023); [42101-196] at org.h2.command.ddl.CreateTable.update(Unknown Source:75) at org.h2.command.CommandContainer.update(Unknown Source:24) at org.h2.command.Command.executeUpdate(Unknown Source:54) at org.h2.command.CommandList.update(Unknown Source:2) at org.h2.command.Command.executeUpdate(Unknown Source:54) at org.h2.jdbc.JdbcStatement.executeInternal(Unknown Source:87) at org.h2.jdbc.JdbcStatement.execute(Unknown Source:5) at com.zaxxer.hikari.proxy.HikariStatementProxy.execute(:1) at org.spongycastle.math.raw.Nat128.process(Unknown Source:4) at sk.mimac.slideshow.database.DatabaseChanger.checkPanelItemTable(:1) at sk.mimac.slideshow.database.DatabaseManager.loadDatabaseInternal(:4) at sk.mimac.slideshow.database.DatabaseManager.loadDatabase(Unknown Source:9) at sk.mimac.slideshow.Initializer.initCommons(:2) at sk.mimac.slideshow.StartupActivity.run(:9) at java.lang.Thread.run(Thread.java:919)