** Description changed:

  [ Impact ]
  
- NBD users who want to use /etc/nbdtab will face issues when trying to
- start the NBD Client. Trying to use the `systemd` service also doesn't
- work.
+ nbdtab uses a port of 0 by default which is not sensible. This means
+ that if you do not set a default port in nbdtab, it will fail.
+ 
+ You will see an error such as: Error: Socket failed: Connection refused
+ 
  
  [ Test Plan ]
  
- Inside a Noble VM (not a container):
- 
- # apt update
- # apt install -y nbd-client nbd-server
+ $ lxc launch ubuntu:noble n-vm --vm
+ $ lxc shell n-vm
+ # apt update -y && apt install -y nbd-client nbd-server
+ # dpkg -s nbd-client | grep Version:
+ Version: 1:3.26.1-1build1
  # modprobe nbd
  # truncate -s 1T /vol-0.img
  # cat > /etc/nbd-server/conf.d/exports.conf << _EOF_
  [vol0]
  exportname = /vol-0.img
  _EOF_
  # systemctl restart nbd-server.service
  
  Verify that NBD is working properly:
  
  # nbd-client localhost /dev/nbd0 -name vol0
  
  It should work.
  
  To clean it up:
  
  # nbd-client -d /dev/nbd0
  
  Now, trigger the problem:
  
  # cat >> /etc/nbdtab << _EOF_
  nbd0 localhost vol0
  _EOF_
  # nbd-client nbd0
  
  You should see the error:
  
  # nbd-client nbd0
  Error: Socket failed: Connection refused
  
- Further attempts with `systemd` also fail:
- 
- # systemctl restart nbd@nbd0
- Job for [email protected] failed because the control process exited with error 
code.
- See "systemctl status [email protected]" and "journalctl -xeu 
[email protected]" for details.
- 
- And the logs:
- 
- # journalctl -u [email protected] -n 25
- Apr 09 21:56:17 noble-nbd-1 systemd[1]: [email protected]: Dependency 
Before=dev-nbd0.device ignored (.device units cannot be delayed)
- Apr 09 21:56:17 noble-nbd-1 systemd[1]: Starting [email protected] - NBD 
client connection for nbd0...
- Apr 09 21:56:17 noble-nbd-1 nbd_client[5698]: Socket failed: Connection 
refused
- Apr 09 21:56:17 noble-nbd-1 nbd-client[5698]: Error: Socket failed: 
Connection refused
- Apr 09 21:56:17 noble-nbd-1 nbd_client[5698]: Exiting.
- Apr 09 21:56:17 noble-nbd-1 systemd[1]: [email protected]: Main process 
exited, code=exited, status=1/FAILURE
- Apr 09 21:56:17 noble-nbd-1 systemd[1]: [email protected]: Failed with result 
'exit-code'.
- Apr 09 21:56:17 noble-nbd-1 systemd[1]: Failed to start [email protected] - 
NBD client connection for nbd0.
+ Test the fix:
+ # add-apt-repository -y ppa:mitchdz/lp2060745-nbd-port-fix
+ # apt update -y && apt upgrade -y
+ # dpkg -s nbd-client | grep Version:
+ Version: 1:3.26.1-1ubuntu0.1~noble1
+ # nbd-client -d /dev/nbd0
+ < no errors here>

** Summary changed:

- nbd-client fails to connect when using /etc/nbdtab on Ubuntu 24.04 (Noble)
+ nbd-client fails to connect Error: Socket failed: Connection refused

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2060745

Title:
  nbd-client fails to connect Error: Socket failed: Connection refused

To manage notifications about this bug go to:
https://bugs.launchpad.net/nbd/+bug/2060745/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to