NDAR / nda-tools

Python package for interacting with NDA web services. Used to validate, submit, and download data to and from NDA.
MIT License
47 stars 22 forks source link

downloadcmd not working properly, generates several errors when trying to log in #58

Closed rjacksonrqr closed 7 months ago

rjacksonrqr commented 1 year ago

Seeing the issues below when trying to run downloadcmd

Enter your NIMH Data Archives username: Traceback (most recent call last):   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/util.py", line 48, in send_and_get_reply     raise DBusErrorResponse(resp_msg) jeepney.wrappers.DBusErrorResponse: [org.freedesktop.DBus.Error.UnknownMethod] ("No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/secrets/collection/login",)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/collection.py", line 177, in get_default_collection     return Collection(connection)   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/collection.py", line 45, in init     self._collection.get_property('Label')   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/util.py", line 67, in get_property     (signature, value), = self.send_and_get_reply(msg)   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/util.py", line 52, in send_and_get_reply     raise ItemNotFoundException('Item does not exist!') from resp secretstorage.exceptions.ItemNotFoundException: Item does not exist!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):   File "/software/nda-tools/0.2.21-py-3.8/keyring/backends/SecretService.py", line 61, in get_preferred_collection     collection = secretstorage.get_default_collection(bus)   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/collection.py", line 179, in get_default_collection     return create_collection(connection, 'Default', 'default', session)   File "/software/nda-tools/0.2.21-py-3.8/secretstorage/collection.py", line 159, in create_collection     raise PromptDismissedException('Prompt dismissed.') secretstorage.exceptions.PromptDismissedException: Prompt dismissed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):   File "/software/nda-tools/0.2.21-py-3.8/bin/downloadcmd", line 8, in     sys.exit(main())   File "/software/nda-tools/0.2.21-py-3.8/NDATools/clientscripts/downloadcmd.py", line 182, in main     config = configure(args)   File "/software/nda-tools/0.2.21-py-3.8/NDATools/clientscripts/downloadcmd.py", line 172, in configure     config.read_user_credentials()   File "/software/nda-tools/0.2.21-py-3.8/NDATools/Configuration.py", line 162, in read_user_credentials     self.password = keyring.get_password(self.SERVICE_NAME, self.username)   File "/software/nda-tools/0.2.21-py-3.8/keyring/core.py", line 55, in get_password     return get_keyring().get_password(service_name, username)   File "/software/nda-tools/0.2.21-py-3.8/keyring/backends/SecretService.py", line 78, in get_password     collection = self.get_preferred_collection()   File "/software/nda-tools/0.2.21-py-3.8/keyring/backends/SecretService.py", line 63, in get_preferred_collection     raise InitError("Failed to create the collection: %s." % e) keyring.errors.InitError: Failed to create the collection: Prompt dismissed..

gregmagdits commented 1 year ago

This seems to be related to the keyring setup. You can try disabling the keyring functionality altogether by running export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring (from https://pypi.org/project/keyring/)

If you disable the keyring, the downloadcmd should ask for your credentials each time you run it, but it should work.

rjacksonrqr commented 1 year ago

Greg,

Thank you for the response. Quick question, with run the command listed below, would that be to permanently disable the keyring or would that only be per session?

I was looking to set this up as part of module load, or is it not required after running the export once?

Regards,

Rich Jackson Linux Analyst Direct: 281-990-3130

eXcellence in IS Solutions, Inc. (X-ISS)http://x-iss.com/ Making HPC Work for You

From: gregmagdits @.> Sent: Wednesday, December 21, 2022 11:30 AM To: NDAR/nda-tools @.> Cc: Richard Jackson @.>; Author @.> Subject: Re: [NDAR/nda-tools] downloadcmd not working properly, generates several errors when trying to log in (Issue #58)

This seems to be related to the keyring setup. You can try disabling the keyring functionality altogether by running export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring (from https://pypi.org/project/keyring/)

If you disable the keyring, the downloadcmd should ask for your credentials each time you run it, but it should work.

— Reply to this email directly, view it on GitHubhttps://github.com/NDAR/nda-tools/issues/58#issuecomment-1361714071, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A44GWY73L5726UZTNP7BPBLWOM5AXANCNFSM6AAAAAATFBSW7E. You are receiving this because you authored the thread.Message ID: @.***>

gregmagdits commented 1 year ago

It should disable it for the session, unless you set the environment variable permanently, by setting it in the .bashrc or via some other mechanism.