Closed mhutti1 closed 6 years ago
Can i work on this issue? @mhutti1
Yeah @RajaVamsi11 please checkout https://github.com/kiwix/kiwix-android/invitations so we can assign you to tasks.
@mhutti1 I think it is basically because in app permissions you need to add write external storage permission as well for android versions less that or equal to 18. Therefore for those versions we need to ask for one more permission from the user. If we add maxSdkVersion in manifest permission in write external storage and check if the permission was given in case of these android versions before downloading ZIM files, it will solve the problem. So if nobody's working on this issue should I go forward with it?
@mhutti1 zim file is downloading without problem in emmulator with API level 16 .
The necessary permissions "READ_EXTERNAL_STORAGE" and "WRITE_EXTERNAL_STORAGE" are included in manifest file.
@mhutti1 Works fine for me as well.
It does not work for me with Jellybean API 16 x86 4.1 (Google APIs)
@mhutti1 Can you please post the log?
It looks to be a HTTPS issue, thus locale's might use a different mirror and might not be effected as much. We should still try to fix this though:
03-01 20:10:47.287 3084-3127/org.kiwix.kiwixmobile W/System.err: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:374)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:268)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:238)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at okhttp3.RealCall.execute(RealCall.java:69)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.kiwix.kiwixmobile.downloader.DownloadService.lambda$getMetaLinkContentLength$8$DownloadService(DownloadService.java:349)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.kiwix.kiwixmobile.downloader.DownloadService$$Lambda$9.call(Unknown Source)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.Observable.unsafeSubscribe(Observable.java:8460)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:145)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:74)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OnSubscribeRedo$2$1.onNext(OnSubscribeRedo.java:249)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:41)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:38)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:173)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.producers.ProducerArbiter.setProducer(ProducerArbiter.java:126)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OnSubscribeRedo$2$1.setProducer(OnSubscribeRedo.java:272)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.Subscriber.setProducer(Subscriber.java:205)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.Observable.unsafeSubscribe(Observable.java:8460)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at java.lang.Thread.run(Thread.java:856)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:192)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:163)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:573)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:371)
03-01 20:10:47.297 3084-3127/org.kiwix.kiwixmobile W/System.err: ... 52 more
@mhutti1 On it.
I've reproduced this error on a physical device, a HTC Desire 510 running Android 4.4.3
Here's the extract of the logcat. I'll do some searching. @RajaVamsi11 what progress have you managed to make?
04-05 10:48:04.888 12274-12300/org.kiwix.kiwixmobile D/OkHttp: --> GET http://download.kiwix.org/zim/wikipedia/wikipedia_en_ray_charles_2015-06.zim.meta4 http/1.1
04-05 10:48:04.988 12274-12300/org.kiwix.kiwixmobile D/OkHttp: <-- 200 OK http://download.kiwix.org/zim/wikipedia/wikipedia_en_ray_charles_2015-06.zim.meta4 (100ms, 2291-byte body)
04-05 10:48:05.018 12274-12300/org.kiwix.kiwixmobile D/libc: [NET] getaddrinfo+,hn 21(0x7777772e6d6972),sn(),family 0,flags 4
[NET] getaddrinfo-,err=8
[NET] getaddrinfo+,hn 21(0x7777772e6d6972),sn(),family 0,flags 1024
[NET] getaddrinfo-, 1
[NET] getaddrinfo_proxy+
04-05 10:48:05.048 12274-12300/org.kiwix.kiwixmobile D/libc: [NET] getaddrinfo_proxy-, success
04-05 10:48:05.098 12274-12300/org.kiwix.kiwixmobile W/System.err: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:412)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:268)
04-05 10:48:05.108 12274-12300/org.kiwix.kiwixmobile W/System.err: at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:238)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
at okhttp3.RealCall.execute(RealCall.java:69)
at org.kiwix.kiwixmobile.downloader.DownloadService.lambda$getMetaLinkContentLength$6$DownloadService(DownloadService.java:350)
at org.kiwix.kiwixmobile.downloader.DownloadService$$Lambda$7.call(Unknown Source)
at rx.Observable.unsafeSubscribe(Observable.java:8460)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:145)
at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:74)
at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
at rx.internal.operators.OnSubscribeRedo$2$1.onNext(OnSubscribeRedo.java:249)
at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:41)
at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:38)
04-05 10:48:05.118 12274-12300/org.kiwix.kiwixmobile W/System.err: at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:173)
at rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)
at rx.internal.producers.ProducerArbiter.setProducer(ProducerArbiter.java:126)
at rx.internal.operators.OnSubscribeRedo$2$1.setProducer(OnSubscribeRedo.java:272)
at rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)
at rx.Subscriber.setProducer(Subscriber.java:205)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)
at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
at rx.Observable.unsafeSubscribe(Observable.java:8460)
at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:864)
Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
04-05 10:48:05.128 12274-12300/org.kiwix.kiwixmobile W/System.err: at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:282)
at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:202)
at com.android.org.conscrypt.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:614)
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:407)
... 51 more
Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
... 56 more
04-05 10:48:09.918 12274-12274/org.kiwix.kiwixmobile W/IdlingPolicy: These resources are not idle: [Standard Kiwix Idling Resource]
04-05 10:48:14.928 12274-12274/org.kiwix.kiwixmobile W/IdlingPolicy: These resources are not idle: [Standard Kiwix Idling Resource]
04-05 10:48:19.928 12274-12274/org.kiwix.kiwixmobile W/IdlingPolicy: These resources are not idle: [Standard Kiwix Idling Resource]
(which repeats many times at 5 second intervals, then)
04-05 10:53:50.348 12274-12274/org.kiwix.kiwixmobile W/IdlingPolicy: These resources are not idle: [Standard Kiwix Idling Resource]
04-05 10:53:54.968 12274-12274/org.kiwix.kiwixmobile D/LifecycleMonitor: Lifecycle status change: org.kiwix.kiwixmobile.zim_manager.ZimManageActivity@41c36730 in: DESTROYED
04-05 10:53:54.998 12274-12288/org.kiwix.kiwixmobile I/TestRunner: failed: downloadTest(org.kiwix.kiwixmobile.tests.DownloadTest)
----- begin exception -----
android.support.test.espresso.PerformException: Error performing 'single click - At Coordinates: 239, 327 and precision: 16, 16' on view ' displaying data matching: with content 'ray_charles' within adapter view matching: with id: org.kiwix.kiwixmobile:id/library_list'.
at android.support.test.espresso.PerformException$Builder.build(PerformException.java:84)
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:81)
at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:52)
at android.support.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:312)
at android.support.test.espresso.ViewInteraction.desugaredPerform(ViewInteraction.java:167)
at android.support.test.espresso.ViewInteraction.perform(ViewInteraction.java:110)
at android.support.test.espresso.DataInteraction.perform(DataInteraction.java:128)
at org.kiwix.kiwixmobile.tests.DownloadTest.downloadTest(DownloadTest.java:97)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at android.support.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at android.support.test.internal.runner.junit4.statement.RunAfters.evaluate(RunAfters.java:61)
at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:433)
at android.support.test.rule.GrantPermissionRule$RequestPermissionStatement.evaluate(GrantPermissionRule.java:109)
at android.support.test.rule.GrantPermissionRule$RequestPermissionStatement.evaluate(GrantPermissionRule.java:109)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:58)
at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:375)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1840)
Caused by: android.support.test.espresso.IdlingResourceTimeoutException: Wait for [Standard Kiwix Idling Resource] to become idle timed out
at android.support.test.espresso.IdlingPolicy.handleTimeout(IdlingPolicy.java:60)
at android.support.test.espresso.base.UiControllerImpl$4.resourcesHaveTimedOut(UiControllerImpl.java:368)
at android.support.test.espresso.base.IdlingResourceRegistry$Dispatch
----- end exception -----
04-05 10:53:55.008 12274-12288/org.kiwix.kiwixmobile I/TestRunner: finished: downloadTest(org.kiwix.kiwixmobile.tests.DownloadTest)
04-05 10:53:55.038 12274-12274/org.kiwix.kiwixmobile I/MonitoringInstr: Activities that are still in CREATED to STOPPED: 0
04-05 10:53:55.038 12274-12288/org.kiwix.kiwixmobile I/TestRunner: run finished: 1 tests, 1 failed, 0 ignored
04-05 10:53:55.098 12274-12288/org.kiwix.kiwixmobile D/libc: [NET] getaddrinfo+,hn 24(0x7777772e676f6f),sn(),family 0,flags 4
[NET] getaddrinfo-,err=8
[NET] getaddrinfo+,hn 24(0x7777772e676f6f),sn(),family 0,flags 1024
[NET] getaddrinfo-, 1
[NET] getaddrinfo_proxy+
04-05 10:53:55.128 12274-12288/org.kiwix.kiwixmobile D/libc: [NET] getaddrinfo_proxy-, success
04-05 10:53:55.358 12274-12288/org.kiwix.kiwixmobile I/MonitoringInstr: waitForActivitiesToComplete() took: 0ms
04-05 10:53:55.358 12274-12274/org.kiwix.kiwixmobile I/MonitoringInstr: Activities that are still in CREATED to STOPPED: 0
04-05 10:53:55.608 824-1181/? I/ActivityManager: Force stopping org.kiwix.kiwixmobile appid=10344 user=0: finished inst
Killing 12274:org.kiwix.kiwixmobile/u0a344 (adj 0): stop org.kiwix.kiwixmobile
04-05 10:53:55.608 824-1181/? W/ActivityManager: Scheduling restart of crashed service org.kiwix.kiwixmobile/.downloader.DownloadService in 701756ms
04-05 10:53:55.618 824-1181/? I/ActivityManager: Force stopping service ServiceRecord{42fb6b98 u0 org.kiwix.kiwixmobile/.downloader.DownloadService}
04-05 10:53:56.348 824-1482/? I/ActivityManager: Force stopping org.kiwix.kiwixmobile appid=10344 user=0: from pid 12526
04-05 10:53:56.348 1436-3615/? D/DotMatrix: [NotificationService] onNotificationRemoved, pkgName: org.kiwix.kiwixmobile, id: -1510021710, isClearable: false, isForDotMatrix: false
The problem seems fairly widespread on older versions of Android and prevents ZIM files from being downloaded from what I can tell so far. I've tested by running (ie using) Kiwix on several older models where Kiwix used to work previously. I'll continue finding more older devices (with Android 4.x and 5.x) to see the extent of the problem.
I can't download ZIM files on the HTC Desire 510 or on a Nexus S
Here's logcat from a Nexus S running Android 4.1.2
D/OkHttp ( 6071): --> GET http://download.kiwix.org/zim/wikipedia/wikipedia_en_medicine_nopic_nodet_2018-03.zim.meta4 http/1.1
D/OkHttp ( 6071): <-- 200 OK http://download.kiwix.org/zim/wikipedia/wikipedia_en_medicine_nopic_nodet_2018-03.zim.meta4 (106ms, 7377-byte body)
W/System.err( 6071): javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
W/System.err( 6071): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:398)
W/System.err( 6071): at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:268)
W/System.err( 6071): at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:238)
W/System.err( 6071): at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
W/System.err( 6071): at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
W/System.err( 6071): at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
W/System.err( 6071): at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
W/System.err( 6071): at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
W/System.err( 6071): at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
W/System.err( 6071): at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err( 6071): at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err( 6071): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
W/System.err( 6071): at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
W/System.err( 6071): at okhttp3.RealCall.execute(RealCall.java:69)
W/System.err( 6071): at org.kiwix.kiwixmobile.downloader.DownloadService.lambda$getMetaLinkContentLength$6$DownloadService(DownloadService.java:350)
W/System.err( 6071): at org.kiwix.kiwixmobile.downloader.DownloadService$$Lambda$7.call(Unknown Source)
W/System.err( 6071): at rx.Observable.unsafeSubscribe(Observable.java:8460)
W/System.err( 6071): at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
W/System.err( 6071): at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:145)
W/System.err( 6071): at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:74)
W/System.err( 6071): at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
W/System.err( 6071): at rx.internal.operators.OnSubscribeRedo$2$1.onNext(OnSubscribeRedo.java:249)
W/System.err( 6071): at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
W/System.err( 6071): at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:41)
W/System.err( 6071): at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:38)
W/System.err( 6071): at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:173)
W/System.err( 6071): at rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)
W/System.err( 6071): at rx.internal.producers.ProducerArbiter.setProducer(ProducerArbiter.java:126)
W/System.err( 6071): at rx.internal.operators.OnSubscribeRedo$2$1.setProducer(OnSubscribeRedo.java:272)
W/System.err( 6071): at rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)
W/System.err( 6071): at rx.Subscriber.setProducer(Subscriber.java:205)
W/System.err( 6071): at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
W/System.err( 6071): at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
W/System.err( 6071): at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)
W/System.err( 6071): at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
W/System.err( 6071): at rx.Observable.unsafeSubscribe(Observable.java:8460)
W/System.err( 6071): at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
W/System.err( 6071): at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
W/System.err( 6071): at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
W/System.err( 6071): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
W/System.err( 6071): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/System.err( 6071): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/System.err( 6071): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:150)
W/System.err( 6071): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:264)
W/System.err( 6071): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/System.err( 6071): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/System.err( 6071): at java.lang.Thread.run(Thread.java:856)
W/System.err( 6071): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
W/System.err( 6071): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:192)
W/System.err( 6071): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:163)
W/System.err( 6071): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:597)
W/System.err( 6071): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
W/System.err( 6071): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:395)
W/System.err( 6071): ... 52 more
W/System.err( 6071): Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
W/System.err( 6071): ... 57 more
Downloads work on:
Downloads fail on:
I'll continue to dig out various devices, however these tests indicate the app doesn't download ZIM files on 4.x devices. Next steps (apart from trying more devices) is to try an older release of Kiwix-Android. I'm trying v2.2 from http://download.kiwix.org/bin/android/?C=M;O=D
That was a useful tests (trying Kiwix 2.2) as it indicates the problem also affects the older release (created over a year ago). I believe Kiwix 2.3 used to work on many, perhaps all, of the devices where the downloads now fail. So something could have changed externally to the app e.g.
I'll see if I can get my local kiwix download server running and try testing against that as it's a basic Raspberry Pi which won't have been updated recently.
Here's the extract from adb logcat
for Kiwix 2.2 trying to download a ZIM file (one of the two _ab_
ones e.g. http://download.kiwix.org/zim/wikipedia/wikipedia_ab_all_nopic_2017-07.zim)
D/dalvikvm( 498): GC_CONCURRENT freed 1954K, 47% free 14481K/26884K, paused 12ms+5ms, total 71ms
D/dalvikvm(32140): GC_FOR_ALLOC freed 448K, 9% free 11511K/12532K, paused 46ms, total 48ms
W/System.err(32030): javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
W/System.err(32030): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:401)
W/System.err(32030): at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:241)
W/System.err(32030): at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:198)
W/System.err(32030): at okhttp3.internal.connection.RealConnection.buildConnection(RealConnection.java:174)
W/System.err(32030): at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:114)
W/System.err(32030): at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:193)
W/System.err(32030): at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129)
W/System.err(32030): at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98)
W/System.err(32030): at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
W/System.err(32030): at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
W/System.err(32030): at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err(32030): at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
W/System.err(32030): at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
W/System.err(32030): at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170)
W/System.err(32030): at okhttp3.RealCall.execute(RealCall.java:60)
W/System.err(32030): at org.kiwix.kiwixmobile.downloader.DownloadService.lambda$getMetaLinkContentLength$5(DownloadService.java:273)
W/System.err(32030): at org.kiwix.kiwixmobile.downloader.DownloadService.access$lambda$5(DownloadService.java)
W/System.err(32030): at org.kiwix.kiwixmobile.downloader.DownloadService$$Lambda$7.call(Unknown Source)
W/System.err(32030): at rx.Observable.unsafeSubscribe(Observable.java:8460)
W/System.err(32030): at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:248)
W/System.err(32030): at rx.internal.operators.OperatorMerge$MergeSubscriber.onNext(OperatorMerge.java:145)
W/System.err(32030): at rx.internal.operators.OperatorMap$MapSubscriber.onNext(OperatorMap.java:74)
W/System.err(32030): at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
W/System.err(32030): at rx.internal.operators.OnSubscribeRedo$2$1.onNext(OnSubscribeRedo.java:249)
W/System.err(32030): at rx.internal.operators.OperatorSubscribeOn$1$1.onNext(OperatorSubscribeOn.java:53)
W/System.err(32030): at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:41)
W/System.err(32030): at retrofit2.adapter.rxjava.OperatorMapResponseToBodyOrError$1.onNext(OperatorMapResponseToBodyOrError.java:38)
W/System.err(32030): at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:173)
W/System.err(32030): at rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)
W/System.err(32030): at rx.internal.producers.ProducerArbiter.setProducer(ProducerArbiter.java:126)
W/System.err(32030): at rx.internal.operators.OnSubscribeRedo$2$1.setProducer(OnSubscribeRedo.java:272)
W/System.err(32030): at rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)
W/System.err(32030): at rx.Subscriber.setProducer(Subscriber.java:205)
W/System.err(32030): at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
W/System.err(32030): at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
W/System.err(32030): at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)
W/System.err(32030): at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
W/System.err(32030): at rx.Observable.unsafeSubscribe(Observable.java:8460)
W/System.err(32030): at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
W/System.err(32030): at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)
W/System.err(32030): at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
W/System.err(32030): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
W/System.err(32030): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
W/System.err(32030): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:153)
W/System.err(32030): at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267)
W/System.err(32030): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
W/System.err(32030): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
W/System.err(32030): at java.lang.Thread.run(Thread.java:841)
W/System.err(32030): Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
W/System.err(32030): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:282)
W/System.err(32030): at org.apache.harmony.xnet.provider.jsse.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:202)
W/System.err(32030): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.verifyCertificateChain(OpenSSLSocketImpl.java:595)
W/System.err(32030): at org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_do_handshake(Native Method)
W/System.err(32030): at org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:398)
W/System.err(32030): ... 53 more
W/System.err(32030): Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
W/System.err(32030): ... 58 more
I think we changed to use the mirrored library and that is likely the change breaking it as some of the mirrors' certificates are not compatible for some reason.
@mhutti1 which library? and when was it changed? can you remember the details? I ask as my test with last year's version of Kiwix also failed on the older Android releases (4.x) Anyway my guess is that there'll be users of Kiwix who can't use the download feature at the moment so it'll be great to find the cause(s) and enable the app to work again on all the Android releases we support. Thanks for the update.
@mhutti1 @julianharty FYI Both https://download.kiwix.org
and http://download.kiwix.org
are available. Most of download.kiwix.org
mirrors are configured on download.kiwix.org
to use https
. That said we manage ourself a http
only mirror which is available at http://mirror.download.kiwix.org
exactly for that purpose: allow devices without https support or with an old key trustore to download things. Kiwix downloader should be conceived to deal with that problem/solution.
@kelson42 @mhutti1 I tested we could use http://
to download from mirror service both in a desktop browser and from the app. I've added a helper method to replace https with http and tested it on both a 4.x device (a HTC Desire 510 running 4.4.3) and a Nexus 7 2013 running 5.1.1 (which still uses https). I'll create a pull request and ask @mhutti1 to review it. I'm happy to make improvements and alter the code e.g. if there'd be a way to download the files using https on Android 4.x
For completeness I tested whether I could download a ZIM file from download.kiwix.org using the installed web browser on the device. The browser shows a security warning. See the following screenshots:
The browser does allow me to download the file BTW but the download also hangs as far as I can tell (since I'm trying to download a ZIM file of < 1MB and it doesn't complete...)
Bug Report
Environment: Android API 16 Emmulator
Bug: Unable to download ZIM files (possibly because network looks like it has no signal).
Steps to reproduce: