Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Fail Authorisation-related problems. Error code: 3 #291

Closed
menelic opened this issue Sep 11, 2016 · 12 comments
Closed

Android: Fail Authorisation-related problems. Error code: 3 #291

menelic opened this issue Sep 11, 2016 · 12 comments

Comments

@menelic
Copy link

menelic commented Sep 11, 2016

Hi, I have just installed V2 of your great app on my server (apache vps shared) via softaculous. Unfortunately I cannot connect with either the Android app or the ff extension. Manual addition of urls works though, as did the import from 1.x. I had a 1.x install that I used with the android app so I thought this might be related to #203 but wiping the database and reinstalling the app did not help.

I also looked at https://www.wallabag.org/pages/download-wallabag.html (softaculous tab) and the documentation but could not find any solution. Please advise - I d really like to use it again.

@di72nn
Copy link
Member

di72nn commented Sep 11, 2016

What error does "Test connection" return?

@menelic
Copy link
Author

menelic commented Sep 11, 2016

"Test connection" returns Fail Authorisation-related problems. Error code: 3

@di72nn
Copy link
Member

di72nn commented Sep 11, 2016

AFAIR, it is usually a redirect-related problem. Set wallabag URL as specific as possible (use https, if http gets redirected to https; don't use "www.example.com" if it gets redirected to "example.com" and visa versa).

@menelic
Copy link
Author

menelic commented Sep 15, 2016

Thanks for the quick reply. From the beginning, I had set the correct url, but tried it again withh https (which is correct in my setup) and without - it still does not work. Please advise.

@di72nn
Copy link
Member

di72nn commented Sep 15, 2016

Do you use a subdomain (wallabag.example.com) and/or subdirectory (example.com/wallabag)?

@menelic
Copy link
Author

menelic commented Sep 15, 2016

I m using a subdirectory (https://mydomain.com/wallabag ) I tried with and without a trailing /

@di72nn
Copy link
Member

di72nn commented Sep 15, 2016

Try adding /web at the end of the URL.

@menelic
Copy link
Author

menelic commented Sep 15, 2016

That did the trick - thanks a lot for your patient assistance, I really appreciate it. I can't remember having read this in the docs, so maybe it can be added. A simple solution to a showstopper problem. Thanks to all wallabag contributors - keep up the great work.

@di72nn
Copy link
Member

di72nn commented Sep 15, 2016

You are welcome.
One of the next client releases will be able to detect such problems.

@Strubbl, if I'm not mistaken you contribute to the documentation, right? If so, can you please note this case somewhere.

@di72nn di72nn closed this as completed Sep 15, 2016
@Strubbl
Copy link
Contributor

Strubbl commented Sep 15, 2016

No, i think documenting those things is not a good solution. (Nobody reads documentation for setting up an app. Try&error is the way to go.)

I am reopening this issue with the following proposal:
Maybe we can decline the number of those tickets here, if we implement some user-friendliness in the setup process. After di72nn's commit #282 has been merged, can we implement:

  • when test connection fails, try without trailing slash automatically, of course only if there is one URL with / at the end given by the user
  • when test connection fails, try with https if http was given by the user
  • when test connection fails, try the given URL with appended /web string again

If one of those mentioned alternatives succeeds, we should save the alternative improved URL as wallabag-URL in the settings automatically.

And if all those alternatives fail, we can return error code 3. With those alternative we catch the most common error cases in the setup process.

What do you think? Should we implement this kind of hidden helpers?

@Strubbl Strubbl reopened this Sep 15, 2016
@di72nn
Copy link
Member

di72nn commented Sep 15, 2016

Well, I actually implemented some logic in #282 that should cover all the cases you offered.

Here is a description of the logic:

  1. First of all we remove trailing slashes, since it is always added in the places of usage.
  2. Then we generate a list of possible URLs: the entered URL goes to the list; if a user did not specify protocol or specified HTTP, both HTTP and HTTPS variants go to the list.
    • For each URL in the list we also try to detect redirects like www.example.com -> example.com, example.com/wallabag -> example.com/wallabag/web, etc.. These redirects (if any) go to the list. At this point we can have at least one URL, at most 4 URLs (HTTP version, HTTPS version, HTTP version redirect, HTTPS version redirect) in the list.
  3. Then we iterate over the list contents and run a connection test for each URL.
  4. If there is a better working URL variant than the entered by the user, a dialog suggesting the better option appears. If all the options failed, we just show the traditional error message (except I got rid of the error codes in favor of better UX).

It covers all the case I could think of. The implementation is messy though.

You may try it in the Connection Wizard or in Settings in #282.

@Strubbl
Copy link
Contributor

Strubbl commented Sep 16, 2016

Okay, perfect, i did not know that. So we need to merge your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants