cPanel has some bugs. If you are trying to install a cPAddon and only see this error message:
Unable to set configuration! This will need done manually!
You may be falling prey to a bug in the procconfigfile
sub. This is located in /usr/local/cpanel/Cpanel/cPAddons.pm
.
The fault lies in the usage of _log_say()
, which utilizes print().
Normally that would be fine except that procconfigfile()
replaces the STDOUT pointer (due to mapping) that print defaults to using. This is only a temporary and is shortly restored – but it does obscure the error message.
This fix is to update the WARN call (circa line 2662):
my $inplace_errors = '';
my $inplace_error_count = 0;
{
# my %inplace_errors;
local $^I = '.bak';
local @ARGV = map { "$dir/$_" } @{$fls};
local $SIG{'__WARN__'} = sub {
# my $err = shift();
# $inplace_errors{$ARGV} = {
# 'errno_int' => int($!),
# 'errno_str' => "$!",
# 'raw_warn' => $err,
# };
$inplace_error_count++;
$inplace_errors .= "Could not open $ARGV: $!";
};
And then print out the error messages at the end of the function:
_log_say($inplace_errors) if $inplace_errors ne '';
rnreturn if $inplace_error_count;
rnreturn 1;
Happy debugging. In my case, it turned out that the configuration files were not being created because the site layout tarball that I had uploaded was not world-readable (cPanel extracts it as the user that is installing).
Once you know the location of the cPAddon processing code, the rest becomes easier. Hopefully you already know Perl if you are creating a new cPAddon.