GNU bug report logs - #33270
[SHEPHERD] Wrong error message when missing priviledge

Previous Next

Package: guix;

Reported by: swedebugia <swedebugia <at> riseup.net>

Date: Mon, 5 Nov 2018 09:57:01 UTC

Severity: normal

To reply to this bug, email your comments to 33270 AT debbugs.gnu.org.

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-guix <at> gnu.org:
bug#33270; Package guix. (Mon, 05 Nov 2018 09:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to swedebugia <swedebugia <at> riseup.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 05 Nov 2018 09:57:02 GMT) Full text and rfc822 format available.

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

From: swedebugia <swedebugia <at> riseup.net>
To: bug-guix <at> gnu.org
Subject: [SHEPHERD] Wrong error message when missing priviledge
Date: Mon, 5 Nov 2018 10:55:56 +0100
Hi

sdb <at> komputilo ~$ herd status
error: connect: /run/user/30011/shepherd/socket: No such file or directory

sdb <at> komputilo ~$ sudo herd status
Password:
Started:
 + console-font-tty1
 + console-font-tty2
 + console-font-tty3
 + console-font-tty4
...


-- 
Cheers
Swedebugia





Information forwarded to bug-guix <at> gnu.org:
bug#33270; Package guix. (Mon, 05 Nov 2018 19:50:02 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: swedebugia <swedebugia <at> riseup.net>
Cc: 33270 <at> debbugs.gnu.org
Subject: Re: bug#33270: [SHEPHERD] Wrong error message when missing priviledge
Date: Mon, 05 Nov 2018 20:48:51 +0100
swedebugia <swedebugia <at> riseup.net> writes:

> sdb <at> komputilo ~$ herd status
> error: connect: /run/user/30011/shepherd/socket: No such file or directory

It is possible to run shepherd as a user service manager.  This means
that we can’t generally assume that the user meant to communicate with
the init instance.

The error could be that either the user’s instance is not running or
that the user meant to communicate with the init system.  It is not
obvious to me how to distinguish these two errors.

--
Ricardo





Information forwarded to bug-guix <at> gnu.org:
bug#33270; Package guix. (Mon, 05 Nov 2018 21:58:03 GMT) Full text and rfc822 format available.

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

From: Gábor Boskovits <boskovits <at> gmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: swedebugia <at> riseup.net, 33270 <at> debbugs.gnu.org
Subject: Re: bug#33270: [SHEPHERD] Wrong error message when missing priviledge
Date: Mon, 5 Nov 2018 22:57:15 +0100
Hello Ricardo,

Ricardo Wurmus <rekado <at> elephly.net> ezt írta (időpont: 2018. nov. 5., H, 20:50):
>
>
> swedebugia <swedebugia <at> riseup.net> writes:
>
> > sdb <at> komputilo ~$ herd status
> > error: connect: /run/user/30011/shepherd/socket: No such file or directory
>

Actually this seems to be a message that can be translated to
'shepherd user instance is not running' am I correct?
I guess that way it is explicit that the command given would like to
talk to a shepherd user instance. Am I missing something here?

> It is possible to run shepherd as a user service manager.  This means
> that we can’t generally assume that the user meant to communicate with
> the init instance.
>
> The error could be that either the user’s instance is not running or
> that the user meant to communicate with the init system.  It is not
> obvious to me how to distinguish these two errors.
>
> --
> Ricardo
>
>
>
>

Best regards,
g_bor




Information forwarded to bug-guix <at> gnu.org:
bug#33270; Package guix. (Mon, 05 Nov 2018 22:50:01 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Gábor Boskovits <boskovits <at> gmail.com>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 33270 <at> debbugs.gnu.org
Subject: Re: bug#33270: [SHEPHERD] Wrong error message when missing priviledge
Date: Mon, 5 Nov 2018 23:49:44 +0100
[Message part 1 (text/plain, inline)]
Hi Gabor,

