NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
450 stars 116 forks source link

Confusing error message when run without sufficient permissions #167

Closed joshtriplett closed 1 month ago

joshtriplett commented 3 months ago

Running nbd-client as non-root produces this error:

Error: Failed to setup device, check dmesg

dmesg has nothing in it, however.

As it turns out, the actual error here was that I forgot to run nbd-client as root.

It does look like the netlink error that comes back from the kernel has an -EPERM in it.

Please consider either: 1) Using a netlink API that gives back this error from the kernel, and displays the corresponding message, or 2) When this error occurs, checking if the user has permissions, and if not, giving the hint that this may be a permission error, or 3) Making this error message more generic, and just always showing the hint to check permissions.