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

Login not possible (This server uses a version below 1.0.38. Please Upgrade) #38

Closed
TomFernandes opened this issue Dec 2, 2017 · 8 comments

Comments

@TomFernandes
Copy link

Actual behaviour

When trying to log in with kandroid I get the German translation of "This server uses a version below 1.0.38. Please Upgrade" and the screen continues to stay at the login-screen.

Expected behaviour

Loging in should work.

Steps to reproduce

  • Install and configure Nginx on Debian jessie
  • Install Kanboard
  • Create User
  • Install kandroid
  • Enter credentials from above user in kandroid -> get Error message above

Configuration

  • Kandroid version: 0.5.7
  • Android/Mod version: Cyanogenmod Version 12-1-2016 based on Android 5.1.1
  • Theme (if you use one): -
  • Device type, name and manufacturer: Sony Experia Z1 Compact
  • Kanboard version: 1.1.0
  • Same behaviour on Galaxy S4 with LineageOS 14-1-2017 (Android 7.1.2). Everything else is the same

Things tested and observed

  • Loging in via Browser from the same device with the same credentias works
  • calling the API via curl from another system works
    curl -u foo:bar -d '{"jsonrpc": "2.0", "method": "getVersion", "id": 1}' https://example.com/kanboard/jsonrpc.php
    This yields to:
    1.2.3.4 - foo [02/Dec/2017:13:29:12 +0100] "POST /kanboard/jsonrpc.php HTTP/1.1" 200 658 "-" "curl/7.55.1"
    in Nginx and returns the requested data - a successfull login
  • When trying to login via kandroid I get two log entries in Nginx:
    1.2.3.4 - - [02/Dec/2017:13:34:32 +0100] "POST /kanboard/jsonrpc.php HTTP/1.1" 401 84 "-" "Dalvik/2.1.0 (Linux; U; Android 5.1.1; Xperia Z1 Compact Build/LMY49J)"
    and
    1.2.3.4 - foo [02/Dec/2017:13:34:32 +0100] "POST /kanboard/jsonrpc.php HTTP/1.1" 200 61 "-" "Dalvik/2.1.0 (Linux; U; Android 5.1.1; Xperia Z1 Compact Build/LMY49J)"
  • When running Nginx with debug-Loging to see the headers, I can see that the curl-Request sets an Authorization-Header.
  • I can also see, that in the first kandroid-request, this header is not present and the request receives a 401 as response. In the second kandroid-request the header is present though and it gets a 200 as a response. Still I get the mesage from the first paragraph.

Relevant Nginx Configuration

location /kanboard {
  root /var/www/;
  error_log /var/log/nginx/kandroid_debug.log debug;

  location ~ ^(.+?\.php)$ {
    try_files $1 =404;

    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$1;
    fastcgi_pass_header Authorization;
    fastcgi_param HTTPS on;
    fastcgi_pass php-handler;
  }
}
@tommapson
Copy link

Here's a server side workaound: Edit the define APP_VERSION in DOC_ROOT/kanboard/app/constants.php from
' (HEAD -> master, tag: v1.1.0, origin/master)', 'e2eec8b7e75223cb4499de10e005cdb9e153868a'
' (HEAD -> master, tag: v1.1.39, origin/master)', 'e2eec8b7e75223cb4499de10e005cdb9e153868a'

The actual bug seems to be in lines 242..244 of app/src/main/java/in/andres/kandroid/ui/LoginActivity.java (commit 985750b): The parts of the version are compared individually. Hence 1.1.0 seems to be less than 1.0.38. The condition ought to be something like v[0]>minV[0] || (v[0]==minV[0] && (v[1]>minV[1] || (v[1]==minV[1] && v[2]>=minV[2]))).

@TomFernandes
Copy link
Author

TomFernandes commented Dec 7, 2017

@tommapson the server side workaround works! :-) I'm able to login now. Thanks a lot!

This was referenced Jan 9, 2018
@richardneish
Copy link
Contributor

I have implemented the change to the version checking suggested by @tommapson and my local build is working with a 1.2.0 server now. See PR #40

@Jibec
Copy link

Jibec commented Jan 19, 2018

I hope we'll have it fix soon. Thanks for your work 👍

@FiSHYsolutions
Copy link

workaround for client v0.5.7 and server v1.2.0:
change (tag: v1.2.0) to (tag: v1.2.40) in app/constants.php line 36

@Jibec
Copy link

Jibec commented Jan 22, 2018 via email

@Jibec
Copy link

Jibec commented Mar 12, 2018

hi @andresth , here is a little bit of love to help for motivation ❤️
(yes, this is a kind remember to have a look at this issue, don't let this nice little project die. Two people submitted PR to fix this)

@amadeous
Copy link

amadeous commented Apr 2, 2018

Hello @andresth !
It's such a nice app you have here ! You did a great job ! If no one takes it back, it would probably die.. Some forks had already been made to fix this issue and it's becoming a mess of divergent repositories. Could you please add some of the people behind the forks you think valuable as collaborators ? They would be able to fix this and give you a hand with this project :)
That's the beauty of open source ! The possibility to share code and to help each other to develop greats tools !
Hope you're doing fine and that the reason of your absence is not causing you too much harm.

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

6 participants