New rt5 installation Can't locate warnings.pm

Hi RTs,

If someone can help me with a new RT5 installation on RHEL8. I’m getting the error below

    Can't locate warnings.pm:   /usr/local/lib64/perl5/warnings.pm: Permission denied at /opt/rt5/sbin/rt-server.fcgi line 49.
    BEGIN failed--compilation aborted at /opt/rt5/sbin/rt-server.fcgi line 49.
    [Fri Jun 25 12:51:58.968726 2021] [fcgid:info] [pid 1592:tid 140276781975872] mod_fcgid: process /opt/rt5/sbin/rt-server.fcgi(2183) exit(communication error), terminated by calling exit(), return code: 13

I check the permission and as show below:
-rwxr-xr-x. 1 apache apache 5807 Jun 24 01:22 rt-server.fcgi

/etc/httpd/conf.d/fcgid.conf
[root@rt:conf.d]$ cat fcgid.conf
# This is the Apache server configuration file for providing FastCGI support
# through mod_fcgid
# Use FastCGI to process .fcg .fcgi & .fpl scripts
AddHandler fcgid-script fcg fcgi fpl

    # Sane place to put sockets and shared memory file
    FcgidIPCDir /run/mod_fcgid
    FcgidProcessTableFile /run/mod_fcgid/fcgid_shm
    FcgidMaxRequestLen 1073741824

/etc/httpd/conf.d
rt.conf

    <VirtualHost *:80>
    # RT4 configuration for Apache
    #
    # With minor changes, this configuration is based on the original documentation:
    # https://docs.bestpractical.com/rt/4.4.2/web_deployment.html
    #
    ### Optional apache logs for RT
    # Ensure that your log rotation scripts know about these files
    # ErrorLog /opt/rt5/var/log/apache2.error
    # TransferLog /opt/rt5/var/log/apache2.access
    LogLevel debug
    ErrorLog /var/log/httpd/rt.error.log
    CustomLog /var/log/httpd/rt.access.log combined

    AddDefaultCharset UTF-8

    Alias /NoAuth/images/ /opt/rt5/share/html/NoAuth/images/
    ScriptAlias / /opt/rt5/sbin/rt-server.fcgi/

    DocumentRoot "/opt/rt5/share/html"

    <Location />
      Require all granted
      Options +ExecCGI
      AddHandler fcgid-script fcgi
    </Location>
    </VirtualHost>

Thank you,
David

If you turn off Apache and just run the web server manually /opt/rt5/sbin/rt-server does that work? Also is apache the Linux user/group for Apache on redhat?

Hi knation,

Yes, the stand-alone works fine and no issues. I can log in browse and etc.
apache is the user and group in redhat.
I do not know what I’m doing wrong, but It sounds like permission

Thank you

You can try running make fixperms from the RT source files, maybe some file system rights got messed up. Also, you can check that you don’t have SELinux enabled?

I try make fixperms as per your advice, but still the same issue. The selinux was disable from the start

Can't locate warnings.pm: /usr/local/lib64/perl5/warnings.pm: Permission denied at /opt/rt5/sbin/rt-server.fcgi line 49.

root@rt:rt-5.0.1]$ locate warnings.pm
/usr/local/lib64/perl5/warnings.pm
/usr/share/perl5/warnings.pm
/usr/share/perl5/encoding/warnings.pm

Hey there,

I’m been using RT5 on CentOS8 for sometime now, not sure why your issue is happening but my install hasn’t needed a local/[…]/warnings.pm file

# find / -xdev -name warnings.pm
/usr/share/perl5/encoding/warnings.pm
/usr/share/perl5/warnings.pm

Can you try something like this and what happens?

[root@rt5 conf.d]# su - apache -s /bin/bash

[apache@rt5 ~]$ perl -d -e 1

Loading DB routines from perl5db.pl version 1.51
Editor support available.

Enter h or 'h h' for help, or 'man perldebug' for more help.

main::(-e:1):	1
  DB<1> use warnings;

  DB<2>

Hi cgb,

Thanks for the help. ;-(

step 1
[root@rt:~]$ find / -xdev -name warnings.pm

the output is empty

step 2
[root@rt:~]$ su - apache -s /bin/bash
[apache@rt:~]$ perl -d -e 1
Can’t locate perl5db.pl: /usr/local/lib64/perl5/perl5db.pl: Permission denied.
BEGIN failed–compilation aborted.

It seems that is pointing the wrong lib path. Do you know why? any ideas.

Thanks a lot

Stuff in /usr/local/ is usually things you’ve compiled yourself. Have you installed Perl by hand from source rather than use the system RPM package?

Hi Green,

NO that I know off.

I use these steps to install all the Perl modules:

curl -L http://cpanmin.us | perl - --sudo App::cpanminus
wich cpanm
/usr/local/bin/cpnam
export RT_FIX_DEPS_CMD=/usr/local/bin/cpanm

Any new missing module I just installed using cpanm perl.module

Hi Guys,

Thanks a lot for you guide me to the right direction. After I read more on the documentation. I found the solution for my errors. The solution was on rt docs permission was the culprit. Just in case someone experiencing the same issue. Here is the solution.

cpanminus

C<cpanminus>, or C<cpanm>, is a utility built to make it as easy as possible
to install modules from CPAN. You can install the L<App::cpanminus> module
itself from CPAN, or have it install itself:

    curl -L http://cpanmin.us | perl - --sudo App::cpanminus

Once installed, set the C<RT_FIX_DEPS_CMD> environment variable to
have RT use C<cpanm> to install modules:

    export RT_FIX_DEPS_CMD=/opt/perl/bin/cpanm

Then run C<make fixdeps> and let RT install all of its dependencies.

Permission Problems with Installed Perl Modules

After running C<make fixdeps> using one of the configurations above, you might see
errors like this when starting Apache and trying to access RT:

    Can't locate UNIVERSAL/require.pm in @INC (@INC contains: /opt/rt5/sbin/../local/lib
    /opt/rt5/sbin/../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at
    /opt/rt5/sbin/../lib/RT.pm line 60.
    BEGIN failed--compilation aborted at /opt/rt5/sbin/../lib/RT.pm line 60.

The reported module might be different depending on how the modules were installed.

If you look for the module as a privileged user with a command like
C<perldoc UNIVERSAL::require> the module will be found and in one
of the paths reported in C<@INC>. So why can't it be located?

One possible cause for this issue is the default umask on the system. Some Linux
security hardening guides recommend changing the default umask from a default like
C<0002> to a more restrictive value like C<0007>. One result of this is that all
of the installed modules will have incorrect permissions for C<everyone>.

Assuming the umask can't be changed, one fix is to update the permissions on the
directories where the perl modules were installed. The following works on RHEL 7,
update the paths for other perl module locations:

    **# Fix permissions on /usr/local/share/perl5 recursively**
    > find /usr/local/share/perl5 -type d -exec chmod o+rx {} \;

    # Same for /usr/local/lib64/perl5
    > find /usr/local/lib64/perl5 -type d -exec chmod o+rx {} \;

You might experience the same issue when installing extensions.

    # Fix same issue on RT local directories if needed
    > find /opt/rt5/local -type d -exec chmod o+rx {} \;
1 Like