DBusErrorResponse while running poetry install
Asked Answered
F

2

9

I tried to upgrade my poetry from 1.1.x version to 1.3 but as an official manual (https://python-poetry.org/docs/) recommends I removed the old version manually. Unfortunately I probably deleted wrong files because after installing 1.3 version I was still receiving errors that seemed sth was in conflict with old poetry. I tried to find all files in my account (it's a remote machine so I did not want to effect others) connected somehow with poetry (with find /home/username -name *poetry*) and (after uninstalling poetry 1.3) removed them. Then I installed poetry 1.3 back but still did not work. Also tried to delete my whole repo and clone it again, but same problems remains. I guess I pissed it off already, but hope that there is some way to some hard reset. Is there any way how to get from this?

Here is beginning of my error message:


Package operations: 28 installs, 0 updates, 0 removals

  • Installing certifi (2021.10.8)
  • Installing charset-normalizer (2.0.12)
  • Installing idna (3.3)
  • Installing six (1.16.0)
  • Installing typing-extensions (4.2.0)
  • Installing urllib3 (1.26.9)

  DBusErrorResponse

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

  at ~/.local/share/pypoetry/venv/lib/python3.10/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 ~/.local/share/pypoetry/venv/lib/python3.10/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 ~/.local/share/pypoetry/venv/lib/python3.10/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 ~/.local/share/pypoetry/venv/lib/python3.10/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!")


  DBusErrorResponse

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

  at ~/.local/share/pypoetry/venv/lib/python3.10/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 ~/.local/share/pypoetry/venv/lib/python3.10/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 ~/.local/share/pypoetry/venv/lib/python3.10/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│ 

Frothy answered 11/1, 2023 at 9:43 Comment(7)
You might find some clues in this answer.Adrienneadrift
I tried all your advises, but neither helped unfortunatelyFrothy
Do you know what is secretstorage and why your system tries to use it when running Poetry?Adrienneadrift
Because this is not a part of standard poetry process and first time I am seeing this.Adrienneadrift
I was not aware of secretstorage but it seems it is some helper package. But not sure for which package it is needed and it is not specified in my poetry.lock file (what is not problem when I tried on different PC that had not installed poetry 1.1 before)Frothy
I edited my error message - I added beginning of it into the question. Actually I found guy having the same error here but he was just refered here. There are some tips to set PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring, but I do not know where to do that and not able to ask there. I tried to add it to som config files but either that wasn't my case or I used wrong configs...Frothy
Even though setting the PYTHON_KEYRING_BACKEND is a good workaround, when the gnome keyring stops working, it might be worth figuring out why. Something as simple as a system update might solve the problem.Aquino
F
20

Finally I was able to find the answer here.

There are several ways to do that:

  1. Running export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring in shell will work for following poetry commands until you close (exit) your shell session

  2. Add environment variable for each! poetry command, for example PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring poetry install

  3. If you want to preserve (store) this environment variable between shell sessions or system reboot you can add it in .bashrc and .profile example for bash shell:

    echo 'export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring' >> ~/.bashrc

    echo 'export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring' >> ~/.profile exec "$SHELL"

for case number 3) you can now run any poetry command as usual, even after system restart

Frothy answered 12/1, 2023 at 15:29 Comment(0)
P
0

Not sure how robust that solution is, but upgrading Poetry fixed the issue for me:

poetry self update

Which led to

Package operations: 0 installs, 4 updates, 0 removals

  • Updating poetry-core (1.8.1 -> 1.9.0)
  • Updating cachecontrol (0.13.1 -> 0.14.0)
  • Updating pkginfo (1.9.6 -> 1.10.0)
  • Updating poetry (1.7.1 -> 1.8.3)
Predict answered 14/5, 2024 at 8:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.