Skip to content

An unknown error occured when logging in #342

Closed

Description

@Gerii

Actual behaviour

App successfully connects to the server upon entering the address. But after inputting the right login credentials and clicking on Login an unknown error occurs.

Only happens on this device. Other devices (like Nexus 5, Jolla, BlackBerry Z30) connect successfully.
The client on the phone does work with an older ownCloud instance though.

Expected behaviour

Login succeeds.

Steps to reproduce

  1. Input server URL
  2. Input username & password
  3. Click on Login

Environment data

Android version: 6.0

Device model: LG G4

Stock or customized system: stock

Nextcloud app version: 1.3.1

Nextcloud server version: 10.0.1

Logs

Web server error log

no error happens on server side

Nextcloud log (data/nextcloud.log)

Logcat output:

10-16 16:42:44.277 31269-5692/? D/GetRemoteUserInfoOperation: Successful response: <!DOCTYPE html>
                                                              <html class="ng-csp" data-placeholder-focus="false" lang="en" >
                                                                <head data-user="username" data-user-displayname="username" data-requesttoken="token removed by me">
                                                                    <meta charset="utf-8">
                                                                    <title>
                                                                        Files - Cloud       </title>
                                                                    <meta http-equiv="X-UA-Compatible" content="IE=edge">
                                                                    <meta name="referrer" content="never">
                                                                    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
                                                                    <meta name="apple-itunes-app" content="app-id=1125420102">
                                                                    <meta name="apple-mobile-web-app-capable" content="yes">
                                                                    <meta name="apple-mobile-web-app-status-bar-style" content="black">
                                                                    <meta name="apple-mobile-web-app-title" content="ownCloud">
                                                                    <meta name="mobile-web-app-capable" content="yes">
                                                                    <meta name="theme-color" content="#102083">
                                                                    <link rel="icon" href="/owncloud/core/img/favicon.ico">
                                                                    <link rel="apple-touch-icon-precomposed" href="/owncloud/core/img/favicon-touch.png">
                                                                    <link rel="mask-icon" sizes="any" href="/owncloud/core/img/favicon-mask.svg" color="#0082c9">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/styles.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/inputs.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/header.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/icons.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/fonts.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/apps.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/global.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/fixes.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/multiselect.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/mobile.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/vendor/jquery-ui/themes/base/jquery-ui.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/jquery-ui-fixes.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/tooltip.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/share.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/files_versions/css/versions.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/audioplayer/css/3rdparty/fontello/css/fontello.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/audioplayer/css/style.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/files_pdfviewer/css/style.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/files_videoplayer/css/style.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/firstrunwizard/css/colorbox.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/firstrunwizard/css/firstrunwizard.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/gallery/css/slideshow.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/gallery/css/gallerybutton.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/core/css/jquery.ocdialog.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/files/css/files.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/files/css/upload.css?v=ddab49e9822f524c8df370e2da30677a">
                                                                                <link rel="stylesheet" href="/owncloud/apps/fi
10-16 16:42:44.280 31269-5692/? E/GetRemoteUserInfoOperation: Exception while getting OC user information
                                                              org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject
                                                                  at org.json.JSON.typeMismatch(JSON.java:111)
                                                                  at org.json.JSONObject.<init>(JSONObject.java:160)
                                                                  at org.json.JSONObject.<init>(JSONObject.java:173)
                                                                  at com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.run(GetRemoteUserInfoOperation.java:77)
                                                                  at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
                                                                  at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:84)
                                                                  at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:41)
                                                                  at android.os.AsyncTask$2.call(AsyncTask.java:295)
                                                                  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
                                                                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                                                                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                  at java.lang.Thread.run(Thread.java:818)

