Bug 1687033

Summary: Loading modules that change MANPATH in zsh breaks man
Product: [Fedora] Fedora Reporter: Karl <kaiserkarl31>
Component: environment-modulesAssignee: Jan Synacek <jsynacek>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: jsynacek, xavier.delaruelle
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: environment-modules-4.2.3-1.fc30 environment-modules-4.2.3-1.fc29 environment-modules-4.2.4-1.fc30 environment-modules-4.2.4-1.fc29 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-08 01:12:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1692024, 1703415    

Description Karl 2019-03-08 23:20:59 UTC
Description of problem:
Loading a module that modifies MANPATH from a default environment causes man pages in the default location (/usr/share/man) to be missed when man loads.

Version-Release number of selected component (if applicable):
man-db-2.8.4-1.fc29.x86_64
environment-modules-4.2.1-1.fc29

How reproducible:
Unknown. I have been able to reproduce this using both /bin/bash and /bin/zsh as the login shell.

Steps to Reproduce:
1. Comment out all environment modules loaded in ~/.zshrc or ~/.bashrc (I have not tested this with other shells); log out and log in if necessary
2. Open a terminal
3. man ls (should work fine)
4. echo $MANPATH
/usr/local/share/man:/usr/share/man  [zsh]
OR
                                     [bash]
4. Load an environment module that prepends to MANPATH (one choice is mpi/openmpi-x86_64 if you have openmpi-devel installed)
5. echo $MANPATH
/usr/share/man/openmpi-x86_64
6. man ls

Actual results:
No manual entry for ls

Expected results:
(displays ls man page)

Additional info:
The sequence above reproduces the bug for me on several different machines.

I also got a warning message if I type "manpath" after this procedure:
manpath: warning: $MANPATH set, ignoring /etc/man_db.conf
/usr/share/man/openmpi-x86-_64

Comment 1 Xavier Delaruelle 2019-03-10 09:30:13 UTC
This issue has recently been reported upstream (https://github.com/cea-hpc/modules/issues/224) and the fix for it will be available in the next bugfix release (4.2.3) that will be out this month.

Comment 2 Xavier Delaruelle 2019-03-23 12:56:08 UTC
Version 4.2.3 has just been released upstream. This new bugfix version fixes this issue.

Comment 3 Fedora Update System 2019-03-26 11:08:25 UTC
environment-modules-4.2.3-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-edc6a7a9bb

Comment 4 Fedora Update System 2019-03-26 11:08:33 UTC
environment-modules-4.2.3-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-ecb9345615

Comment 5 Fedora Update System 2019-03-27 00:45:21 UTC
environment-modules-4.2.3-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-edc6a7a9bb

Comment 6 Fedora Update System 2019-03-27 04:34:38 UTC
environment-modules-4.2.3-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-ecb9345615

Comment 7 Karl 2019-03-27 21:52:44 UTC
I updated environment-modules to 4.2.3-1.fc29 from the updates-testing repository. This solved the problem for bash, but it still exists for zsh.

Comment 8 Fedora Update System 2019-03-31 00:03:55 UTC
environment-modules-4.2.3-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Xavier Delaruelle 2019-03-31 18:30:39 UTC
I cannot reproduce the issue anymore, once 4.2.3 is installed (on a Fedora 28 system).

When running a zsh shell (with zsh as default shell):


    ~% echo $MANPATH
    
    ~% module -V
    Modules Release 4.2.3 (2019-03-23)
    ~% man -w ls
    /usr/share/man/man1/ls.1.gz
    ~% module load mpi
    ~% echo $MANPATH  
    :/usr/share/man/mpich-x86_64
    ~% man -w ls
    /usr/share/man/man1/ls.1.gz


Everything works as expected in my case. Could you please provide details to reproduce the issue you get.

Comment 10 Fedora Update System 2019-04-04 03:11:10 UTC
environment-modules-4.2.3-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Karl 2019-04-16 19:03:24 UTC
Reopening---I upgraded to environment-modules-4.2.3-1.fc29, and this still happens. It appears to have been fixed in bash, just not in zsh. Steps to reproduce in zsh (zsh-5.6.2-3.fc29):

% module -V
Modules Release 4.2.3 (2019-03-23)
% module purge
% man -w ls
/usr/share/man/man1/ls.1.gz
% module load mpi
% man -w ls
No manual entry for ls
% manpath
manpath: warning: $MANPATH set, ignoring /etc/man_db.conf
/usr/share/man/openmpi-x86_64

Oddly, this sequence works (% => zsh prompt; $ => bash prompt):
% module purge
% module load mpi
% man ls
No manual entry for ls
% bash
$ module list
Currently Loaded Modulefiles:
 1) mpi/openmpi-x86_64   2) python-sphinx/python2-sphinx
$ man -w ls
/usr/share/man/man1/ls.1.gz
$ zsh
% module list
Currently Loaded Modulefiles:
 1) mpi/openmpi-x86_64   2) python-sphinx/python2-sphinx
% man -w ls
/usr/share/man/man1/ls.1.gz
% echo $MANPATH
/usr/share/man:/usr/share/man/openmpi-x86_64
% exit
$ echo $MANPATH
/usr/share/man:/usr/share/man/openmpi-x86_64
$ man -w ls
/usr/share/man/man1/ls.1.gz
$ exit
% echo $MANPATH
/usr/share/man/openmpi-x86_64
% man -w ls
No manual entry for ls

It also works this way:
% module purge
% module load mpi
% man -w ls
No manual entry for ls
% zsh
% man -w ls
/usr/share/man/man1/ls.1.gz
% module purge
% module load mpi
% man -w ls
/usr/share/man/man1/ls.1.gz
% exit
% man -w ls
No manual entry for ls

I hope that helps....

Comment 12 Xavier Delaruelle 2019-04-25 15:55:10 UTC
(In reply to Karl from comment #11)
> Reopening---I upgraded to environment-modules-4.2.3-1.fc29, and this still
> happens. It appears to have been fixed in bash, just not in zsh. Steps to
> reproduce in zsh (zsh-5.6.2-3.fc29):
> 
> % module -V
> Modules Release 4.2.3 (2019-03-23)
> % module purge
> % man -w ls
> /usr/share/man/man1/ls.1.gz
> % module load mpi
> % man -w ls
> No manual entry for ls
> % manpath
> manpath: warning: $MANPATH set, ignoring /etc/man_db.conf
> /usr/share/man/openmpi-x86_64
> 
> Oddly, this sequence works (% => zsh prompt; $ => bash prompt):
> % module purge
> % module load mpi
> % man ls
> No manual entry for ls
> % bash
> $ module list
> Currently Loaded Modulefiles:
>  1) mpi/openmpi-x86_64   2) python-sphinx/python2-sphinx
> $ man -w ls
> /usr/share/man/man1/ls.1.gz
> $ zsh
> % module list
> Currently Loaded Modulefiles:
>  1) mpi/openmpi-x86_64   2) python-sphinx/python2-sphinx
> % man -w ls
> /usr/share/man/man1/ls.1.gz
> % echo $MANPATH
> /usr/share/man:/usr/share/man/openmpi-x86_64
> % exit
> $ echo $MANPATH
> /usr/share/man:/usr/share/man/openmpi-x86_64
> $ man -w ls
> /usr/share/man/man1/ls.1.gz
> $ exit
> % echo $MANPATH
> /usr/share/man/openmpi-x86_64
> % man -w ls
> No manual entry for ls
> 
> It also works this way:
> % module purge
> % module load mpi
> % man -w ls
> No manual entry for ls
> % zsh
> % man -w ls
> /usr/share/man/man1/ls.1.gz
> % module purge
> % module load mpi
> % man -w ls
> /usr/share/man/man1/ls.1.gz
> % exit
> % man -w ls
> No manual entry for ls
> 
> I hope that helps....

I have just found that Zsh is initializing the MANPATH variable to an empty value when it starts.

So Modules initialization script for the zsh shell should set MANPATH to ':' (in order to preserve manpath system configuration) if MANPATH variable is found unset or empty.

I have reopened the issue upstream [1] and a fix for it will be available on next bugfix release (4.2.4)

[1] https://github.com/cea-hpc/modules/issues/224

Comment 13 Xavier Delaruelle 2019-04-26 11:32:42 UTC
Version 4.2.4 has just been released upstream. This new bugfix version fixes this issue.

Comment 14 Fedora Update System 2019-04-29 14:31:28 UTC
environment-modules-4.2.4-1.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1defad0bd1

Comment 15 Fedora Update System 2019-04-29 14:31:32 UTC
environment-modules-4.2.4-1.fc30 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-b594fbaf97

Comment 16 Fedora Update System 2019-04-30 02:49:15 UTC
environment-modules-4.2.4-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-b594fbaf97

Comment 17 Fedora Update System 2019-04-30 03:40:19 UTC
environment-modules-4.2.4-1.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1defad0bd1

Comment 18 Karl 2019-05-03 04:18:51 UTC
Seems to be working now. Thanks!

Comment 19 Fedora Update System 2019-05-08 01:12:11 UTC
environment-modules-4.2.4-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2019-05-08 03:04:30 UTC
environment-modules-4.2.4-1.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.