fabianonline / telegram_backup

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

Errors while files getting downloaded #46

Closed ibiBgOR closed 6 years ago

ibiBgOR commented 7 years ago

While the tool downloads the files from telegram following errors occures:


...............Exception in thread "MTProtoWatchdog-exec-thread-47" java.lang.Error: java
.nio.channels.ClosedChannelException                                                     
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1148
)                                                                                        
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617
)                                                                                        
        at java.lang.Thread.run(Thread.java:744)                                         
Caused by: java.nio.channels.ClosedChannelException                                      
        at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSele
ctableChannel.java:289)                                                                  
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.unregister
(MTProtoTcpConnection.kt:120)                                                            
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.stop(MTProtoWatchdog.kt:1
32)                                                                                      
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatc
hdog.kt:63)                                                                              
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142
)                                                                                        
        ... 2 more                                                                       
Exception in thread "MTProtoWatchdog-exec-thread-48" java.lang.Error: java.nio.channels.C
losedChannelException                                                                    
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1148
)                                                                                        
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617
)                                                                                        
        at java.lang.Thread.run(Thread.java:744)                                         
Caused by: java.nio.channels.ClosedChannelException                                      
        at java.nio.channels.spi.AbstractSelectableChannel.configureBlocking(AbstractSele
ctableChannel.java:289)                                                                  
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.unregister
(MTProtoTcpConnection.kt:120)                                                            
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.stop(MTProtoWatchdog.kt:1
32)                                                                                      
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatc
hdog.kt:63)                                                                              
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142
)                                                                                        
        ... 2 more                                                                       

Telegram took too long to respond to our request.                                        
I'm going to wait a minute and then try again.```

It downloads the first 16 images correctly, but then more or less hangs while downloading a 15MB file. After looking in the code I saw, that the blocksize is equal to the file size, which leads to this error. After setting it to 1024 (bytes) the file gets downloaded correctly.

I will push my changes to my fork and make a merge request.
fabianonline commented 6 years ago

Duplicate of #44.