handyman5/acd_fuse

PyAmazonCloudDriveError: Not logined

Opened this issue · 35 comments

This was working just fine yesterday, now all of a sudden I cannot login / mount successfully. Tried on both my Arch and Ubuntu boxes. I removed my email, but I did check that it was correct. My password is also correct. Whats odd, is it seems to login just fine: Login successful; starting filesystem

Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Login successful; starting filesystem
Traceback (most recent call last):
  File "./acd", line 471, in <module>
    fs.main()
  File "./acd", line 90, in main
    self.download = self.api.can_device_download()
  File "/home/dh4/acd_fuse/pyacd/pyacd/api.py", line 134, in can_device_download
    raise pyacd.PyAmazonCloudDriveError("Not logined %s"%session)
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: [MY EMAIL], customer_id: None, agreed_with_terms: True>

Now I'm getting a plain login failed. When attempting to login on the amazon website, I am prompted with a captcha. Maybe this is whats causing the issue? Is the pyacd library not using the official API?
https://developer.amazon.com/public/apis/experience/cloud-drive/

Cached session failed; trying auth login
Traceback (most recent call last):
  File "./acd", line 470, in <module>
    fs.main()
  File "./acd", line 85, in main
    self.session = pyacd.login(self.email, self.password)
  File "/home/dh4/dev/acd_fuse/pyacd/pyacd/auth.py", line 73, in login
    raise pyacd.PyAmazonCloudDriveError("Login failed.")
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Login failed.

Same. I'm getting the same output after clearing cache. EOFError when trying with cache.

Traceback (most recent call last):
  File "acd", line 470, in <module>
    fs.main()
  File "acd", line 85, in main
    self.session = pyacd.login(self.email, self.password)
  File "/home/xxx/Downloads/acd_fuse-master/pyacd/auth.py", line 73, in login
    raise pyacd.PyAmazonCloudDriveError("Login failed.")
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Login failed.

  File "./acd", line 470, in <module>
    fs.main()
  File "./acd", line 73, in main
    session.__dict__ = pickle.load(sessfile)
  File "/usr/lib/python2.7/pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "/usr/lib/python2.7/pickle.py", line 858, in load
    dispatch[key](self)
  File "/usr/lib/python2.7/pickle.py", line 880, in load_eof
    raise EOFError
EOFError
cpare commented

Did this self-resolve, or is this an ongoing issue?

Ongoing issue while the dev is not around :)

mfoti commented

same error for me..

Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Traceback (most recent call last):
  File "./acd", line 470, in <module>
    fs.main()
  File "./acd", line 85, in main
    self.session = pyacd.login(self.email, self.password)
  File "/home/skler/acd_fuse/pyacd/pyacd/auth.py", line 73, in login
    raise pyacd.PyAmazonCloudDriveError("Login failed.")
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Login failed.
mfoti commented

I fixed creating a new account on one of the supported regions:

https://github.com/handyman5/pyamazonclouddrive-clone/blob/master/pyacd/__init__.py#L131

  ubidlist = {
    "www.amazon.com": "ubid-main",
    "www.amazon.co.jp": "ubid-acbjp",
    "www.amazon.de": "ubid-acbde"
  }

I am registred on amazon.com, but still have above issue. See traceback:

Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Login successful; starting filesystem
Traceback (most recent call last):
File "acd", line 470, in
fs.main()
File "acd", line 90, in main
self.download = self.api.can_device_download()
File "/home/bananapi/acd_fuse/pyacd/pyacd/api.py", line 134, in can_device_download
raise pyacd.PyAmazonCloudDriveError("Not logined %s"%session)
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: xxxxxx@xxxxxxx.xx, customer_id: None, agreed_with_terms: True>

I get this same error both on servers both in Germany and the US. My primary account is associated with the US. I tried adding the line of code @skler mentions to support amazon.de, but that didn't fix anything. Happy to provide any additional information that might be useful.

The same here
Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Login successful; starting filesystem
Traceback (most recent call last):
File "/usr/bin/acd", line 470, in
fs.main()
File "/usr/bin/acd", line 90, in main
self.download = self.api.can_device_download()
File "/home/kristjan/bin/acd_fuse/pyacd/pyacd/api.py", line 134, in can_device_download
raise pyacd.PyAmazonCloudDriveError("Not logined %s"%session)
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: ******@gmail.com, customer_id: None, agreed_with_terms: True>

Same here, might be dupe to #12

Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Traceback (most recent call last):
File "./acd", line 470, in
fs.main()
File "./acd", line 85, in main
self.session = pyacd.login(self.email, self.password)
File "/usr/local/src/acd_fuse/pyacd/pyacd/auth.py", line 73, in login
raise pyacd.PyAmazonCloudDriveError("Login failed.")
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Login failed.

Should we report to pyacd?

I thought I had already posted the comment. But the issue with the PyAmazonCloudDriveError("Not logined %s"%session) error seemed to have been related to Amazon serving up a captcha because of failed login's / too many locations attempting to access my account. I decided to stop playing with acd_fuse for a while in the mean time, and I currently do not have any of my servers setup to test, however I have a feeling it will work now that i'm not prompted by captchas when I login directly to Amazon.

