sozotech

Well-Known Member
Jul 26, 2013
107
5
68
cPanel Access Level
Root Administrator
After our one of our cPanel servers upgraded to version 60.0.25 one of the customers perl/CGI sites broke. For some reason calling just the script names in his program is saying the perl files are not found.

If I include the cgi-bin in the path of his programs like so it works.

use lib "/home/username/public_html/cgi-bin";

What could have changed to cause this? Is there a way to set the path globally for his account?

Best regards,
Eric
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,224
463
Hello Eric,

Could you verify if this system uses CloudLinux with CageFS enabled? Also, could you provide an example of a script used on the account to reproduce the issue?

Thank you.
 

sozotech

Well-Known Member
Jul 26, 2013
107
5
68
cPanel Access Level
Root Administrator
Yes, it is Cloud Linux with CageFS on. Below is a sanitized version of the script. Also, since posting this message we have also opened a ticket 8027625 but I am not sure it has been worked on yet.

#!/usr/bin/perlml

use lib "/home/username/public_html/cgi-bin"; HAD TO ADD THIS TO MAKE IT WORK

use CGI;
$query = new CGI;
$intPageID = $query->param('intPageID');
$strSecToken = $query->param('strSecToken');


### Load the database module.
use DBI;
$db = DBI->connect("DBI:mysql:DBWebsite:localhost","DB_USER","DB_PASS");


### Get the page title, content, and associated script (if any).
$queryGetPageContent = $db->prepare("SELECT strPageTitle, strPageContent, strPageScript FROM pageDefs WHERE intPageID = ? LIMIT 1;");
$queryGetPageContent->execute($intPageID);
$strError = $queryGetPageContent->errstr;
@dataPage = $queryGetPageContent->fetchrow_array;
$queryGetPageContent->finish;


if ($strError) {$strReturn = "Failed|E01: Page could not be loaded. $strError";}
else {

if (!$dataPage[1]) {$dataPage[1] = " ";}

### If there's a script for this page, run it.
if ($dataPage[2]) {
require $dataPage[2];
}
else {$strScriptResult = " ";}

if ($strErrorCode) {$strReturn = "Failed|$strErrorCode|$dataPage[0]|$dataPage[1]|$strScriptResult";}
else {$strReturn = "Success||$dataPage[0]|$dataPage[1]|$strScriptResult";}

}


### Return some HTML.
print "Content-type: text/html\n\n$strReturn";


### Buh-bye.
exit;
Thanks,
Eric
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,224
463
Yes, it is Cloud Linux with CageFS on.
Try running the following command and let us know if the issue persists:

Code:
cagefsctl --force-update
Thank you.
 

sozotech

Well-Known Member
Jul 26, 2013
107
5
68
cPanel Access Level
Root Administrator
Ok, I ran that command and removed the path statement in the script and it is still not working so I had to put it back in.

Eric
 

sozotech

Well-Known Member
Jul 26, 2013
107
5
68
cPanel Access Level
Root Administrator
Ok, mysteriously disabling CageFS and then re-enabling has fixed the site. We're gonna continue to monitor this. Not sure how that would fix it.

Eric
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,224
463
Hello,

This document may offer some insight on this topic:

CloudLinux Documentation

In particular, this entry:

You have to run cagefsctl --update any time you have modified php.ini, or you want to get new/updated software inside CageFS.
You can also reach out directly to CloudLinux support if you'd like them to take a closer look and determine how CageFS related to the specific issue:

CloudLinux - Main | New template

Thank you.
 

sozotech

Well-Known Member
Jul 26, 2013
107
5
68
cPanel Access Level
Root Administrator
This same account and server is also having problems with installing Perl modules from cpanel. When I try to get a list of modules I get the following error: "There was a problem fetching the list of available modules."

The only error I see in /usr/local/cpanel/logs/error_log is the following when I open the perl modules page.

Insecure dependency in chdir while running setgid at /usr/share/perl5/File/Find.pm line 834.

Any clue on how to fix this. There error looks like a recurring problem but nothing else on the forum seems to have fixed it for me.

Best regards,
Eric
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,224
463
Hello,

Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

Thank you.