GNU bug report logs - #77596
Emacs 30.1 secrets.el: Session not automatically re-established after Secret Service restart

Previous Next

Package: emacs;

Reported by: spam <dont.post.me <at> protonmail.com>

Date: Mon, 7 Apr 2025 05:00:03 UTC

Severity: normal

Tags: notabug

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77596 in the body.
You can then email your comments to 77596 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77596; Package emacs. (Mon, 07 Apr 2025 05:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to spam <dont.post.me <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 07 Apr 2025 05:00:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: spam <dont.post.me <at> protonmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: Emacs 30.1 secrets.el: Session not automatically re-established after
 Secret Service restart
Date: Sat, 05 Apr 2025 19:55:25 +0000
[Message part 1 (text/plain, inline)]
$ emacs -Q

(require 'secrets nil t)

(secrets-get-secret "Richie" "emacs auth source for org crypt")

"this work's because i had keepassxc open before emacs"

if i restart keepassxc and try again then i get a backtrace

Debugger entered--Lisp error: (dbus-error "org.freedesktop.Secret.Error.NoSession")

signal(dbus-error ("org.freedesktop.Secret.Error.NoSession"))

dbus-call-method(:session "org.freedesktop.secrets" "/org/freedesktop/secrets/collection/Richie/b25f5d1a9106417492657a0eae1db782" "org.freedesktop.Secret.Item" "GetSecret" :object-path "/")

secrets-get-secret("Richie" "emacs auth source for org crypt")

(progn (defvar my/ediff-pairs) (defvar my/video-file-regex) (defvar org-planfile) (defvar my/yogadora) (defvar my/yogabuntu) (defvar my/rakmac) (defvar my/oplmac) (defvar my/duckbookpro) (defvar my/yogadows) (secrets-get-secret "Richie" "emacs auth source for org crypt"))

eval((progn (defvar my/ediff-pairs) (defvar my/video-file-regex) (defvar org-planfile) (defvar my/yogadora) (defvar my/yogabuntu) (defvar my/rakmac) (defvar my/oplmac) (defvar my/duckbookpro) (defvar my/yogadows) (secrets-get-secret "Richie" "emacs auth source for org crypt")) t)

elisp--eval-last-sexp(nil)

#f(compiled-function () #<bytecode 0x298d38e0b8462>)()

handler-bind-1(#f(compiled-function () #<bytecode 0x298d38e0b8462>) (error) eval-expression--debug)

eval-last-sexp(nil)

funcall-interactively(eval-last-sexp nil)

call-interactively(eval-last-sexp nil nil)

command-execute(eval-last-sexp)

the session isn't refreshed. it's stale.

In GNU Emacs 30.1 (build 4, x86_64-pc-linux-gnu, GTK+ Version 3.24.43,

cairo version 1.18.2) of 2025-04-05 built on fedora

Repository revision: 8ac894e2246f25d2a2a97d866b10e6e0b0fede5a

Repository branch: HEAD

System Description: Fedora Linux 41 (Workstation Edition)

Configured using:

'configure --with-x-toolkit=no --with-mailutils

--with-native-compilation --without-x --with-gnutls --with-threads

--with-modules --with-zlib --with-tree-sitter --with-sqlite3

--with-pgtk --with-rsvg'

Configured features:

CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG

LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER

PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS

TREE_SITTER WEBP XIM GTK3 ZLIB

Important settings:

value of $LANG: en_US.UTF-8

value of $XMODIFIERS: @im=ibus

locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:

tooltip-mode: t

global-eldoc-mode: t

eldoc-mode: t

show-paren-mode: t

electric-indent-mode: t

mouse-wheel-mode: t

tool-bar-mode: t

menu-bar-mode: t

file-name-shadow-mode: t

global-font-lock-mode: t

font-lock-mode: t

blink-cursor-mode: t

minibuffer-regexp-mode: t

line-number-mode: t

indent-tabs-mode: t

transient-mark-mode: t

auto-composition-mode: t

auto-encryption-mode: t

auto-compression-mode: t

Load-path shadows:

None found.

Features:

(shadow sort mail-extr emacsbug message mailcap yank-media puny dired

dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068

epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse

rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045

ietf-drums mm-util mail-prsvr mail-utils help-fns radix-tree cl-print

byte-opt gv debug backtrace help-mode find-func compile

text-property-search comint ansi-osc ansi-color ring comp-run bytecomp

byte-compile comp-common rx display-line-numbers secrets dbus xml subr-x

vc-git diff-mode track-changes easy-mmode vc-dispatcher cl-loaddefs

cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify

ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win

pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset

image regexp-opt fringe tabulated-list replace newcomment text-mode

lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch

easymenu timer select scroll-bar mouse jit-lock font-lock syntax

font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic

indonesian philippine cham georgian utf-8-lang misc-lang vietnamese

tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek

romanian slovak czech european ethiopic indian cyrillic chinese

composite emoji-zwj charscript charprop case-table epa-hook

jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs

theme-loaddefs faces cus-face macroexp files window text-properties

overlay sha1 md5 base64 format env code-pages mule custom widget keymap

hashtable-print-readable backquote threads dbusbind inotify

dynamic-setting system-font-setting font-render-setting cairo gtk pgtk

multi-tty move-toolbar make-network-process native-compile emacs)

Memory information:

((conses 16 110808 9473) (symbols 48 8237 0) (strings 32 29262 1738)

(string-bytes 1 879652) (vectors 16 17821)

(vector-slots 8 214459 9445) (floats 8 47 668) (intervals 56 987 15)

(buffers 992 16))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77596; Package emacs. (Mon, 07 Apr 2025 11:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 77596 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: spam <dont.post.me <at> protonmail.com>
Cc: 77596 <at> debbugs.gnu.org
Subject: Re: bug#77596: Emacs 30.1 secrets.el: Session not automatically
 re-established after Secret Service restart
Date: Mon, 07 Apr 2025 13:05:45 +0200
spam <dont.post.me <at> protonmail.com> writes:

Hi,

> $ emacs -Q
>
> (require 'secrets nil t)
>
> (secrets-get-secret "Richie" "emacs auth source for org crypt")
>
> "this work's because i had keepassxc open before emacs"
>
> if i restart keepassxc and try again then i get a backtrace
>
> Debugger entered--Lisp error: (dbus-error "org.freedesktop.Secret.Error.NoSession")
>   signal(dbus-error ("org.freedesktop.Secret.Error.NoSession"))
>   dbus-call-method(:session "org.freedesktop.secrets" "/org/freedesktop/secrets/collection/Richie/b25f5d1a9106417492657a0eae1db782" "org.freedesktop.Secret.Item" "GetSecret" :object-path "/")
>   secrets-get-secret("Richie" "emacs auth source for org crypt")
>   (progn (defvar my/ediff-pairs) (defvar my/video-file-regex) (defvar org-planfile) (defvar my/yogadora) (defvar my/yogabuntu) (defvar my/rakmac) (defvar my/oplmac) (defvar my/duckbookpro) (defvar my/yogadows) (secrets-get-secret "Richie" "emacs auth source for org crypt"))
>   eval((progn (defvar my/ediff-pairs) (defvar my/video-file-regex) (defvar org-planfile) (defvar my/yogadora) (defvar my/yogabuntu) (defvar my/rakmac) (defvar my/oplmac) (defvar my/duckbookpro) (defvar my/yogadows) (secrets-get-secret "Richie" "emacs auth source for org crypt")) t)
>   elisp--eval-last-sexp(nil)
>   #f(compiled-function () #<bytecode 0x298d38e0b8462>)()
>   handler-bind-1(#f(compiled-function () #<bytecode 0x298d38e0b8462>) (error) eval-expression--debug)
>   eval-last-sexp(nil)
>   funcall-interactively(eval-last-sexp nil)
>   call-interactively(eval-last-sexp nil nil)
>   command-execute(eval-last-sexp)
>
> the session isn't refreshed. it's stale.

Does it help to re-evaluate secrets.el? Something like

--8<---------------cut here---------------start------------->8---
M-x load-library RET secrets RET
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77596; Package emacs. (Wed, 09 Apr 2025 11:33:02 GMT) Full text and rfc822 format available.

Message #11 received at 77596 <at> debbugs.gnu.org (full text, mbox):

From: spam <dont.post.me <at> protonmail.com>
To: "77596 <at> debbugs.gnu.org" <77596 <at> debbugs.gnu.org>
Subject: RE: Michael
Date: Wed, 09 Apr 2025 11:32:42 +0000
[Message part 1 (text/plain, inline)]
Hey Michael,
Yea, if I M-x load-library RET secrets RET​ then it starts working again.

I know there's also (secrets-open-session t)​ which makes it start working again but that's not what you asked about.
Thanks!
[Message part 2 (text/html, inline)]

Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Wed, 09 Apr 2025 16:48:02 GMT) Full text and rfc822 format available.

Notification sent to spam <dont.post.me <at> protonmail.com>:
bug acknowledged by developer. (Wed, 09 Apr 2025 16:48:02 GMT) Full text and rfc822 format available.

Message #16 received at 77596-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: "77596 <at> debbugs.gnu.org" <77596-done <at> debbugs.gnu.org>
Cc: spam <dont.post.me <at> protonmail.com>
Subject: Re: bug#77596: Michael
Date: Wed, 09 Apr 2025 18:47:22 +0200
spam via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

> Hey Michael,

Hi,

> Yea, if I M-x load-library RET secrets RET​ then it starts working
> again.
> I know there's also (secrets-open-session t)​ which makes it start
> working again but that's not what you asked about.

Reloading secrets.el calls secrets-open-session internally, AND resets
some internal variables. So it looks safer to me.

So we don't need to do anything, I guess. Closing the bug.

> Thanks!

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77596; Package emacs. (Wed, 09 Apr 2025 16:52:02 GMT) Full text and rfc822 format available.

Message #19 received at 77596-done <at> debbugs.gnu.org (full text, mbox):

From: spam <dont.post.me <at> protonmail.com>
To: "77596 <at> debbugs.gnu.org" <77596-done <at> debbugs.gnu.org>
Subject: RE: it's not a bug
Date: Wed, 09 Apr 2025 16:51:28 +0000
[Message part 1 (text/plain, inline)]
Sorry if it sounds like I have a bad attitude but I want to understand. Are you saying that it's not a bug that it fails to get a secret if the secret service is restarted? Maybe I'm misunderstanding the issue.
[Message part 2 (text/html, inline)]

Added tag(s) notabug. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Wed, 09 Apr 2025 16:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77596; Package emacs. (Thu, 10 Apr 2025 06:21:01 GMT) Full text and rfc822 format available.

Message #24 received at 77596 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: "77596 <at> debbugs.gnu.org" <77596 <at> debbugs.gnu.org>
Cc: spam <dont.post.me <at> protonmail.com>
Subject: Re: bug#77596: it's not a bug
Date: Thu, 10 Apr 2025 08:20:44 +0200
spam via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:

Hi,

> Sorry if it sounds like I have a bad attitude but I want to
> understand. Are you saying that it's not a bug that it fails to get a
> secret if the secret service is restarted? Maybe I'm misunderstanding
> the issue.

Yes, it is not a bug. secrets.el is not designed to reestablish a
connection. If we want this, it is rather a feature request.

Don't know whether this is worth the work, since the fix is so simple.

Best regards, Michael.

PS: Since you don't Cc me, please don't change the initial
subject. Otherwise, it is likely I miss your reply. I don't read all
messages in the <bug-gnu-emacs <at> gnu.org> ML.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 08 May 2025 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.