Comment 0 for bug 2054470

Revision history for this message
Thiago Martins (martinx) wrote :

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.