Android: crash displying a pdf file

Created on 20 Jan 2020  路  14Comments  路  Source: nextcloud/android

Steps to reproduce

  1. Create pdf file using pdflatex in Nextcloud folder on Ubuntu 18.04
  2. Open said pdf file in Android on Samsung Galaxy Note 4
  3. Crash

Expected behaviour

  • Tell us what should happen
    Pdf file should display

    Actual behaviour

  • Tell us what happens
    Flashes pdf as a text file then complains of internal error then crashes.

    Environment data

Android version:
6.01
Device model:
SM-N916S
Stock or customized system:
STOCK
Nextcloud app version:
3.10.0
Nextcloud server version:
17

Logs

Web server error log

N/A Insert your webserver log here

Nextcloud log (data/nextcloud.log)

N/A```
Insert your Nextcloud log here

*** CAUSE OF ERROR ***

javax.net.ssl.SSLPeerUnverifiedException: Hostname 45.x.x.x not verified:
certificate: sha256/xxxxxxxxxcc
DN: 1.2.840.113549.1.9.1=#16166b656c6c6e6572704065617274686c696e6b2e6e6574,CN=45.x.x.x,O=xx,L=xxx,ST=xx,C=xx
subjectAltNames: []
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:334)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
at okhttp3.RealCall.execute(RealCall.java:93)
at com.nextcloud.common.OkHttpMethodBase.execute(OkHttpMethodBase.kt:126)
at com.nextcloud.common.NextcloudClient.execute(NextcloudClient.kt:67)
at com.owncloud.android.lib.resources.activities.GetActivitiesRemoteOperation.run(GetActivitiesRemoteOperation.java:131)
at com.nextcloud.common.NextcloudClient.execute(NextcloudClient.kt:63)
at com.owncloud.android.ui.fragment.FileDetailActivitiesFragment.lambda$fetchAndSetData$5$FileDetailActivitiesFragment(FileDetailActivitiesFragment.java:331)
at com.owncloud.android.ui.fragment.-$$Lambda$FileDetailActivitiesFragment$N7POe6TZvoGcuV2qP-niPxY_7t4.run(lambda)
at java.lang.Thread.run(Thread.java:818)

*** APP INFORMATION ***
ID: com.nextcloud.client
Version: 30100090
Build flavor: gplay

*** DEVICE INFORMATION ***
Brand: samsung
Device: tre3calteskt
Model: SM-N916S
Id: MMB29K
Product: tre3calteskt

*** FIRMWARE ***
SDK: 23
Release: 6.0.1
Incremental: N916SKSU2DSA1

Sent from my Samsung device
NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate

bug

All 14 comments

Nextcloud server has no domain name, only ip address with snakeoil certificate.
Pdf file was downloaded and could be read. But not initially by app.

I have the same problem, not only PDF but other files as well (odt, doc for example). And sometimes it only happens the first time I try to download/open a file, when I restart the client and try to open the same file everything works OK.

Here is my log:

`*** CAUSE OF ERROR ***

javax.net.ssl.SSLPeerUnverifiedException: Hostname www.sever.lan not verified:
certificate: sha256/8rVpiCZXpVMIfGLFWCMdA5VYGvzX/ZS3DoPf9Bmo7Ac=
DN: 1.2.840.113549.1.9.1=#160e726f6f744073657665722e6c616e,CN=www.sever.lan,OU=Sever Web Server,O=AVAL d.o.o.,ST=Slovenia,C=SI
subjectAltNames: []
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:334)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
at okhttp3.RealCall.execute(RealCall.java:93)
at com.nextcloud.common.OkHttpMethodBase.execute(OkHttpMethodBase.kt:126)
at com.nextcloud.common.NextcloudClient.execute(NextcloudClient.kt:67)
at com.owncloud.android.lib.resources.activities.GetActivitiesRemoteOperation.run(GetActivitiesRemoteOperation.java:131)
at com.nextcloud.common.NextcloudClient.execute(NextcloudClient.kt:63)
at com.owncloud.android.ui.fragment.FileDetailActivitiesFragment.lambda$fetchAndSetData$5$FileDetailActivitiesFragment(FileDetailActivitiesFragment.java:331)
at com.owncloud.android.ui.fragment.-$$Lambda$FileDetailActivitiesFragment$N7POe6TZvoGcuV2qP-niPxY_7t4.run(lambda)
at java.lang.Thread.run(Thread.java:818)