Note that these failed logins where do to me having special characters in my password, to which I think i ether encapsulated my password in single quotes or just changed my password, I cannot remember as I use lastpass for password management.

Those of you receiving the PyAmazonCloudDriveError("Login failed.") probably have special characters in your password, or using an unsupported region. Try either of the steps I mentioned above.

I'll try to get around to testing this again in the next day or two, and report back.

I did notice the captchas are very basic and could be defeated with simple ocr software. I was able to use Tesseract, and it did return the correct captcha code with the samples I pulled from Amazon's login page. So if this becomes an issue, we can use it, or a python library to bypass it fairly easily.

@wayne-hartmann I do not believe that it is due to "too many locations". This error occurred to me the very first time I logged into my ACD account after setting it up initially. I also verified that my password has no special characters and encountered the same issue.

@davidgsharpe7 are you receiving the session error, or login failed error?

@davidgsharpe7 Also, can you confirm either way if you are prompted to enter a captcha when you login to ACD directly on Amazon?

To add a "me too" - I just set this package up, and I don't get a captcha when logging into cloud drive from a variety of locations (source IP's). But I am receiving the same error message described here.

Well taking a quick look at the code and the error message, the error does seem to be coming from pyacd, and not acd_fuse. Nothing stands out to me that there is a problem with the acd_fuse code. I'll take a quick look at the login function from pyacd and see if anything stands out.

You know what, try adding the following line to pyacd/connection.py after the other add_header line (line 71), and let me know if that fixes the login problem. I bet Amazon is doing a user agent check for urllib.

Make sure you use the correct tabs / spaces when editing the file (this is python)... ;-)

req.add_header("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1")

Unless of course i missed a user agent string being added elsewhere in the program...

Just added that suggestion (fixing the : with "," of course in the function) -- same result unfortunately

My specific output:

Login successful; starting filesystem
Traceback (most recent call last):
File "./acd", line 470, in
fs.main()
File "./acd", line 90, in main
self.download = self.api.can_device_download()
File "acd_fuse/pyacd/pyacd/api.py", line 134, in can_device_download
raise pyacd.PyAmazonCloudDriveError("Not logined %s"%session)
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: ********, customer_id: None, agreed_with_terms: True>

@shushry yeah, just noticed the mistake myself, and updated it... I don't have any more time to spend on this atm, but unless someone else comes up with a solution. I'll take another look later in the week.

@wayne-hartmann I am getting the error message that started this thread (not logined), and I do not get prompted for a captcha when logging in with a web browser to ACD. Adding the line you mentioned for the user-agent didn't fix my problem.

It used to work, but stopped a couple of days ago - from the web interface it works, no captcha being asked:

./mount.sh 
++ rm -f /tmp/acd_fuse/sessionfile
++ ./acd /home/xxx/CloudDrive/ -o email=xxx@xxx -o password=xxx
Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Login successful; starting filesystem
Traceback (most recent call last):
  File "./acd", line 470, in <module>
    fs.main()
  File "./acd", line 90, in main
    self.download = self.api.can_device_download()
  File "/home/xxx/projects/various/amazon/acd_fuse/pyacd/pyacd/api.py", line 134, in can_device_download
    raise pyacd.PyAmazonCloudDriveError("Not logined %s"%session)
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: xxx@xxx, customer_id: None, agreed_with_terms: True>
++ set +x

If you have some patch to try please let me know.

I am also getting the "not logined" error:

Trying to login from cached sessionfile /tmp/acd_fuse/sessionfile
Cached session failed; trying auth login
Login successful; starting filesystem
Traceback (most recent call last):
File "./acd", line 470, in
fs.main()
File "./acd", line 90, in main
self.download = self.api.can_device_download()
File "/home/mburgess/acd_fuse/pyacd/api.py", line 134, in can_device_download
raise pyacd.PyAmazonCloudDriveError("Not logined %s"%session)
pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: <user_redacted>@<domain_redacted>, customer_id: None, agreed_with_terms: True>

I've made a patch for pyacd and it resolves error from the first post. You can try to replace pyacd taking it from my repository fork: https://github.com/anton-veretenenko/pyamazonclouddrive-clone
Or just replace auth.py

@anton-veretenenko: I can confirm that it works now. I just replaced the pyacd with your pyamazonclouddrive-clone and that's it.

mv pyacd/ pyacd.ori
git clone https://github.com/anton-veretenenko/pyamazonclouddrive-clone.git pyacd

@anton-veretenenko: Auth confirmed. It works.

I can also confirm the patch by @anton-veretenenko fixed this issued.

Using the patch by @anton-veretenenko, still showing pyacd.exception.PyAmazonCloudDriveError: PyAmazonCloudDriveError: Not logined <Session: username: my@email.com, customer_id: None, agreed_with_terms: True>. Any ideas?

i am also still seeing this error, with and without the patch. Pw is right, can loginto the main site.

I've made another update. Should work again. Take a look anton-veretenenko/pyamazonclouddrive-clone@b4ad889
How to install an update: either replace pyacd taking it from my repository fork: https://github.com/anton-veretenenko/pyamazonclouddrive-clone or just replace auth.py

The patch is not working for me, but I figured out why. Everybody needs to make sure they don't have 2 factor on....
screenshot from 2016-03-16 14-22-35

(i got that with pdb, and dumped it to a file)