On Mon, 5 Nov 2018 22:57:15 +0100
Gábor Boskovits <boskovits <at> gmail.com> wrote:
> > > sdb <at> komputilo ~$ herd status
> > > error: connect: /run/user/30011/shepherd/socket: No such file or directory  
> 
> Actually this seems to be a message that can be translated to
> 'shepherd user instance is not running' am I correct?

Yes, that's what it means.  For a UNIX error message, what it's saying
is actually quite close to what it really means. :)

I would suggest to keep the file name in the error message anyway,
but no harm in adding some extra information (it will slightly complicate
the socket discovery code, but that's okay.  Also, right now profiles can
actually set up XDG_RUNTIME_DIR to point somewhere else and make herd connect
to the profile's shepherd's socket - which is nice, but is not really a *user"
shepherd then anymore).

Also, we should suppress the stack trace for this specific error since it
really doesn't add anything useful.

> > The error could be that either the user’s instance is not running or
> > that the user meant to communicate with the init system.  It is not
> > obvious to me how to distinguish these two errors.

I don't think it's possible to distinguish these.

It would be possible to make herd fallback to the system shepherd if it can't
find the stuff in the user shepherd, but I'm not sure I'd like it.

Better, we could add "--user" and "--system" options to force herd to connect to
some specific shepherd regardless of user, at the cost of hard-coding that there
are only these two (which is not actually the case - shepherd is meant to be
used in a modular way and doesn't care one way or another how often and where
exactly you run it).

It's kinda weird to have different endpoints depending on whether one is root or
not, but as a default it has precedent in both dbus and systemd.

I think people can get used to it (we should document it).
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#33270; Package guix. (Tue, 06 Nov 2018 07:57:01 GMT) Full text and rfc822 format available.

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

From: Gábor Boskovits <boskovits <at> gmail.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 33270 <at> debbugs.gnu.org
Subject: Re: bug#33270: [SHEPHERD] Wrong error message when missing priviledge
Date: Tue, 6 Nov 2018 08:55:49 +0100
Hello Danny,

Danny Milosavljevic <dannym <at> scratchpost.org> ezt írta (időpont: 2018.
nov. 5., H, 23:49):
>
> Hi Gabor,
>
> On Mon, 5 Nov 2018 22:57:15 +0100
> Gábor Boskovits <boskovits <at> gmail.com> wrote:
> > > > sdb <at> komputilo ~$ herd status
> > > > error: connect: /run/user/30011/shepherd/socket: No such file or directory
> >
> > Actually this seems to be a message that can be translated to
> > 'shepherd user instance is not running' am I correct?
>
> Yes, that's what it means.  For a UNIX error message, what it's saying
> is actually quite close to what it really means. :)
>
> I would suggest to keep the file name in the error message anyway,
> but no harm in adding some extra information (it will slightly complicate
> the socket discovery code, but that's okay.  Also, right now profiles can
> actually set up XDG_RUNTIME_DIR to point somewhere else and make herd connect
> to the profile's shepherd's socket - which is nice, but is not really a *user"
> shepherd then anymore).
>
> Also, we should suppress the stack trace for this specific error since it
> really doesn't add anything useful.
>
> > > The error could be that either the user’s instance is not running or
> > > that the user meant to communicate with the init system.  It is not
> > > obvious to me how to distinguish these two errors.
>
> I don't think it's possible to distinguish these.
>
> It would be possible to make herd fallback to the system shepherd if it can't
> find the stuff in the user shepherd, but I'm not sure I'd like it.

I would not like this either.

>
> Better, we could add "--user" and "--system" options to force herd to connect to
> some specific shepherd regardless of user, at the cost of hard-coding that there
> are only these two (which is not actually the case - shepherd is meant to be
> used in a modular way and doesn't care one way or another how often and where
> exactly you run it).

Could we instead just give a hint like, "if you intended to communicate with the
system shepherd, please specify -s system_sepherd_socket_name_here on you
command"?

>
> It's kinda weird to have different endpoints depending on whether one is root or
> not, but as a default it has precedent in both dbus and systemd.
>
> I think people can get used to it (we should document it).




This bug report was last modified 6 years and 218 days ago.

Previous Next


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