The problem is also described here.
When I type in the uri of the NextCloud-Server, I get the response Unknown error occurred!.
I expect to get to the next "page" of the app, to insert the username and password.
Android version: 8.1.0
Device model: Nexus 6P
Stock or customized system: Plain Andoid
Nextcloud app version: 3.0.3 and Dev-Version 20180419
Nextcloud server version: 12.0.6.1
X.X.X.X - - [23/Apr/2018:08:27:56 +0200] “cloud.oshahn.de1” “GET /status.php HTTP/1.1” 200 157 “-” “Mozilla/5.0 (Android) ownCloud-android/3.0.3”
respectively
X.X.X.X - - [23/Apr/2018:08:28:09 +0200] “cloud.oshahn.de1” “GET /status.php HTTP/1.1” 200 157 “-” “Mozilla/5.0 (Android) ownCloud-android/20180419”
I am sure, that there is only this one request.
Nothing is logged when trying to connect the app.
I upgraded the Server to nextcloud 13.0.1.1 and there is still the same behavior.
Hmm, I get an exception from the http client implementation:
04-24 12:06:21.485 3898-4046/com.nextcloud.client E/GetRemoteStatusOperation: Connection check at https://xxx: Unrecovered transport exception
java.io.IOException: Bad chunk size
@tobiasKaminsky @mario any ideas? Sounds like a server config issue.
What kind of web server do you use?
Apache? Nginx?
I created #2511 to at least show some more information in case of exceptions / unknown errors due to exceptions.
Unfortunately in this case the error message is not that helpful, but better than a generic error.
$ nginx -v
nginx version: nginx/1.10.3 (Ubuntu)
@nextcloud/server-triage I know that there was a similar issue back a while...
Here the idea was to have some basic nginx checking, as it seems that nginx is harder to configure / easier to break than apache: https://github.com/nextcloud/server/issues/8422
@nextcloud/server-triage I know that there was a similar issue back a while...
Here the idea was to have some basic nginx checking, as it seems that nginx is harder to configure / easier to break than apache: nextcloud/server#8422
I don't see any similar traces in this ticket and the one you linked. :/
I made sure, that my nginx configuration is the same as https://docs.nextcloud.com/server/13/admin_manual/installation/nginx.html
It is hard to believe, that the server is the problem. There is only one request to the server with statuscode 200.
Edit: My Server does currently not support http2. I don't know why or if this is related to this issue. I have to debug this further.
Ok. I found the problem. It was a misplaced white-space in the Strict-Transport-Security-Header:
before:
add_header Strict-Transport-Security "max-age=1209600
" always;
after:
add_header Strict-Transport-Security "max-age=1209600" always;
It seems, the nextcloud app is more strict with the headers then firefox or chome.
So it was not an error with the app after all. But maybe it is still a good idea to give a error message in this case.
@ostcar Thanks for feedback and glad you could get it resolved. I did open an issue due to your report: #2511 which will display the error message we get from the http library which is bad chunk size because that's what the http client detects but it'll at least provide some information which might help in this or other cases to further investigate. :+1:
I'll leave the issue open since it'll be auto-closed when the error message changes have been merged.
I added this to the server side ticket.
Maybe we can check this during setup / as warning for admins.
Meanwhile it would be good to check, if this is a client bug or if the e.g. firefox is just more error prone on this.
Well, if we consider it a client bug then it needs to be fixed _in_ the Apache http Lib...
A quick search gave me https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
An HTTP header consists of its case-insensitive name followed by a colon ':', then by its value (without line breaks). Leading white space before the value is ignored.
So I would assume that it is not allowed and therefore a configuration error, but it should be catched on server side.
PR has been merged for 3.2
Ok. I found the problem. It was a misplaced white-space in the
Strict-Transport-Security-Header:before:
add_header Strict-Transport-Security "max-age=1209600 " always;after:
add_header Strict-Transport-Security "max-age=1209600" always;It seems, the nextcloud app is more strict with the headers then firefox or chome.
So it was not an error with the app after all. But maybe it is still a good idea to give a error message in this case.
I have NextCloud installed in OMV which is on an Odroid HC2. I am getting the same error on Android. At first, it asks if I want to trust the certificate, but when I tap Yes, "Unknown HTTP error occurred!"
I don't understand your solution though. Can you explain further? What file do I need to edit? Is it on Android (I do have root) or is it on the NextCloud server? I would provide an error log, but I don't know how to do that either.
I have not so much knowledge about nextcloud. So I can not help you debug this. The error message "Unknown HTTP error occurred!" seems to be very often, so I am not sure, if you have the same problem that I did.
My solution was on the server in the nginx configuration. I added a newline between "max-age=1209600" and "always". The client could not handle this. After I removed the newline, every thing worked fine.
Most helpful comment
Ok. I found the problem. It was a misplaced white-space in the
Strict-Transport-Security-Header:before:
after:
It seems, the nextcloud app is more strict with the headers then firefox or chome.
So it was not an error with the app after all. But maybe it is still a good idea to give a error message in this case.