Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#43152 - [netctl] Error messages given when a job fails are useless.

Attached to Project: Arch Linux
Opened by Åsmund Ervik (AsmundEr) - Thursday, 18 December 2014, 15:54 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 13 January 2015, 11:00 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

Description:
When a profile fails to connect with netctl, it tries to be helpful and says

└─(13:01: o)── sudo netctl start eduroam ──(Thu 18 Dec)─┘
Job for netctl@eduroam.service failed. See "systemctl status netctl@eduroam.service" and "journalctl -xe" for details.

However, checking the output of those two commands tells me nothing about the error. journalctl -xe does not list anything related to netctl at all. "systemctl status ..." is just an extremely verbose way of returning 1 as the error code:

└─(13:03: o)── sudo systemctl status netctl@eduroam.service ──(Thu 18 Dec)─┘
netctl@eduroam.service - Networking for netctl profile eduroam
Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static)
Active: failed (Result: exit-code) since Thu 2014-12-18 12:59:55 CET; 15s ago
Docs: man:netctl.profile(5)
Process: 15781 ExecStop=/usr/lib/network/network stop %I (code=exited, status=0/SUCCESS)
Process: 17563 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)
Main PID: 17563 (code=exited, status=1/FAILURE)

Suggestion: either remove the "helpful" hint (because it is anti-helpful) or improve the error messages. Preferrably the last. For now, I'm removing netctl and going back to netcfg on the AUR, which is actually less buggy even though no-one seems to maintain it.

Additional info:
* netctl version 1.9
This task depends upon

Closed by  Jouke Witteveen (jouke)
Tuesday, 13 January 2015, 11:00 GMT
Reason for closing:  Implemented
Additional comments about closing:  1f727e7 more documentation improvements about debugging problems are welcome and can be sent to arch-projects@.
Comment by Doug Newgard (Scimmia) - Thursday, 18 December 2014, 16:34 GMT
Those are generic messages coming from systemd, not from netctl. So your real complaint is that netctl doesn't log it's reason for failing to the journal?
Comment by Åsmund Ervik (AsmundEr) - Thursday, 18 December 2014, 19:03 GMT
Well, you can see it that way, sure. But as a user I don't care if netctl is implemented on top of systemctl, in Prolog or in assembly code, I just see that the user experience is poor:

netctl: "Operation failed. Look in $place1 or $place2 for details."
me: Looks in $place1 and $place2, finds there are no details at all.
Comment by Jouke Witteveen (jouke) - Thursday, 18 December 2014, 22:45 GMT
Well, the status command does point you at the man page and in many circumstances the journal does contain useful information. Apparently not in your case (which I doubt). Try adding 'NETCTL_DEBUG=yes' to your profile and report back with your actual output and we can maybe put some more useful error message in the journal. The status command, which is also available as `netctl status [PROFILE]`, should list some relevant lines from the journal.

I am sorry that we cannot alter the error output of systemctl. I wish we could. If you have an idea, write a patch and turn to the systemd developers.
Comment by Åsmund Ervik (AsmundEr) - Friday, 19 December 2014, 14:15 GMT
First of all: the reason the profile fails is because of a wrong password, since the password was changed. I figured this out when I switched to netcfg and it told me "Authentication error". Changing to the correct password, it works (both for netctl and netcfg). So I would have liked to get "Authentication error" or similar from netctl as well. Here is another user who spent time debugging the same problem: https://bbs.archlinux.org/viewtopic.php?id=162153 and I quote: "So much headache for such a simple solution... *grr* "

Ok, now I added NETCTL_DEBUG=yes to the profile like you said. That doesn't give me any more output though. After reading the manpage, I also tried exporting it as an environment variable, also no luck:
# export NETCTL_DEBUG=yes
# echo $NETCTL_DEBUG
yes
# netctl restart eduroam
Job for netctl@eduroam.service failed. See "systemctl status netctl@eduroam.service" and "journalctl -xe" for details.

Should I file a separate bug report for NETCTL_DEBUG not working? Further inspection of that issue: I reinstalled netctl 1.9-1, and then did `grep "DEBUG" /usr/bin/netctl` which returns nothing.

OK, so this is my profile. I'm deliberately using a wrong password to reproduce the bug.

Connection=wireless
Interface=wlan0
Security=wpa-configsection
IP=dhcp
NETCTL_DEBUG=yes
WPAConfigSection=(
'ssid="eduroam"'
'key_mgmt=WPA-EAP'
'eap=PEAP'
'phase2="auth=MSCHAPV2"'
'identity="anon@anon.com"'
'password="secret_password"'
)

sudo journalctl -xe --since=today gives only logging of cronjobs:
Dec 19 09:55:00 vsl161 fcron[24725]: Job 'pkill -USR1 forward-notify' started for user asmunder (pid 24726)
Dec 19 09:55:02 vsl161 fcron[24725]: Job 'pkill -USR1 forward-notify' completed
Dec 19 11:55:00 vsl161 fcron[32397]: Job 'pkill -USR2 forward-notify' started for user asmunder (pid 32398)
Dec 19 11:55:02 vsl161 fcron[32397]: Job 'pkill -USR2 forward-notify' completed
Dec 19 13:55:00 vsl161 fcron[7616]: Job 'pkill -USR1 forward-notify' started for user asmunder (pid 7617)
Dec 19 13:55:02 vsl161 fcron[7616]: Job 'pkill -USR1 forward-notify' completed

This is the output of systemctl status:
netctl@eduroam.service - Networking for netctl profile eduroam
Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static)
Active: failed (Result: exit-code) since Fri 2014-12-19 14:41:29 CET; 2min 12s ago
Docs: man:netctl.profile(5)
Process: 11369 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)
Main PID: 11369 (code=exited, status=1/FAILURE)

(This is identical to the output from netctl status.)
Comment by Jouke Witteveen (jouke) - Friday, 19 December 2014, 15:41 GMT
You cannot export your environment to systemd services that way, I'm sorry. The authentication error should be present in the journal, if they are not, something is not configures correctly...
Comment by Åsmund Ervik (AsmundEr) - Friday, 19 December 2014, 15:50 GMT
Ok, how do I do it then? The manpage says:

ENVIRONMENT
$NETCTL_DEBUG
If set to "yes", debugging output is generated.

So please explain to me like I'm five years old how to enable debug output.
Comment by Åsmund Ervik (AsmundEr) - Friday, 19 December 2014, 15:51 GMT
Note that I've also tried putting the line NETCTL_DEBUG=yes in the netctl profile, and that does not enable debug output either.
Comment by Jouke Witteveen (jouke) - Friday, 19 December 2014, 20:50 GMT
That is a valid complaint and I will update the documentation for it.

Traditionally (netcfg), ordinary exporting was sufficient. That's why it says so in the manpage. Currently both exporting and adding to the profile enable debugging. The first enables it for the netctl process, the second for the service corresponding to a profile. Output of the netctl process is logged directly to the terminal (but don't expect to see anything interesting). Output of the netctl process ends up in the journal. The name of the process generating debugging output is 'network', whereas the authentication error is probably recorded from 'wpa_supplicant', which is a program used by netctl to establish a connection.

I consider this bug-report to be about documentation. Specific suggestions for documentation improvements are welcome.

Loading...