weixin_39913141
weixin_39913141
2021-01-08 08:39

"Sync error connection timed out" within seconds

Research

Enter an [ x ] character to confirm the points below:

[ X ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid

[ X ] I have checked the manual and the FAQ and could not find a solution to my issue

[ X ] I have searched for similar existing issues here and on the user forum

Reproduction Steps
  1. Open AnkiDroid
  2. Click the sync button
Expected Result

Depending on network condition: * Sync proceeds till success. * Sync fails with "timeout" error message after at least 10~20 seconds of waiting. * Sync fails randomly, with "connection reset by peer" or similar error message.

Actual Result

Sync fails with a "timeout" error message, after a very short time (often <1 seconds).

Debug info

AnkiDroid Version = 2.7

Android Version = 6.0.1

ACRA UUID = be360819-cb12-41a0-abc3-df4ab34a6fb4

Details

I have been experiencing this issue for multiple days now. The exact message is: "sync error/Connection timed out. Either your internet connection is experiencing problems, or you have a very large file in your media folder".

The problem seems to be appearing in any one of the steps of the synchronization process (preparing, synchronizing deletions, small objects, downloading/uploading changes, writing changes into the database...) though it's hard to tell exactly. Transfer occasionally succeeds, though most of the time, after a few attempts, I get: "Sync error/Only one client can access AnkiWeb at a time. If a previous sync filed, please try again in a few minutes".

Transfer "feels reasonably fast". In any case, timeout always happens within <5 seconds of a given step, which seems too short for a TCP/IP timeout.

I did not experience any issues syncing the same deck from either the Windows or Mac clients. It's a pretty large deck, but with a very limited amount of incremental change (daily reviews, plus at most a few cards added).

I've tried multiple times of day, and multiple networks (including one shared with my Win and Mac computers). While the computers occasionally fail with "connection reset by peer", they don't exhibit the same "fast timeout" behavior.

I'm posting this here because the issue is only happening on AnkiDroid. Please indicate whether there's anything I can do to help the debugging process.

该提问来源于开源项目:ankidroid/Anki-Android

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39617405 weixin_39617405 4月前

    We've just moved to new network availability APIs in the recent code (available in alpha versions, which are stabilizing fairly well now) - until then I could imagine AnkiDroid would use iffy network connections on Lollipop and above. Additionally, we retry things 5 times now on failures if I recall correctly. Please reopen if you install 2.9alpha42 or higher and this still happens

    点赞 评论 复制链接分享
  • weixin_39700548 weixin_39700548 4月前

    I'm getting this today with AnkiDroid 2.9 (I think, how do I get the exact version number?) . No update is available to me on google play, although that might be because I'm using Android 4.4 (KitKat) on my ancient yet beloved phone.

    The phone is working fine on a good network. Various other devices, (a more modern phone and two computers ) are still syncing happily with ankiweb. I've tried closing and restarting ankidroid, and rebooting the entire phone, but nothing helps. I just get this error immediately I try to sync.

    点赞 评论 复制链接分享
  • weixin_39693950 weixin_39693950 4月前

    Please read the support page instead of asking how to get your version number. Also there's a wiki here on github with various options for installation of AnkiDroid pre-releases. We're pretty busy and don't have time to hold people's hand through these things.

    https://ankidroid.org/docs/help.html

    点赞 评论 复制链接分享
  • weixin_39700548 weixin_39700548 4月前

    Sorry, that really was quite feeble of me. It's 2.9.1

    I've uninstalled and reinstalled ankidroid, and now it's failing at the 'log into ankiweb' stage, it just says 'A network error occurred'. I've tried rebooting the phone again and it still happens. As far as I can tell other apps are talking to the network without problems.

    点赞 评论 复制链接分享
  • weixin_39700548 weixin_39700548 4月前

    It occurred to me to cause the error with adb logcat | grep Anki running

    It's claiming: E/AnkiDroid(10402): javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x61e894a0: Failure in SSL library, usually a protocol error

    full thing here:

    W/dalvikvm(10402): method Lcom/ichi2/anki/AnkiDroidApp$ProductionCrashReportingTree;.getTag incorrectly overrides package-private method with same name in Ltimber/log/Timber$Tree; I/AnkiDroid(10402): initialize() I/AnkiDroid(10402): Not participating in analytics sample (sample percentage vs random: 10 69) I/AnkiDroid(10402): setOptIn(): from false to false I/AnkiDroid(10402): Not participating in analytics sample (sample percentage vs random: 10 88) I/AnkiDroid(10402): openCollection: /sdcard/AnkiDroid/collection.anki2 I/AnkiDroid(10402): DeckPicker:: Sync button pressed W/AnkiDroid(10402): AnkiActivity/ Couldn't preload url: https://ankiweb.net/account/register E/AnkiDroid(10402): HttpSyncer/ SSLException while building HttpClient E/AnkiDroid(10402): javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x61e894a0: Failure in SSL library, usually a protocol error E/AnkiDroid(10402): error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (external/openssl/ssl/s23_clnt.c:741 0x5f906df4:0x00000000) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.(OpenSSLSocketImpl.java:661) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:632) E/AnkiDroid(10402): at org.apache.http.impl.io.SocketInputBuffer.(SocketInputBuffer.java:70) E/AnkiDroid(10402): at org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:83) E/AnkiDroid(10402): at org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:170) E/AnkiDroid(10402): at org.apache.http.impl.SocketHttpClientConnection.bind(SocketHttpClientConnection.java:106) E/AnkiDroid(10402): at org.apache.http.impl.conn.DefaultClientConnection.openCompleted(DefaultClientConnection.java:129) E/AnkiDroid(10402): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:172) E/AnkiDroid(10402): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) E/AnkiDroid(10402): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) E/AnkiDroid(10402): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:374) E/AnkiDroid(10402): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:575) E/AnkiDroid(10402): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:498) E/AnkiDroid(10402): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:476) E/AnkiDroid(10402): at com.ichi2.libanki.sync.HttpSyncer.req(HttpSyncer.java:56) E/AnkiDroid(10402): at com.ichi2.libanki.sync.HttpSyncer.req(HttpSyncer.java:4) E/AnkiDroid(10402): at com.ichi2.libanki.sync.HttpSyncer.req(HttpSyncer.java:2) E/AnkiDroid(10402): at com.ichi2.libanki.sync.RemoteServer.hostKey(RemoteServer.java:5) E/AnkiDroid(10402): at com.ichi2.async.Connection.doInBackgroundLogin(Connection.java:4) E/AnkiDroid(10402): at com.ichi2.async.Connection.doOneInBackground(Connection.java:3) E/AnkiDroid(10402): at com.ichi2.async.Connection.doInBackground(Connection.java:4) E/AnkiDroid(10402): at com.ichi2.async.Connection.doInBackground(Connection.java:1) E/AnkiDroid(10402): at android.os.AsyncTask$2.call(AsyncTask.java:288) E/AnkiDroid(10402): at java.util.concurrent.FutureTask.run(FutureTask.java:237) E/AnkiDroid(10402): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E/AnkiDroid(10402): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E/AnkiDroid(10402): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E/AnkiDroid(10402): at java.lang.Thread.run(Thread.java:841) E/AnkiDroid(10402): Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x61e894a0: Failure in SSL library, usually a protocol error E/AnkiDroid(10402): error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (external/openssl/ssl/s23_clnt.c:741 0x5f906df4:0x00000000) E/AnkiDroid(10402): at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:405) E/AnkiDroid(10402): ... 28 more E/AnkiDroid(10402): E/AnkiDroid(10402): javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x61e894a0: Failure in SSL library, usually a protocol error E/AnkiDroid(10402): error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version (external/openssl/ssl/s23_clnt.c:741 0x5f906df4:0x00000000) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:448) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.(OpenSSLSocketImpl.java:661) E/AnkiDroid(10402): at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.java:632) E/AnkiDroid(10402): at org.apache.http.impl.io.SocketInputBuffer.(SocketInputBuffer.java:70) E/AnkiDroid(10402): at org.apache.http.impl.SocketHttpClientConnection.createSessionInputBuffer(SocketHttpClientConnection.java:83) E/AnkiDroid(10402): at org.apache.http.impl.conn.DefaultClientConnection.createSessionInputBuffer(DefaultClientConnection.java:170) E/AnkiDroid(10402): at org.apache.http.i E/AnkiDroid(10402): MyAccount/ Login failed, error code 0

    点赞 评论 复制链接分享
  • weixin_39617405 weixin_39617405 4月前

    I just added a FAQ with all the details

    https://github.com/ankidroid/Anki-Android/wiki/FAQ#sync-is-not-working

    点赞 评论 复制链接分享
  • weixin_39700548 weixin_39700548 4月前

    Ah, I see, thanks very much Mike and Tim, I'll see if I can get the beta working!

    点赞 评论 复制链接分享
  • weixin_39700548 weixin_39700548 4月前

    I confirm that 2.9.2beta5 solves the problem on my Android 4.4.4 phone. Thanks Guys!

    点赞 评论 复制链接分享
  • weixin_39610468 weixin_39610468 4月前

    I had the same problem since early today. Using the beta also solved it. Thanks a lot. Sorry for the unnecessary comment but this has been stressing me all day and I just had to say thanks for the awesome people who provided the solution.

    Thanks again. Much appreciated.

    点赞 评论 复制链接分享

相关推荐