Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't locate loadable object for module main in @INC

In a mod_perl application running on ubuntu 16.04 after a certain while where everything functions fine (a few days) we get a fatal message in the errorlog:

failed to resolve handler MyHandler::ModPerl20 Can't locate loadable object for module main in @INC

MyHander::ModPerl20 is defined in a location block

<Perl>
     unshift @INC, '/path/to/my/code';
</Perl>
<Location ~ "/imp($|/)">
    SetHandler modperl
    PerlResponseHandler MyHandler::ModPerl20
</Location>

The ubuntu Perl Version is 5.22. Apache 2.4

Can this be the problem? http://blog.feature-addons.de/2016-05-15-otrs-apache-mod-perl-perl-5-22

Any ideas how to fix this? Do I really have to set up nginx/uwsgi?

like image 474
Georg Mavridis Avatar asked Jan 20 '17 16:01

Georg Mavridis


2 Answers

Make sure @INC is set up correctly, in order to find the path in which MyHandler::ModPerl20 is installed (I think what happens is that when Apache recycles some child, the one starting fresh do not have the correct @INC value, hence not finding your module anymore).

Try to add a PerlSwitches -I/your/path/for/myhandler/ in httpd.conf to see if it fixes your problem.

If that changes things, have a look at Adjusting @INC in modperl documentation to see all details.

like image 56
Patrick Mevzek Avatar answered Oct 11 '22 14:10

Patrick Mevzek


Changing the MPM Apache configuration from mpm_event to mpm_prefork solved my problem.

It does not explain the error message though :( Any hints on this are appreciated.

like image 39
Georg Mavridis Avatar answered Oct 11 '22 15:10

Georg Mavridis