*** APP INFORMATION ***
ID: com.nextcloud.client
Version: 30100053
Build flavor: generic

*** DEVICE INFORMATION ***
Brand: Android
Device: espressowifi
Model: Galaxy Tab 2
Id: MOI10E
Product: espresso10wifixx

*** FIRMWARE ***
SDK: 23
Release: 6.0.1
Incremental: eng.andi.20190729.140516
`

I also noticed that this only happens when using the client with my local/internal NC server (signed with my own CA). Using the client with Disroot.org for example does not produce such errors.

Just to add another observation. This problem only occurs if I tap on the file I want to open. If on the other hand I tap on the 3 dot menu and choose "Download", the file is downloaded without errors and I can than open it normally.

Cc @tobiasKaminsky and @ezaquarii for okhttp topic

Avalx. The behavior you mentioned has happened frequently, but the crashing and error report is new. Not just pdf, but videos.

Also text files cause this error until they have time to download.

Is this with self-signed certs?

I am using self signed certs. It is a private storage without domain name.
Nextcloud has always choked when trying to play or display anything forever. Only recently have these error dumps showed up.

I have the same issue as otherwise reported on my own server https://sco.popho.be (TLS 1.3 only, Let's Encrypt certificate, nginx). Crash report below.

************ CAUSE OF ERROR ************

javax.net.ssl.SSLHandshakeException: Handshake failed
    at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(:com.google.android.gms@[email protected] (120400-288960190):38)
    at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:320)
    at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
    at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
    at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
    at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
    at okhttp3.RealCall.execute(RealCall.java:93)
    at com.nextcloud.common.OkHttpMethodBase.execute(OkHttpMethodBase.kt:126)
    at com.nextcloud.common.NextcloudClient.execute(NextcloudClient.kt:67)
    at com.owncloud.android.lib.resources.activities.GetActivitiesRemoteOperation.run(GetActivitiesRemoteOperation.java:131)
    at com.nextcloud.common.NextcloudClient.execute(NextcloudClient.kt:63)
    at com.owncloud.android.ui.fragment.FileDetailActivitiesFragment.lambda$fetchAndSetData$5$FileDetailActivitiesFragment(FileDetailActivitiesFragment.java:331)
    at com.owncloud.android.ui.fragment.-$$Lambda$FileDetailActivitiesFragment$N7POe6TZvoGcuV2qP-niPxY_7t4.run(Unknown Source:12)
    at java.lang.Thread.run(Thread.java:919)
Caused by: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x730a93b488: Failure in SSL library, usually a protocol error
error:1000042e:SSL routines:OPENSSL_internal:TLSV1_ALERT_PROTOCOL_VERSION (third_party/openssl/boringssl/src/ssl/tls_record.cc:592 0x730a81b808:0x00000001)
    at com.google.android.gms.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
    at com.google.android.gms.org.conscrypt.NativeSsl.doHandshake(:com.google.android.gms@[email protected] (120400-288960190):6)
    at com.google.android.gms.org.conscrypt.ConscryptFileDescriptorSocket.startHandshake(:com.google.android.gms@[email protected] (120400-288960190):14)
    ... 26 more

************ APP INFORMATION ************
ID: com.nextcloud.client
Version: 30100090
Build flavor: gplay

************ DEVICE INFORMATION ************
Brand: Nokia
Device: B2N_sprout
Model: Nokia 7 plus
Id: QKQ1.190828.002
Product: Onyx_00WW

************ FIRMWARE ************
SDK: 29
Release: 10
Incremental: 00WW_4_10D

I have had this happen frequently since I first reported it. If I can download the file first then the error generally doesn't occur. Never had this problem with Dropbox. It streams anything streamable without complaint.

If this could stay open until the 3.10.2 client is published, it'd be better IMHO.

BTW, the crash still happens on 3.10.1 (not surprising considering all the latest commits were done on 2020-02-07 when 3.10.1 was published on 2020-02-05).

Can you try out our dev version (you can install it in parallel) and give us feedback:
https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#developement-release

In my case the version 3.10.1 also works OK - pdf and other files as well.

@tobiasKaminsky the 20200211 version of the dev app seems to behave correctly!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JSoko picture JSoko  路  3Comments

tobiasKaminsky picture tobiasKaminsky  路  3Comments

toobie83 picture toobie83  路  3Comments

tobiasKaminsky picture tobiasKaminsky  路  3Comments

rainer042 picture rainer042  路  3Comments