Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pipfs directory in nfs.conf to support nfs-utils 1:2.6.1-1ubuntu1.2 #142

Merged
merged 2 commits into from
Sep 13, 2023

Conversation

enrico-usai
Copy link
Contributor

@enrico-usai enrico-usai commented Aug 11, 2023

Description

When using nfs-utils 1:2.6.1-1ubuntu1.2, for example on Ubuntu22, the installation of nfs cookbook fails with:

---- Begin output of ["/usr/bin/systemctl", "--system", "start", "nfs-idmapd.service"] ----
       STDOUT: 
       STDERR: Job for nfs-idmapd.service failed because the control process exited with error code.
       See "systemctl status nfs-idmapd.service" and "journalctl -xeu nfs-idmapd.service" for details.

In the log files you can find the reason:

ubuntu@ip-10-0-0-62:~$ systemctl status nfs-idmapd.service
× nfs-idmapd.service - NFSv4 ID-name mapping service
     Loaded: loaded (/lib/systemd/system/nfs-idmapd.service; static)
     Active: failed (Result: exit-code) since Fri 2023-08-11 10:23:08 UTC; 3min 58s ago
    Process: 2960 ExecStart=/usr/sbin/rpc.idmapd (code=exited, status=1/FAILURE)
...
Unable to inotify_add_watch(/var/lib/nfs/rpc_pipefs//nfs): No such file or directory

By searching online you can see that this is due to a known bug in nfs-utils 1:2.6.1-1ubuntu1.2. The bug has been fixed but not yet available:
https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971935

To workaround this issue is enough to configure the pipefs-directory parameter in the [general] section of the nfs.conf file:

[general]
pipefs-directory=/run/rpc_pipefs/

This section is already present and correctly configured in the default nfs.conf file, but the nfs cookbook is removing it, causing the issue to appear:

 Recipe: nfs::_common
             * apt_package[nfs-common] action install[2023-08-11T10:22:55+00:00] INFO: Processing apt_package[nfs-common] action install (nfs::_common line 22)
       [2023-08-11T10:23:02+00:00] INFO: apt_package[nfs-common] installed nfs-common at 1:2.6.1-1ubuntu1.2
       
        - install version 1:2.6.1-1ubuntu1.2 of package nfs-common
             * apt_package[rpcbind] action install[2023-08-11T10:23:02+00:00] INFO: Processing apt_package[rpcbind] action install (nfs::_common line 22)
        (up to date)
             * directory[/etc] action create[2023-08-11T10:23:02+00:00] INFO: Processing directory[/etc] action create (nfs::_common line 26)
        (skipped due to only_if)
             * template[/etc/nfs.conf] action create[2023-08-11T10:23:02+00:00] INFO: Processing template[/etc/nfs.conf] action create (nfs::_common line 36)
       [2023-08-11T10:23:02+00:00] INFO: template[/etc/nfs.conf] backed up to /tmp/kitchen/backup/etc/nfs.conf.chef-20230811102302.181807
       [2023-08-11T10:23:02+00:00] INFO: template[/etc/nfs.conf] updated file contents /etc/nfs.conf
       
        - update content in file /etc/nfs.conf from 802c52 to 769354
        --- /etc/nfs.conf       2022-10-20 14:50:13.000000000 +0000
        +++ /etc/.chef-nfs20230811-1570-ufazs0.conf     2023-08-11 10:23:02.166567804 +0000
        @@ -1,87 +1,24 @@
        +# Generated by Chef for ip-10-0-0-62.eu-west-1.compute.internal# Local modifications will be overwritten.
         #
         # This is a general configuration for the
         # NFS daemons and tools
        -#
        -[general]
        -pipefs-directory=/run/rpc_pipefs
        -#
...

With this patch I'm just avoiding to remove the existing value. This permits nfs cookbook to work even when using the bugged version of nfs-utils package.

Tests

  • Tested on Ubuntu22

Issues Resolved

Check List

  • A summary of changes made is included in the CHANGELOG under ## Unreleased
  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

When using nfs-utils `1:2.6.1-1ubuntu1.2`, for example on Ubuntu22,
the installation of `nfs` cookbook fails with:
```
---- Begin output of ["/usr/bin/systemctl", "--system", "start", "nfs-idmapd.service"] ----
       STDOUT: 
       STDERR: Job for nfs-idmapd.service failed because the control process exited with error code.
       See "systemctl status nfs-idmapd.service" and "journalctl -xeu nfs-idmapd.service" for details.
```

In the log files you can find the reason:
```
```

By searching online you can see that  this is due to a known bug in `nfs-utils 1:2.6.1-1ubuntu1.2`.
The bug has been fixed but not yet available:
https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971935

To workaround this issue is enough to configure the `pipefs-directory` parameter in the `[general]` section of the `nfs.conf` file:

```
[general]
pipefs-directory=/run/rpc_pipefs/
```

This section is already present and correctly configured in the default `nfs.conf` file, but the `nfs` cookbook is removing it, causing the issue to appear:
```
 Recipe: nfs::_common
             * apt_package[nfs-common] action install[2023-08-11T10:22:55+00:00] INFO: Processing apt_package[nfs-common] action install (nfs::_common line 22)
       [2023-08-11T10:23:02+00:00] INFO: apt_package[nfs-common] installed nfs-common at 1:2.6.1-1ubuntu1.2
       
        - install version 1:2.6.1-1ubuntu1.2 of package nfs-common
             * apt_package[rpcbind] action install[2023-08-11T10:23:02+00:00] INFO: Processing apt_package[rpcbind] action install (nfs::_common line 22)
        (up to date)
             * directory[/etc] action create[2023-08-11T10:23:02+00:00] INFO: Processing directory[/etc] action create (nfs::_common line 26)
        (skipped due to only_if)
             * template[/etc/nfs.conf] action create[2023-08-11T10:23:02+00:00] INFO: Processing template[/etc/nfs.conf] action create (nfs::_common line 36)
       [2023-08-11T10:23:02+00:00] INFO: template[/etc/nfs.conf] backed up to /tmp/kitchen/backup/etc/nfs.conf.chef-20230811102302.181807
       [2023-08-11T10:23:02+00:00] INFO: template[/etc/nfs.conf] updated file contents /etc/nfs.conf
       
        - update content in file /etc/nfs.conf from 802c52 to 769354
        --- /etc/nfs.conf       2022-10-20 14:50:13.000000000 +0000
        +++ /etc/.chef-nfs20230811-1570-ufazs0.conf     2023-08-11 10:23:02.166567804 +0000
        @@ -1,87 +1,24 @@
        +# Generated by Chef for ip-10-0-0-62.eu-west-1.compute.internal# Local modifications will be overwritten.
         #
         # This is a general configuration for the
         # NFS daemons and tools
        -#
        -[general]
        -pipefs-directory=/run/rpc_pipefs
        -#
...
``` 

With this patch I'm just avoiding to remove the existing value.
This permits `nfs` cookbook to work even when using the bugged version of `nfs-utils` package.

### Tests
* Tested on Ubuntu22


### References
* sous-chefs#93
* https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971935
@enrico-usai
Copy link
Contributor Author

enrico-usai commented Sep 5, 2023

@atomic-penguin @joerocklin @ramereth @damacus could you check the patch?

@joerocklin
Copy link
Contributor

I haven't been involved in this project for years and wouldn't feel comfortable approving something at this stage.

Copy link
Member

@damacus damacus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be optional.

And at least have a set of defaults

@enrico-usai
Copy link
Contributor Author

enrico-usai commented Sep 12, 2023

@damacus thanks for your answer. By looking at the attributes/default.rb file I can see the defaults are already there:

default['nfs']['idmap']['pipefs_directory'] = if platform_family?('debian')
                                                '/run/rpc_pipefs'
                                              else
                                                '/var/lib/nfs/rpc_pipefs'
                                              end

Please let me know I'm misinterpreting your suggestion. Could you give me some hints on what I'm missing. Thanks!

@damacus
Copy link
Member

damacus commented Sep 13, 2023

Sorry, complete brain fart. I've reviewed way too many PRs recently and I just didn't dig into this far enough.

I'm really not sure why this isn't in there in the first place, but thanks for fixing this!

@damacus damacus added the Release: Minor Release to Chef Supermarket as a minor release when merged label Sep 13, 2023
@damacus
Copy link
Member

damacus commented Sep 13, 2023

The tests are failing right now due to a systemd but I have forgotten the fix. I'm happy this patch reverts the default system behaviour.

@damacus damacus merged commit 69ab52e into sous-chefs:main Sep 13, 2023
7 of 23 checks passed
@kitchen-porter
Copy link
Contributor

Released as: 5.1.0

@enrico-usai
Copy link
Contributor Author

Thank you @damacus !

@enrico-usai enrico-usai deleted the wip/u22 branch September 14, 2023 08:33
enrico-usai added a commit to enrico-usai/aws-parallelcluster-cookbook that referenced this pull request Nov 16, 2023
Version 5.0.1 introduced support for Ubuntu22, anyway we weren't able to upgrade
the package because nfs-utils `1:2.6.1-1ubuntu1.2` wasn't correctly supported.

I created a patch for nfs cookbook to fix this incompatibility issue with nfs-utils.
This has been released, so we can now upgrade to 5.1.x and remove the `ubuntu.22.json` file.

### References
* https://github.com/sous-chefs/nfs/releases
* sous-chefs/nfs#142
* https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971935

Signed-off-by: Enrico Usai <[email protected]>
enrico-usai added a commit to enrico-usai/aws-parallelcluster-cookbook that referenced this pull request Nov 16, 2023
Version 5.0.1 introduced support for Ubuntu22, anyway we weren't able to upgrade
the package because nfs-utils `1:2.6.1-1ubuntu1.2` wasn't correctly supported.

I created a patch for nfs cookbook to fix this incompatibility issue with nfs-utils.
This has been released, so we can now upgrade to 5.1.x and remove the `ubuntu.22.json` file.

### References
* https://github.com/sous-chefs/nfs/releases
* sous-chefs/nfs#142
* https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971935

Signed-off-by: Enrico Usai <[email protected]>
enrico-usai added a commit to aws/aws-parallelcluster-cookbook that referenced this pull request Nov 16, 2023
Version 5.0.1 introduced support for Ubuntu22, anyway we weren't able to upgrade
the package because nfs-utils `1:2.6.1-1ubuntu1.2` wasn't correctly supported.

I created a patch for nfs cookbook to fix this incompatibility issue with nfs-utils.
This has been released, so we can now upgrade to 5.1.x and remove the `ubuntu.22.json` file.

### References
* https://github.com/sous-chefs/nfs/releases
* sous-chefs/nfs#142
* https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1971935

Signed-off-by: Enrico Usai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release: Minor Release to Chef Supermarket as a minor release when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants