wallabag / android-app

Android application to read your articles saved in your wallabag. You can also easily add new articles.
https://www.wallabag.org
GNU General Public License v3.0
483 stars 259 forks source link

"Autofill" credentials doesn't work #986

Closed brdobrdo closed 4 years ago

brdobrdo commented 4 years ago

Issue details

Duplicate?

Have you searched the issues of this repository if your issue is already known? yes

Actual behaviour

Steps to reproduce the issue

  1. Install wallabag 2.Setup connection

Environment details

Logs

wallabag server

Please paste relevant wallabag server logs here (from file <wallabag>/var/logs/prod.log):

Web server

Please paste relevant web server logs (e.g. from nginx, Apache, …) here:

NOTE: Be super sure to remove sensitive data like passwords, note that everybody can look here!

Your experience with wallabag Android app

Have you had any luck using wallabag Android app before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders) It worked like a charm. I love it! Don't break my heart now...

di72nn commented 4 years ago

I'm not sure why you got the "Couln't get API credentials" message (may be unrelated), but the 500 HTTP response indicates that the problem is with the server. Most likely, the app is uploading a URL that your server can't handle, so the synchronization fails and no articles are downloaded to the app.

You need to check your server log (wallabag's prod.log) for error details and fix it if possible.

(You need or beta for the following. Get it from releases or Google Play.) You can also check which URL the app is trying to send by going to Settings -> Miscellaneous -> Local changes and pressing "Dump to file", which creates a txt file that you can upload here.

brdobrdo commented 4 years ago

This is from the server log:

[2020-05-22 11:45:46] request.INFO: Matched route "api_get_tags". {"route":"api_get_tags","route_parameters":{"_controller":"Wallabag\ApiBundle\Controller\TagRestController::getTagsAction","_format":"json","_route":"api_get_tags"},"request_uri":"https://xxxxxxxxxxxxx.com/wallabag/web/api/tags.json","method":"GET"} [] [2020-05-22 11:45:46] app.ERROR: Authentication failure for user "", from IP "XXXXXXXXXXX", with UA: "okhttp/4.2.2". [] [] [2020-05-22 11:45:48] request.INFO: Matched route "api_get_entries". {"route":"api_get_entries","route_parameters":{"_controller":"Wallabag\ApiBundle\Controller\EntryRestController::getEntriesAction","_format":"json","_route":"api_get_entries"},"request_uri":"https://xxxxxxxxxxxx.com/wallabag/web/api/entries.json?order=asc&page=2&perPage=30&since=0&sort=created","method":"GET"} [] [2020-05-22 11:45:48] request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Types\ConversionException: "Could not convert database value "a:1:{i:0;s:26:"??‍..." to Doctrine Type array" at /home/xxxxxxxxxxx/public_html/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php line 46 {"exception":"[object] (Doctrine\DBAL\Types\ConversionException(code: 0): Could not convert database value \"a:1:{i:0;s:26:\"??‍...\" to Doctrine Type array at /home/xxxxxxxxxxx/public_html/wallabag/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ConversionException.php:46)"} []

brdobrdo commented 4 years ago

Can't find "Dump to file" anywhere.

di72nn commented 4 years ago

"Could not convert database value "a:1:{i:0;s:26:"??‍..." suggests that there is an article with an incorrect "author" value (the error doesn't say "author", but this field is the most likely candidate).

You can try to find the problem article by running the following query on your server:

select id, url, published_by from wallabag_entry where published_by like 'a:1:{i:0;s:26:%';

BTW, what database do you use?

Can't find "Dump to file" anywhere.

As I said, you need the beta version of the app. But it doesn't seem to be relevant to the error anymore.

brdobrdo commented 4 years ago

Thank you! I found the dump in the meanwhile.

I am using mysql, it is a share hosted domain. I don't have the access to the server.

What I don't get, how can wrong author disable autofill of api credentials? API credentials are the first thing that are not autofilled.

brdobrdo commented 4 years ago

Reinstall, new log:

[2020-05-22 12:17:02] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/fosjsrouting/js/router.js" (from "https://xxxxxxxxxx.com/wallabag/web/login")" at /home/xxxxxxxxxx/public_html/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 128 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/fosjsrouting/js/router.js\" (from \"https://xxxxxxxxxx.com/wallabag/web/login\") at /home/xxxxxxxxxx/public_html/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:128, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /home/xxxxxxxxxx/public_html/wallabag/var/cache/prod/appProdProjectContainerUrlMatcher.php:1012)"} []
[2020-05-22 12:17:10] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/fosjsrouting/js/router.js" (from "https://xxxxxxxxxx.com/wallabag/web/")" at /home/xxxxxxxxxx/public_html/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 128 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/fosjsrouting/js/router.js\" (from \"https://xxxxxxxxxx.com/wallabag/web/\") at /home/xxxxxxxxxx/public_html/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:128, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /home/xxxxxxxxxx/public_html/wallabag/var/cache/prod/appProdProjectContainerUrlMatcher.php:1012)"} []
[2020-05-22 12:19:19] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/fosjsrouting/js/router.js" (from "https://xxxxxxxxxx.com/wallabag/web/developer")" at /home/xxxxxxxxxx/public_html/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php line 128 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /bundles/fosjsrouting/js/router.js\" (from \"https://xxxxxxxxxx.com/wallabag/web/developer\") at /home/xxxxxxxxxx/public_html/wallabag/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php:128, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0):  at /home/xxxxxxxxxx/public_html/wallabag/var/cache/prod/appProdProjectContainerUrlMatcher.php:1012)"} []
di72nn commented 4 years ago

What I don't get, how can wrong author disable autofill of api credentials.

I don't think this is related. Maybe it's not even a problem anymore, I'm not sure what your current state is. What I see in the log is a server error that may cause HTTP 500 error in the app, so I try to deal with it first.

The log suggests that the problem article is somewhere in the range 30-60: that is, if you start counting from your oldest articles ("all entries", not just "unread"), somewhere after the 30th article and before the 60th there should be an article that has something wrong with its "author" field. I suggest you to open each article (in that range) in your web browser and check the field. I'm not sure what exactly to look for, but hopefully the problem value will be noticeable. If you find something, you may try to re-fetch the article or [temporarily] delete it.

The latest log doesn't have anything related to the problem.

brdobrdo commented 4 years ago

My current state is that I cannot login with the android app by providing username and password. The message I am receiving now is: No access to API: {"error":"access_denied","error_description":"OAuth2 autentication required"}. I will try to find faulty Autor as well...

brdobrdo commented 4 years ago

OK... I went through the articles. Deleted a couple that were fishy although I am not sure why. There are some whose content cannot be fetched but I guess those shouldn't cause problems.

brdobrdo commented 4 years ago

Manually filled in API credentials

Error

Server error wallabag.apiwrapper.exceptions.UnsuccessfulResponseException: HTTP response: 500 Stacktrace: wallabag.apiwrapper.exceptions.UnsuccessfulResponseException: HTTP response: 500 at wallabag.apiwrapper.WallabagService.checkResponse(WallabagService.java:1522) at wallabag.apiwrapper.WallabagService.checkResponseBody(WallabagService.java:1500) at wallabag.apiwrapper.WallabagService.execAndCheckBody(WallabagService.java:1496) at wallabag.apiwrapper.WallabagService.lambda$getArticles$0$WallabagService(WallabagService.java:215) at wallabag.apiwrapper.-$$Lambda$WallabagService$nylw3DAgOM4zumOAh8m95sasuhg.run(Unknown Source:4) at wallabag.apiwrapper.NotFoundPolicy.call(NotFoundPolicy.java:140) at wallabag.apiwrapper.NotFoundPolicy.call(NotFoundPolicy.java:133) at wallabag.apiwrapper.NotFoundPolicy.call(NotFoundPolicy.java:128) at wallabag.apiwrapper.WallabagService.getArticles(WallabagService.java:215) at wallabag.apiwrapper.ArticlesQueryBuilder.execute(ArticlesQueryBuilder.java:282) at wallabag.apiwrapper.ArticlesPageIterator.hasNext(ArticlesPageIterator.java:80) at fr.gaulupeau.apps.Poche.network.Updater.performUpdate(Updater.java:204) at fr.gaulupeau.apps.Poche.network.Updater.update(Updater.java:99) at fr.gaulupeau.apps.Poche.service.MainService.updateArticles(MainService.java:550) at fr.gaulupeau.apps.Poche.service.MainService.onHandleIntent(MainService.java:105) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:213) at android.os.HandlerThread.run(HandlerThread.java:67)

brdobrdo commented 4 years ago

Went to phpMyAdmin. Found the author "a:1:{i:0;s:26:"??‍..." and some others that were causing problems. Now android app can fetch articles from the server (and bag them as well like before) This is all with manually filled API credentials. API still doesn't autofill.

di72nn commented 4 years ago

Are there any "minification" modules (that optimize or rewrite web pages in any way) enabled on the web server? The wallabag Android app parses the HTML to get API credentials, so any unexpected differences may cause such problems.

Strubbl commented 4 years ago

Went to phpMyAdmin. Found the author "a:1:{i:0;s:26:"??‍..." and some others that were causing problems.

Can you reproduce the issue with the article which was causing the problem? If yes, it would be cool if you can open an issue at the server repository (https://github.com/wallabag/wallabag/)

brdobrdo commented 4 years ago

Are there any "minification" modules (that optimize or rewrite web pages in any way) enabled on the web server? The wallabag Android app parses the HTML to get API credentials, so any unexpected differences may cause such problems.

I am not sure what minification modules are.

This is shared hosting linux server I use to host my domain. Wallabag has it's own database, and folder inside public_html folder. In public_html are wordpress, tt-rss and nextcloud, all in their folders.

I can access wallabag when I go to domain.com/wallabag/web

Strubbl commented 4 years ago

If you access your wallabag, can you have a look at the HTML source code? It is minified if you have all text in one line. It is not minified if you have linebreaks in the HTML source code.

brdobrdo commented 4 years ago

It looks like a normal code.

di72nn commented 4 years ago

I guess it may also be caused by wallabag server being server from a subdirectory instead of its own sub-domain (but I'm pretty sure it worked before and IIRC the code wasn't changed in a while).

@brdobrdo can you gather Android logs while the setup via the connection wizard is being performed?

Alternatively you can create an empty account on your server and send me the credentials so I can debug the app myself.

brdobrdo commented 4 years ago

I guess it may also be caused by wallabag server being server from a subdirectory instead of its own sub-domain (but I'm pretty sure it worked before and IIRC the code wasn't changed in a while).

@brdobrdo can you gather Android logs while the setup via the connection wizard is being performed?

Alternatively you can create an empty account on your server and send me the credentials so I can debug the app myself.

Sorry... I am new to this. How and where do I create an empty account? And how do I send you a message?

di72nn commented 4 years ago

There's a "Users management" menu in the left bar (wallabag web; you need to be logged in as your main account/admin), there is a "create a new user" button in there.

You can send me an email to \ at gmail.com.

di72nn commented 4 years ago

@brdobrdo I received your email and I was able to reproduce the problem once, but haven't figured out what the problem is. I'll debug more later, so don't remove the test account yet.

di72nn commented 4 years ago

@brdobrdo you may delete the test user now. Thanks for reporting this, it allowed to find a rare (I think) bug, that could cause severe inconveniences for new users.

brdobrdo commented 4 years ago

Thank you!