fabianonline / telegram_backup

Java app to download all your telegram data.
GNU General Public License v3.0
447 stars 91 forks source link

Error when upgrading database from 7 to 9 #94

Closed tian2992 closed 6 years ago

tian2992 commented 6 years ago

Tried 1.1.2; get an error when upgrading the database:

Base directory for files: /home/<myhome>/.telegram_backup                                                                                                                                                                                       
Using only available account: <myphone>                 
Opening database...                                        
Database version: 7                                                                                                    
  Creating a backup of your database as database.version_7.backup.sqlite                                               
  Updating to version 8...                                 
  Updating to version 9...                                                                                             
    Updating supergroup channel message data (this might take some time)...                                                                                                                                                                   
    Cleaning up the database (this might also take some time, sorry)...                                                                                                                                                                       
java.lang.RuntimeException: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (cannot VACUUM - SQL statements in progress)
        at de.fabianonline.telegram_backup.DatabaseUpdates.doUpdates(DatabaseUpdates.kt:87)                            
        at de.fabianonline.telegram_backup.Database.<init>(Database.kt:234)                                            
        at de.fabianonline.telegram_backup.Database.<init>(Database.kt:50)
        at de.fabianonline.telegram_backup.Database$Companion.init(Database.kt:766)                                    
        at de.fabianonline.telegram_backup.CommandLineController.<init>(CommandLineController.kt:102)                  
        at de.fabianonline.telegram_backup.CommandLineRunnerKt.main(CommandLineRunner.kt:40)
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (cannot VACUUM - SQL statements in progress)
        at org.sqlite.core.DB.newSQLException(DB.java:909)                                                                                                                                                                                    
        at org.sqlite.core.DB.newSQLException(DB.java:921)                                                             
        at org.sqlite.core.DB.throwex(DB.java:886)                                                                                                                                                                                            
        at org.sqlite.core.NativeDB._exec_utf8(Native Method)                                                                                                                                                                                 
        at org.sqlite.core.NativeDB._exec(NativeDB.java:87)                                                            
        at org.sqlite.jdbc3.JDBC3Statement.executeUpdate(JDBC3Statement.java:116)                                      
        at de.fabianonline.telegram_backup.DatabaseUpdate.execute(DatabaseUpdates.kt:148)                              
        at de.fabianonline.telegram_backup.DB_Update_9._doUpdate(DatabaseUpdates.kt:409)                                                                                                                                                      
        at de.fabianonline.telegram_backup.DatabaseUpdate.doUpdate(DatabaseUpdates.kt:135)                                                                                                                                                    
        at de.fabianonline.telegram_backup.DatabaseUpdates.doUpdates(DatabaseUpdates.kt:84)                            
        ... 5 more                                                                                                     

----- EXIT -----      

Downloaded version 1.1.1 and it worked and converted the DB successfully. Then re-launched 1.1.2 and worked out fine.

simplyQQ commented 6 years ago

Same here. Thanks for the workaround.

danielperez9430 commented 6 years ago

In version 1.1.2 I receiver this error when download photos, videos,...

Exception in thread "MTProtoWatchdog-exec-thread-1" java.lang.Error: java.nio.channels.ClosedChannelException
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.nio.channels.ClosedChannelException
        at java.base/java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(Unknown Source)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.unregister(MTProtoTcpConnection.kt:120)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.stop(MTProtoWatchdog.kt:132)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatchdog.kt:63)
        ... 3 more
Exception in thread "MTProtoWatchdog-exec-thread-2" java.lang.Error: java.nio.channels.ClosedChannelException
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.nio.channels.ClosedChannelException
        at java.base/java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(Unknown Source)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.unregister(MTProtoTcpConnection.kt:120)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.stop(MTProtoWatchdog.kt:132)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatchdog.kt:63)
        ... 3 more
Exception in thread "MTProtoWatchdog-exec-thread-4" java.lang.Error: java.nio.channels.ClosedChannelException
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.nio.channels.ClosedChannelException
        at java.base/java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(Unknown Source)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.unregister(MTProtoTcpConnection.kt:120)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.stop(MTProtoWatchdog.kt:132)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatchdog.kt:63)
        ... 3 more
Stunkymonkey commented 6 years ago

problem persists with 1.1.3 upgrading from 8 to 9

Vest commented 6 years ago

Version 1.1.3 gives a slightly different call stack (line number):

Opening database...
Database version: 8
  Creating a backup of your database as database.version_8.backup.sqlite
  Updating to version 9...
    Updating supergroup channel message data (this might take some time)...

    Cleaning up the database (this might also take some time, sorry)...
An error occured!

java.lang.RuntimeException: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (cannot VACUUM - SQL statements in progress)
        at de.fabianonline.telegram_backup.DatabaseUpdates.doUpdates(DatabaseUpdates.kt:107)
        at de.fabianonline.telegram_backup.Database.<init>(Database.kt:234)
        at de.fabianonline.telegram_backup.Database.<init>(Database.kt:50)
        at de.fabianonline.telegram_backup.Database$Companion.init(Database.kt:766)
        at de.fabianonline.telegram_backup.CommandLineController.<init>(CommandLineController.kt:102)
        at de.fabianonline.telegram_backup.CommandLineRunnerKt.main(CommandLineRunner.kt:41)
Caused by: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (cannot VACUUM - SQL statements in progress)
        at org.sqlite.core.DB.newSQLException(DB.java:909)
        at org.sqlite.core.DB.newSQLException(DB.java:921)
        at org.sqlite.core.DB.throwex(DB.java:886)
        at org.sqlite.core.NativeDB._exec_utf8(Native Method)
        at org.sqlite.core.NativeDB._exec(NativeDB.java:87)
        at org.sqlite.jdbc3.JDBC3Statement.executeUpdate(JDBC3Statement.java:116)
        at de.fabianonline.telegram_backup.DatabaseUpdate.execute(DatabaseUpdates.kt:168)
        at de.fabianonline.telegram_backup.DB_Update_9._doUpdate(DatabaseUpdates.kt:445)
        at de.fabianonline.telegram_backup.DatabaseUpdate.doUpdate(DatabaseUpdates.kt:155)
        at de.fabianonline.telegram_backup.DatabaseUpdates.doUpdates(DatabaseUpdates.kt:104)
        ... 5 more
Vest commented 6 years ago

Can someone please review/test my pull request #99? It helped me to fix the bug, but I need more results :)

@fabianonline I hope you have time to review my PR.

fabianonline commented 6 years ago

1.1.4 is out, fixing this bug.