GNU bug report logs - #43047
28.0.50; Closing Gnus server then searching it results in unrecoverable breakage

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Tue, 25 Aug 2020 18:13:02 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 43047 in the body.
You can then email your comments to 43047 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#43047; Package emacs. (Tue, 25 Aug 2020 18:13:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 25 Aug 2020 18:13:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Closing Gnus server then searching it results in
 unrecoverable breakage
Date: Tue, 25 Aug 2020 11:12:34 -0700
While fooling around with dbus and server closing, I discovered that the
"closed" state is a bit fragile: I close a server (in this case a
localhost IMAP server) then immediately try to search it, and instead of
the server opening, or me getting a polite error message, I get the
error at the bottom of this report.

That error is then permanent, the server can't be re-opened. Not only
that, when I `gnus-group-restart' the error persists, AND infects my
second IMAP server on localhost, though I guess that's to be expected.
Gnus has to be explicitly quit and then restarted in order to recover.

I note that, in `nnimap-open-server', when I'm trying to open a server
that was closed, the DEFS parameter is populated. But when we get to
`nnoo-change-server', none of the global nnimap-* variables get set
correctly: nnimap-stream should be 'network, but it's 'undecided, which
is why the backtrace below shows failure on an attempted ssl connection.

If I try to open a server that's already open, the DEFS parameter is
nil, but after we reach the `nnoo-change-server' call, all the nnimap-*
vars are set correctly.

That's as far as I've gotten now. I will continue debugging this, but
I'm hanging it here first to remind myself, and in case anyone else
wants to take a whack at it.

