Activity log for bug #2054470

Date Who What changed Old value New value Message
2024-02-20 20:37:09 Thiago Martins bug added bug
2024-02-21 20:22:15 Sergio Durigan Junior bug watch added https://github.com/NetworkBlockDevice/nbd/issues/131
2024-02-21 20:22:22 Sergio Durigan Junior tags server-todo
2024-02-21 20:22:28 Sergio Durigan Junior bug added subscriber Ubuntu Server
2024-02-21 20:22:39 Sergio Durigan Junior nominated for series Ubuntu Focal
2024-02-21 20:22:39 Sergio Durigan Junior bug task added nbd (Ubuntu Focal)
2024-02-21 20:22:39 Sergio Durigan Junior nominated for series Ubuntu Jammy
2024-02-21 20:22:39 Sergio Durigan Junior bug task added nbd (Ubuntu Jammy)
2024-02-21 20:22:49 Sergio Durigan Junior nbd (Ubuntu): status New Fix Released
2024-02-21 20:22:51 Sergio Durigan Junior nbd (Ubuntu Focal): assignee Sergio Durigan Junior (sergiodj)
2024-02-21 20:22:52 Sergio Durigan Junior nbd (Ubuntu Jammy): assignee Sergio Durigan Junior (sergiodj)
2024-02-21 20:23:05 Sergio Durigan Junior bug task added nbd
2024-02-21 20:31:24 Sergio Durigan Junior bug task deleted nbd (Ubuntu Focal)
2024-02-21 20:32:12 Sergio Durigan Junior nbd (Ubuntu Jammy): status New Triaged
2024-02-21 21:37:55 Sergio Durigan Junior merge proposal linked https://code.launchpad.net/~sergiodj/ubuntu/+source/nbd/+git/nbd/+merge/460977
2024-02-21 21:44:19 Sergio Durigan Junior description Description: Hello, I've encountered an issue with the NBD (Network Block Device) client on Ubuntu 22.04 and 20.04, where it fails to correctly parse the `/etc/nbdtab` file, leading to errors when attempting to establish NBD connections using `systemd` services. This issue significantly impacts automation and system startup processes that rely on NBD devices being available at boot time. ### Steps to Reproduce: 1. Prepare an NBD server with a disk image to share. For instance: ```bash truncate -s 1T /vol-0.img ``` 2. Configure the NBD server by adding the following to `/etc/nbd-server/conf.d/exports.conf`: ``` [vol0] exportname = /vol-0.img ``` 3. Restart the NBD server to apply the configuration: ```bash systemctl restart nbd-server.service ``` 4. Manually connecting to the NBD server works as expected: ```bash nbd-client 127.0.0.1 /dev/nbd0 -name vol0 ``` This successfully establishes the connection, and the NBD device is usable. 5. However, configuring the client connection in `/etc/nbdtab` and attempting to use it results in a parsing error: Contents of `/etc/nbdtab`: ``` nbd0 127.0.0.1 vol0 ``` Attempting to initiate the connection with: ```bash nbd-client nbd0 ``` Results in the following error: ``` parse error parsing /etc/nbdtab: syntax errorERROR: no valid configuration for specified device found ``` ### Impact: This parsing issue prevents using `systemd` services like `systemctl enable nbd@nbd0 --now` for automating NBD device connections at boot, a significant limitation for environments relying on NBD. ### Additional Information: - This issue is present in `nbd-client` version 3.23, available in the Ubuntu 22.04 (also affects 20.04) repositories. - Testing on the Ubuntu 24.04 development branch, which includes `nbd-client` version 3.25, does not exhibit this issue, suggesting a fix has already been implemented in later versions. ### Suggested Action: Considering the impact of this issue and its resolution in newer versions of NBD, I propose that a backport of `nbd-client` version 3.25 (or newer) to Ubuntu 22.04 and 20.04 would resolve this problem, improving system automation and reliability for users relying on NBD. Thank you for your attention to this matter. I am looking forward to any updates or recommendations on workarounds in the meantime. [ Impact ] NBD users who want to specify IPv4 addresses on /etc/nbdtab will get a parsing error which renders the program useless in this case: parse error parsing /etc/nbdtab: syntax errorERROR: no valid configuration for specified device found [ Test Plan ] Inside a Jammy VM (not a container): # apt update # apt install -y nbd-client nbd-server # 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 127.0.0.1 /dev/nbd0 -name vol0 Now, trigger the problem: # cat >> /etc/nbdtab << _EOF_ nbd0 127.0.0.1 vol0 _EOF_ # nbd-client nbd0 With an unpatched package, you should see the error: # nbd-client nbd0 parse error parsing /etc/nbdtab: syntax errorERROR: no valid configuration for specified device found Usage: nbd-client -name|-N name host [port] nbd_device [-block-size|-b block size] [-timeout|-t timeout] [-swap|-s] [-sdp|-S] [-persist|-p] [-nofork|-n] [-systemd-mark|-m] [-nonetlink|-L] ... With a patched package, you should see: # /home/ubuntu/nbd/nbd/nbd-client nbd0 Negotiation: ..size = 1048576MB Connected /dev/nbd0 [ Where problems could go wrong ] This is an extremely simple fix, implemented by upstream more than a year ago, and that has been present in multiple Ubuntu releases ever since. Noble and Mantic are not affected, which means that they are already carrying the fix. Fortunately, upstream switched to flex+bison which means that it's easier to understand the fix and track down the problem. I am not expecting any downfall from this, but if there are any, it will likely be an obscure corner case when parsing IPv4 addresses. [ Original Description ] Description: Hello, I've encountered an issue with the NBD (Network Block Device) client on Ubuntu 22.04 and 20.04, where it fails to correctly parse the `/etc/nbdtab` file, leading to errors when attempting to establish NBD connections using `systemd` services. This issue significantly impacts automation and system startup processes that rely on NBD devices being available at boot time. ### Steps to Reproduce: 1. Prepare an NBD server with a disk image to share. For instance:    ```bash    truncate -s 1T /vol-0.img    ``` 2. Configure the NBD server by adding the following to `/etc/nbd-server/conf.d/exports.conf`:    ```    [vol0]    exportname = /vol-0.img    ``` 3. Restart the NBD server to apply the configuration:    ```bash    systemctl restart nbd-server.service    ``` 4. Manually connecting to the NBD server works as expected:    ```bash    nbd-client 127.0.0.1 /dev/nbd0 -name vol0    ```    This successfully establishes the connection, and the NBD device is usable. 5. However, configuring the client connection in `/etc/nbdtab` and attempting to use it results in a parsing error: Contents of `/etc/nbdtab`:    ```    nbd0 127.0.0.1 vol0    ``` Attempting to initiate the connection with:    ```bash    nbd-client nbd0    ```    Results in the following error:    ```    parse error parsing /etc/nbdtab: syntax errorERROR: no valid configuration for specified device found    ``` ### Impact: This parsing issue prevents using `systemd` services like `systemctl enable nbd@nbd0 --now` for automating NBD device connections at boot, a significant limitation for environments relying on NBD. ### Additional Information: - This issue is present in `nbd-client` version 3.23, available in the Ubuntu 22.04 (also affects 20.04) repositories. - Testing on the Ubuntu 24.04 development branch, which includes `nbd-client` version 3.25, does not exhibit this issue, suggesting a fix has already been implemented in later versions. ### Suggested Action: Considering the impact of this issue and its resolution in newer versions of NBD, I propose that a backport of `nbd-client` version 3.25 (or newer) to Ubuntu 22.04 and 20.04 would resolve this problem, improving system automation and reliability for users relying on NBD. Thank you for your attention to this matter. I am looking forward to any updates or recommendations on workarounds in the meantime.
2024-02-29 15:43:09 Ubuntu Archive Robot bug added subscriber Sergio Durigan Junior
2024-03-01 17:51:16 Timo Aaltonen nbd (Ubuntu Jammy): status Triaged Fix Committed
2024-03-01 17:51:17 Timo Aaltonen bug added subscriber Ubuntu Stable Release Updates Team
2024-03-01 17:51:18 Timo Aaltonen bug added subscriber SRU Verification
2024-03-01 17:51:21 Timo Aaltonen tags server-todo server-todo verification-needed verification-needed-jammy
2024-03-04 18:42:52 Sergio Durigan Junior tags server-todo verification-needed verification-needed-jammy server-todo verification-done verification-done-jammy
2024-03-13 06:26:38 Launchpad Janitor nbd (Ubuntu Jammy): status Fix Committed Fix Released
2024-03-13 06:26:40 Chris Halse Rogers removed subscriber Ubuntu Stable Release Updates Team