fabianonline / telegram_backup

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

Exceptions "IllegalStateException" #40

Closed u1735067 closed 6 years ago

u1735067 commented 7 years ago

Hello,

I launched a backup today, and I'm getting exceptions :

Downloading 2215 messages.
...200Exception in thread "RxComputationThreadPool-3" java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: rx.exceptions.OnErrorNotImplementedException: Reached end-of-stream
        at rx.Observable$26.onError(Observable.java:7881)
        at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:159)
        at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
        at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
        at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
        at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:191)
        at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:162)
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
        ... 7 more
Caused by: java.io.IOException: Reached end-of-stream
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readBytes(MTProtoTcpConnection.kt:143)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readBytes$default(MTProtoTcpConnection.kt:134)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readMessage(MTProtoTcpConnection.kt:65)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.readMessage(MTProtoWatchdog.kt:94)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.access$readMessage(MTProtoWatchdog.kt:18)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatchdog.kt:56)
        ... 3 more
...400Exception in thread "RxComputationThreadPool-8" java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: rx.exceptions.OnErrorNotImplementedException: Reached end-of-stream
        at rx.Observable$26.onError(Observable.java:7881)
        at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:159)
        at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
        at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
        at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
        at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:191)
        at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:162)
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
        ... 7 more
Caused by: java.io.IOException: Reached end-of-stream
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readBytes(MTProtoTcpConnection.kt:143)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readBytes$default(MTProtoTcpConnection.kt:134)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readMessage(MTProtoTcpConnection.kt:65)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.readMessage(MTProtoWatchdog.kt:94)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.access$readMessage(MTProtoWatchdog.kt:18)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatchdog.kt:56)
        ... 3 more

Telegram complained about us (okay, me) making too many requests in too short time by
sending us "FLOOD_WAIT_29" as an error. So we now have to wait a bit. Telegram
asked us to wait for 29 seconds.

So I'm going to do just that for now. If you don't want to wait, you can quit by pressing
Ctrl+C. You can restart me at any time and I will just continue to download your
messages and media. But be advised that just restarting me is not going to change
the fact that Telegram won't talk to me until then.

Exception in thread "RxComputationThreadPool-2" java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: rx.exceptions.OnErrorNotImplementedException: Reached end-of-stream
        at rx.Observable$26.onError(Observable.java:7881)
        at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:159)
        at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
        at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
        at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
        at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:191)
        at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:162)
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
        ... 7 more
Caused by: java.io.IOException: Reached end-of-stream
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readBytes(MTProtoTcpConnection.kt:143)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readBytes$default(MTProtoTcpConnection.kt:134)
        at com.github.badoualy.telegram.mtproto.transport.MTProtoTcpConnection.readMessage(MTProtoTcpConnection.kt:65)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.readMessage(MTProtoWatchdog.kt:94)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog.access$readMessage(MTProtoWatchdog.kt:18)
        at com.github.badoualy.telegram.mtproto.MTProtoWatchdog$run$2$1$1.run(MTProtoWatchdog.kt:56)
        ... 3 more
...600...800...1000...1200...1400...1600

It happened on 1.0.6, but I also tried on 1.0.5 and I got the same exception.

The backup finished, and starting a new one I don't have the error, but I hope nothing got corrupted.

Thanks a lot for this app btw :)

fabianonline commented 7 years ago

Unfortunately those exceptions are caused by a library I'm using, not my own code. That makes it very hard (if not impossible) to catch and process them... But I'll see what I can do.

but I hope nothing got corrupted.

Nothing to worry here. A message is either completely saved to the DB or it isn't saved at all. If a message is missing from the DB (because it couldn't get saved), the app will detect this on the next run and try to download it again. Same goes for media stuff.

fabianonline commented 6 years ago

There's nothing I can do about these errors and the download is continuing as planned.