Debugger entered--Lisp error: (error "NPR/imaps Name or service not known")
  make-network-process(:name "*nnimap*" :buffer #<buffer  *nnimap NPR nil  *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters nil :coding nil)
  open-network-stream("*nnimap*" #<buffer  *nnimap NPR nil  *nntpd**> "NPR" "imaps" :nowait nil :tls-parameters nil :coding nil)
  open-gnutls-stream("*nnimap*" #<buffer  *nnimap NPR nil  *nntpd**> "NPR" "imaps" (:type ssl :warn-unless-encrypted t :return-list t :shell-command "ssh %s imapd" :capability-command "1 CAPABILITY\15\n" :always-query-capabilities t :end-of-command "\15\n" :success " OK " :starttls-function #f(compiled-function (capabilities) #<bytecode -0xeb17a16a56719de>)))
  network-stream-open-tls("*nnimap*" #<buffer  *nnimap NPR nil  *nntpd**> "NPR" "imaps" (:type ssl :warn-unless-encrypted t :return-list t :shell-command "ssh %s imapd" :capability-command "1 CAPABILITY\15\n" :always-query-capabilities t :end-of-command "\15\n" :success " OK " :starttls-function #f(compiled-function (capabilities) #<bytecode -0xeb17a16a56719de>)))
  open-network-stream("*nnimap*" #<buffer  *nnimap NPR nil  *nntpd**> "NPR" "imaps" :type ssl :warn-unless-encrypted t :return-list t :shell-command "ssh %s imapd" :capability-command "1 CAPABILITY\15\n" :always-query-capabilities t :end-of-command "\15\n" :success " OK " :starttls-function #f(compiled-function (capabilities) #<bytecode -0xeb17a16a56719de>))
  nnimap-open-connection-1(#<buffer  *nntpd*>)
  nnimap-open-connection(#<buffer  *nntpd*>)
  nnimap-open-server("NPR" nil nil)
  nnimap-change-group("INBOX" "NPR")
  #f(compiled-function (group) #<bytecode -0x1990b256ae59c812>)("nnimap+NPR:INBOX")
  mapcar(#f(compiled-function (group) #<bytecode -0x1990b256ae59c812>) ("nnimap+NPR:INBOX"))
  nnir-run-imap(((query . "body \"searchy\"")) "nnimap:NPR" ("nnimap+NPR:INBOX"))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 16 Oct 2020 08:23:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 16 Oct 2020 10:21:52 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> That's as far as I've gotten now. I will continue debugging this, but
> I'm hanging it here first to remind myself, and in case anyone else
> wants to take a whack at it.
>
> Debugger entered--Lisp error: (error "NPR/imaps Name or service not known")
>   make-network-process(:name "*nnimap*" :buffer #<buffer *nnimap NPR
> nil *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters
> nil :coding nil)

Reading this bug report, it's somewhat unclear what the problem is.  Is
"NPR" really the name of the server you're connecting to, or is that the
problem?  That Gnus is trying to connect to "NPR"?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 16 Oct 2020 16:55:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 16 Oct 2020 09:54:48 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> That's as far as I've gotten now. I will continue debugging this, but
>> I'm hanging it here first to remind myself, and in case anyone else
>> wants to take a whack at it.
>>
>> Debugger entered--Lisp error: (error "NPR/imaps Name or service not known")
>>   make-network-process(:name "*nnimap*" :buffer #<buffer *nnimap NPR
>> nil *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters
>> nil :coding nil)
>
> Reading this bug report, it's somewhat unclear what the problem is.  Is
> "NPR" really the name of the server you're connecting to, or is that the
> problem?  That Gnus is trying to connect to "NPR"?

Yes, the server is correct: nnimap+NPR. Once I get that error above, I
can't reconnect, and get the same error for all nnimap backends.

I'm 90% sure the problem is that searching leads to a code path that
doesn't first check if the server is open, so `nnoo-change-server' is
never called, and the server variables for all imap servers get
cross-wired somehow. But I still haven't taken the time to step through
it in depth.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 16 Oct 2020 16:58:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 16 Oct 2020 18:57:12 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

>>> Debugger entered--Lisp error: (error "NPR/imaps Name or service not known")
>>>   make-network-process(:name "*nnimap*" :buffer #<buffer *nnimap NPR
>>> nil *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters
>>> nil :coding nil)
>>
>> Reading this bug report, it's somewhat unclear what the problem is.  Is
>> "NPR" really the name of the server you're connecting to, or is that the
>> problem?  That Gnus is trying to connect to "NPR"?
>
> Yes, the server is correct: nnimap+NPR. Once I get that error above, I
> can't reconnect, and get the same error for all nnimap backends.

But is "NPR" the domain name of the server you're trying to connect to?
Or is it the Gnus server name?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 16 Oct 2020 17:04:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 16 Oct 2020 10:03:10 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>>>> Debugger entered--Lisp error: (error "NPR/imaps Name or service not known")
>>>>   make-network-process(:name "*nnimap*" :buffer #<buffer *nnimap NPR
>>>> nil *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters
>>>> nil :coding nil)
>>>
>>> Reading this bug report, it's somewhat unclear what the problem is.  Is
>>> "NPR" really the name of the server you're connecting to, or is that the
>>> problem?  That Gnus is trying to connect to "NPR"?
>>
>> Yes, the server is correct: nnimap+NPR. Once I get that error above, I
>> can't reconnect, and get the same error for all nnimap backends.
>
> But is "NPR" the domain name of the server you're trying to connect to?
> Or is it the Gnus server name?

It's just the label of the server:

(nnimap "NPR"
  (nnimap-address "localhost")
  (nnimap-stream network)
  (gnus-message-archive-group "nnimap+NPR:Sent")
  (nnimap-authenticator login)
  (nnimap-user "eric <at> paper-republic.org"))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 27 Aug 2021 17:45:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 27 Aug 2021 19:44:09 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

>>>>>   make-network-process(:name "*nnimap*" :buffer #<buffer *nnimap NPR
>>>>> nil *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters
>>>>> nil :coding nil)

[...]

> It's just the label of the server:
>
> (nnimap "NPR"
>   (nnimap-address "localhost")
>   (nnimap-stream network)
>   (gnus-message-archive-group "nnimap+NPR:Sent")
>   (nnimap-authenticator login)
>   (nnimap-user "eric <at> paper-republic.org"))

Hm...  then it sounds like the defvoo machinery isn't restoring the
local variables (and just using "NPR" as the host name, which is the
default if nnimap-address is nil).

So...  I think...  this must mean that it thinks that NPR is the current
nnimap server even when it isn't, so something hasn't been reset
correctly somewhere...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 27 Aug 2021 18:34:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 27 Aug 2021 11:33:07 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>>>>>>   make-network-process(:name "*nnimap*" :buffer #<buffer *nnimap NPR
>>>>>> nil *nntpd**> :host "NPR" :service "imaps" :nowait nil :tls-parameters
>>>>>> nil :coding nil)
>
> [...]
>
>> It's just the label of the server:
>>
>> (nnimap "NPR"
>>   (nnimap-address "localhost")
>>   (nnimap-stream network)
>>   (gnus-message-archive-group "nnimap+NPR:Sent")
>>   (nnimap-authenticator login)
>>   (nnimap-user "eric <at> paper-republic.org"))
>
> Hm...  then it sounds like the defvoo machinery isn't restoring the
> local variables (and just using "NPR" as the host name, which is the
> default if nnimap-address is nil).

Oh! I think I already fixed this, in aae44a36f3. I just added a
`gnus-open-server' into the imap `gnus-search-run-search' -- that seems
sufficient to make this server the "current server". I just tested
it again (close and then search) and it seems to work fine. Maybe close
this out?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43047; Package emacs. (Fri, 27 Aug 2021 18:46:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 43047 <at> debbugs.gnu.org
Subject: Re: bug#43047: 28.0.50; Closing Gnus server then searching it
 results in unrecoverable breakage
Date: Fri, 27 Aug 2021 20:45:40 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> Oh! I think I already fixed this, in aae44a36f3. I just added a
> `gnus-open-server' into the imap `gnus-search-run-search' -- that seems
> sufficient to make this server the "current server". I just tested
> it again (close and then search) and it seems to work fine.

Great!

> Maybe close this out?

Sure; now done.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 43047 <at> debbugs.gnu.org and Eric Abrahamsen <eric <at> ericabrahamsen.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Aug 2021 18:47:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Sep 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 204 days ago.

Previous Next


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