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

Poetry's keyring bug causes Clearml remote execution to fail #146

Open
prassanna-ravishankar opened this issue Mar 16, 2023 · 2 comments
Open

Comments

@prassanna-ravishankar
Copy link

prassanna-ravishankar commented Mar 16, 2023

  • Installing six (1.16.0)

1678971772308 xyz DEBUG 
  DBusErrorResponse

  [org.freedesktop.DBus.Error.UnknownMethod] ('No such interface “org.freedesktop.DBus.Properties” on object at path /org/freedesktop/secrets/collection/login',)

  at ~/.pyenv/versions/3.7.16/envs/clearml_ops/lib/python3.7/site-packages/secretstorage/util.py:48 in send_and_get_reply
       44│     def send_and_get_reply(self, msg: Message) -> Any:
       45│         try:
       46│             resp_msg: Message = self._connection.send_and_get_reply(msg)
       47│             if resp_msg.header.message_type == MessageType.error:
    →  48│                 raise DBusErrorResponse(resp_msg)
       49│             return resp_msg.body
       50│         except DBusErrorResponse as resp:
       51│             if resp.name in (DBUS_UNKNOWN_METHOD, DBUS_NO_SUCH_OBJECT):
       52│                 raise ItemNotFoundException('Item does not exist!') from resp

The following error occurred when trying to handle this error:


  ItemNotFoundException

  Item does not exist!

  at ~/.pyenv/versions/3.7.16/envs/clearml_ops/lib/python3.7/site-packages/secretstorage/util.py:52 in send_and_get_reply
       48│                 raise DBusErrorResponse(resp_msg)
       49│             return resp_msg.body
       50│         except DBusErrorResponse as resp:
       51│             if resp.name in (DBUS_UNKNOWN_METHOD, DBUS_NO_SUCH_OBJECT):
    →  52│                 raise ItemNotFoundException('Item does not exist!') from resp
       53│             elif resp.name in (DBUS_SERVICE_UNKNOWN, DBUS_EXEC_FAILED,
       54│                                DBUS_NO_REPLY):
       55│                 data = resp.data
       56│                 if isinstance(data, tuple):

The following error occurred when trying to handle this error:


  PromptDismissedException

  Prompt dismissed.

  at ~/.pyenv/versions/3.7.16/envs/clearml_ops/lib/python3.7/site-packages/secretstorage/collection.py:159 in create_collection
      155│     if len(collection_path) > 1:
      156│         return Collection(connection, collection_path, session=session)
      157│     dismissed, result = exec_prompt(connection, prompt)
      158│     if dismissed:
    → 159│         raise PromptDismissedException('Prompt dismissed.')
      160│     signature, collection_path = result
      161│     assert signature == 'o'
      162│     return Collection(connection, collection_path, session=session)
      163│ 

The following error occurred when trying to handle this error:


  InitError

  Failed to create the collection: Prompt dismissed..

  at ~/.pyenv/versions/3.7.16/envs/clearml_ops/lib/python3.7/site-packages/keyring/backends/SecretService.py:63 in get_preferred_collection
       59│                 collection = secretstorage.Collection(bus, self.preferred_collection)
       60│             else:
       61│                 collection = secretstorage.get_default_collection(bus)
       62│         except exceptions.SecretStorageException as e:
    →  63│             raise InitError("Failed to create the collection: %s." % e)
       64│         if collection.is_locked():
       65│             collection.unlock()
       66│             if collection.is_locked():  # User dismissed the prompt
       67│                 raise KeyringLocked("Failed to unlock the collection!")

failed installing poetry requirements: Command '['poetry', 'install', '-n']' returned non-zero exit status 1.
Ignoring pip: markers 'python_version >= "3.10"' don't match your environment

Locally this can be fixed with export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring. Any workaround to get this working? python-poetry/poetry#5250 (comment)

@jkhenning
Copy link
Member

Hi @prassanna-ravishankar, I assume the issue is when running the task with an agent, is that correct?
If so, you can just set this env var in the agent's clearml.conf file by adding:

environment {
    PYTHON_KEYRING_BACKEND: "keyring.backends.null.Keyring"
}

@prassanna-ravishankar
Copy link
Author

Thanks!

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