Activity

  1. derkostka commented on Oct 16, 2016

    @derkostka

    Same happens on Nexus 7 (2013). No Login possible ...

  2. AndyScherzinger commented on Oct 17, 2016

    @AndyScherzinger
    Member

    @derkostka do you see the same log entries?
    @Gerii do you use the same user/credentials on all the devices you mentioned or do they differ? What I can read from the log you provided is that while the client tried to read an expected JSON reply the server replied with a HTML webpage which leads to the error.

    @MorrisJobke @nickvergessen any idea what's happening here?
    cc @tobiasKaminsky

  3. nickvergessen commented on Oct 17, 2016

    @nickvergessen
    Member

    Seems like an exception page is being printed. Can you have a look at the nextcloud server log?

  4. Gerii commented on Oct 17, 2016

    @Gerii
    Author

    @AndyScherzinger The same account works on a different device. It seems to happen for every new account. So it's not device specific as I initially thought.
    @nickvergessen There is nothing which would hint at an error in the nextcloud.log on the server. (except a few entries where I mistyped the password of the test account I was using)

  5. Gerii commented on Oct 17, 2016

    @Gerii
    Author

    I looked through the Apache access logs and I think that's one of the failed login attempts:

    192.168.0.128 - username [16/Oct/2016:16:42:38 +0200] "HEAD /owncloud/remote.php/webdav/ HTTP/1.1" 200 1391 "-" "Mozilla/5.0 (Android) ownCloud-android/1.3.1"
    192.168.0.128 - username [16/Oct/2016:16:42:40 +0200] "GET /owncloud/index.php/ocs/cloud/user?format=json HTTP/1.1" 302 1502 "-" "Mozilla/5.0 (Android) ownCloud-android/1.3.1"
    192.168.0.128 - username [16/Oct/2016:16:42:42 +0200] "GET /owncloud/index.php/apps/files/ HTTP/1.1" 200 43617 "-" "Mozilla/5.0 (Android) ownCloud-android/1.3.1"
    

    There is a 302 in there, so that explains the HTML site. I don't have a clue why it does this though.

  6. changed the title [-]LG G4 - An unknown error occured when logging in[/-] [+]An unknown error occured when logging in[/+] on Oct 17, 2016
  7. derkostka commented on Oct 17, 2016

    @derkostka

    @AndyScherzinger same error-log for me (i just copy the last lines here, the rest is exactly the same as above)

    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: org.json.JSONException: Value (JSONObject.java:160)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at org.json.JSONObject.(JSONObject.java:173)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.run(GetRemoteUserInfoOperation.java:77)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:84)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:41)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at android.os.AsyncTask$2.call(AsyncTask.java:295)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
    10-17 22:30:12.947 9655 16874 E GetRemoteUserInfoOperation: at java.lang.Thread.run(Thread.java:818)

  8. nickvergessen commented on Oct 18, 2016

    @nickvergessen
    Member

    GET /owncloud/index.php/ocs/cloud/user?format=json

    This URL is wrong. The correct URL is ocs/v1.php/cloud/user?format=json and ocs/v2.php/cloud/user?format=json

    Can you check the redirects on your server?

  9. AndyScherzinger commented on Oct 18, 2016

    @AndyScherzinger
    Member

    @nickvergessen .... hmmm, the client library uses the one mentioned:
    https://github.com/nextcloud/android-library/blob/master/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java#L49

    --> private static final String OCS_ROUTE = "/index.php/ocs/cloud/user?format=json";

    which route would be save for Nextcloud and also let's say oC8.x? is it save to use v2?

  10. added
    needs infoWaiting for info from user(s). Issues with this label will auto-stale.
    on Oct 18, 2016
  11. AndyScherzinger commented on Oct 18, 2016

    @AndyScherzinger
    Member
  12. nickvergessen commented on Oct 18, 2016

    @nickvergessen
    Member

    ocs/v1.php/cloud/user?format=json is the route, since ever! index.php/ocs/ never worked (intended)

  13. AndyScherzinger commented on Oct 18, 2016

    @AndyScherzinger
    Member

    @nickvergessen perfect :) --> https://github.com/nextcloud/android-library/pull/21/files#diff-edcf6967567594420549a81338e02d99R49 - will have to wait for jitpack to do the build/publish to test drive this for @tobiasKaminsky to do the review then 😃

  14. AndyScherzinger commented on Oct 21, 2016

    @AndyScherzinger
    Member

    Hi @Gerii can you test our latest beta client release (can be installed in parallel to the regular app):
    https://f-droid.org/repository/browse/?fdfilter=com.nextcloud&fdid=com.nextcloud.android.beta

    It contains a fix for a login issue we found and which has been discussed in this issue, so this might solve your problem and will then also be integrated into the next regular/stable release 1.4.0

  15. Gerii commented on Oct 21, 2016

    @Gerii
    Author

    I have already tested it, it's working now. Thanks!

  16. 5 remaining items

  17. Fade78 commented on Feb 16, 2017

    @Fade78

    Hello,

    I tried the client on google play, I tried the client on F-droid (1.4.1) and the beta client on F-droid (20170214) and I still have the "unknown" error. I'm on a Galaxy S5 Android 4.4.2.

  18. tobiasKaminsky commented on Feb 17, 2017

    @tobiasKaminsky
    Member

    @Fade78 if you want you can write an email to android AT nextcloud DOT com with your server address and I will have a look, please refer to this issue.

  19. unalignedcoder commented on Mar 11, 2017

    @unalignedcoder

    Same problem here. I just downloaded the app today from GooglePlay. It crashes upon login. Not sure it even logs in, as the login screen just suddenly disappears. I only tested this with my Samsung Note 3 with Android 4.4.2. NextCloud installed on the server via Scriptaculous.

  20. unalignedcoder commented on Mar 26, 2017

    @unalignedcoder

    FYI... the last update 1.4.2 still has this problem. Funny thing, I can perfectly login and handle files via Solid Explorer.

  21. tobiasKaminsky commented on May 12, 2017

    @tobiasKaminsky
    Member

    @unalignedcoder can you write to android at nextcloud dot com and give us your server address with a dummy test account?

  22. eqyiel commented on Jun 12, 2017

    @eqyiel

    This is happening to me too, AFAICT these are the relevant lines from logcat:

    06-12 12:41:01.218 12318  6997 D OwnCloudClient #19: REQUEST GET /ocs/v1.php/cloud/user
    06-12 12:41:02.245 12318  6997 W HttpMethodBase: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
    06-12 12:41:02.248 12318  6997 D GetRemoteUserInfoOperation: Successful response: {"ocs":{"meta":{"status":"failure","statuscode":998,"message":"Invalid query, please check the syntax. API specifications are here: http:\/\/www.freedesktop.org\/wiki\/Specifications\/open-collaboration-services. DEBUG OUTPUT:\n"},"data":[]}}
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation: Exception while getting OC user information
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation: org.json.JSONException: Value [] at data of type org.json.JSONArray cannot be converted to JSONObject
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at org.json.JSON.typeMismatch(JSON.java:100)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at org.json.JSONObject.getJSONObject(JSONObject.java:613)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation.run(GetRemoteUserInfoOperation.java:79)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:136)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:84)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at com.owncloud.android.authentication.AuthenticatorAsyncTask.doInBackground(AuthenticatorAsyncTask.java:41)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at android.os.AsyncTask$2.call(AsyncTask.java:305)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
    06-12 12:41:02.260 12318  6997 E GetRemoteUserInfoOperation:    at java.lang.Thread.run(Thread.java:761)
    
  23. removed this from the Nextcloud App 1.4.0 milestone on Jun 12, 2017
  24. tobiasKaminsky commented on Jun 21, 2017

    @tobiasKaminsky
    Member

    @eqyiel can you create us a test account and mail it to android at nextcloud dot com with a reference to this issue?

  25. added
    needs infoWaiting for info from user(s). Issues with this label will auto-stale.
    on Jun 21, 2017
  26. eqyiel commented on Jun 25, 2017

    @eqyiel
  27. tobiasKaminsky commented on Jul 25, 2017

    @tobiasKaminsky
    Member

    @eqyiel
    According to my emails the problem was due to a missing endpoint and can be fixed on server side.
    If this bug is still valid, please re-open with more details.

  28. eqyiel commented on Jul 25, 2017

    @eqyiel

    @tobiasKaminsky Indeed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds infoWaiting for info from user(s). Issues with this label will auto-stale.priority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions