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

Authentication not working #7

Closed
mjmayer opened this issue May 4, 2018 · 5 comments
Closed

Authentication not working #7

mjmayer opened this issue May 4, 2018 · 5 comments

Comments

@mjmayer
Copy link
Contributor

mjmayer commented May 4, 2018

I've been fighting authentication issues with the latest version of duplicati_client. I getting the error "Error getting salt from server", because the response from the requests.post is a 404. I'm not using basic auth. I've tried changing my password on duplicati to 1234, just in case one of special characters in my password were not getting escaped correctly. The problem has persisted.

        r = requests.post(baseurl, headers=headers, data=payload, verify=verify)
        if r.status_code != 200:
            common.log_output("Error getting salt from server", True, r.status_code)
            sys.exit(2)

Checking out out 1ef7646 resolves the issue.

HEAD is now at 1ef7646... added 'processed data' field to the get command to better display progress both in terms of number of processed files and in terms of how much data was actually processed
/duplicati_client # ./duplicati_client.py login
Loaded 2 parameters from file
Connecting to http://duplicati:8200...
Getting nonce and salt...
Hashing password...
Authenticating...
Connected
Code: 200
Login successful
/duplicati_client # git checkout master
Previous HEAD position was 1ef7646... added 'processed data' field to the get command to better display progress both in terms of number of processed files and in terms of how much data was actually processed
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
/duplicati_client # ./duplicati_client.py login
Loaded 2 parameters from file
Connecting to http://duplicati:8200...
Getting nonce and salt...
Error getting salt from server
Code: 404
@Pectojin
Copy link
Owner

What system is this running on, Python version, and the parameters provided?

I'm thinking it could be something related to the introduction of basic auth support right after 1ef7646, but I can't seem to replicate this on my system.

Are you able to reach http://duplicati:8200/login.cgi using for example cURL to make a post request?

# curl 'http://localhost:8200/login.cgi' --data 'get-nonce=1'

@mjmayer
Copy link
Contributor Author

mjmayer commented May 18, 2018

I'm running alpine linux 3.7.0 and python 3.6.3 .The only parameters I'm providing are in the parameters.yml file

password: secret-password
url: duplicati
verbose: True

Contents of config.yml

/ # cat ~/.config/duplicati-client/config.yml
authorization: ''
last_login: null
parameters_file: /root/.config/duplicati-client/parameters.yml
server:
  port: '8200'
  protocol: http
  url: duplicati
  verify: true
token: null
token_expires: 2018-05-18 19:33:20.212126
verbose: true
/ # duc version
Duplicati client version 0.3.9
/ # curl 'http://duplicati:8200/login.cgi' --data 'get-nonce=1'
{
  "Status": "OK",
  "Nonce": "2XVybvEdC1JDUvE+3/8BlIRdjQC+IlUt21nhu8CCHaA=",
  "Salt": "mwtVqXW0mHHUr7Tgy4Elz1t9x3JwwCtAmA5+oNHi8Qc="
/ # duc login
Loaded 3 parameters from file
Connecting to http://duplicati:8200...
Getting nonce and salt...
Error getting salt from server
Code: 404

@Pectojin
Copy link
Owner

Hmm, I have this replicated in a docker container running same alpine/python versions. Pretty odd it doesn't happen on Ubuntu 16.04/Python 3.6.3 or MacOS/Python 3.6.4. I'd expect Alpine to be more similar to Ubuntu than MacOS.

It's something I committed in 5b98a1c that's to blame, but I'll need to sit down tonight to figure out exactly what.

@Pectojin
Copy link
Owner

Pectojin commented May 20, 2018

Now I understand nothing. I came back to troubleshoot the issue now and I can no longer replicate it.

Still running Alpine 3.7.0 + Python 3.6.3 in a docker container against my 2.0.3.6_canary Duplicati server.

It would fail every time, when I tested 8 hours ago, but now it works every time. Regardless of what version I use and regardless of whether I connect directly or through Apache.

Edit: It's worth noting that the 404 error comes directly from the Duplicati server so maybe it's external from the client?? My first assumption was that the client was somehow sending a GET instead of POST to SERVER/login.cgi, which only works if it's a POST request, but if that was the issue then it would be consistent...

@mjmayer
Copy link
Contributor Author

mjmayer commented May 20, 2018 via email

@mjmayer mjmayer mentioned this issue Jun 14, 2018
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

2 participants