SOLVED error: Ignoring alt-phpxx-newrelic-daemon because of bad file mode - must be 0644 or 0444.

webicom

Well-Known Member
PartnerNOC
Mar 30, 2004
57
1
158
Slovenia
Hello,

Today I got error:

Anacron job 'cron.daily' on server.xxxxx.com

/etc/cron.daily/logrotate:
error: Ignoring alt-php70-newrelic-daemon because of bad file mode - must be 0644 or 0444.
error: Ignoring alt-php70-newrelic-php5 because of bad file mode - must be 0644 or 0444.
error: Ignoring alt-php71-newrelic-daemon because of bad file mode - must be 0644 or 0444.
error: Ignoring alt-php71-newrelic-php5 because of bad file mode - must be 0644 or 0444.
error: Ignoring alt-php72-newrelic-daemon because of bad file mode - must be 0644 or 0444.

error: Ignoring alt-php72-newrelic-php5 because of bad file mode - must be 0644 or 0444.

How can I fix this?

Best regards, Erik
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
Hello,

It would appear that there are bad permissions on the newrelic related alt-php extensions. You'd need to change them to the suggested 644 or 444 for more information on where these are stored you should check out the CloudLinux documentation here: CloudLinux Documentation

Thanks!
 

Rich Badaracco

Registered
Jun 29, 2016
2
0
1
Longs, SC
cPanel Access Level
Root Administrator
Just in case this response was not helpful. I'll share how I found it. I used the find command, find / -name "alt-php70-newrelic-daemon" to locate the file. I found them in etc/logrotate.d/ and the files in the error email had permissions of 755 and were modified on 6/21/18. Hope this helps.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
Hi @Rich Badaracco

Thanks for the update, seems odd the files in question would be in the location you're noting but none the less thank you for adding here the solution that worked for you
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
458
113
UK
cPanel Access Level
Root Administrator
seems odd the files in question would be in the location
These files are the logrotate configuration files for the newrelic logs (that are in /var/log/) and are read by /etc/logrotate.conf that includes any files dropped into /etc/logrotate.d

It does seem strange that they should have been set as 0755 (which is essentially 0644 plus the execute flag).

The files are only txt content eg
Code:
/var/log/alt-php70-newrelic/newrelic-daemon.log {
    rotate 7
    daily
    missingok
    notifempty
    sharedscripts
    copytruncate
    compress
}
and, as such, should not require an executable flag to be set - it should be sufficient that they can be globally read (0444) as a minimum requirement, but future updates may have issues overwriting the files unless they are set to 0644

I suspect someone running a Windows OS was responsible for packaging the files for the update :(
 
Last edited:
  • Like
Reactions: sneader

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
These files are the logrotate configuration files for the newrelic logs (that are in /var/log/) and are read by /etc/logrotate.conf that includes any files dropped into /etc/logrotate.d
I understood what they are just seemed odd it was the logrotate files that were causing the issue, my first assumption would have been files located in CloudLinux's alt-php directory
opt/alt/php70/usr/bin/newrelic-daemon. None the less now that I re-read the original error it makes a lot more sense that it would lead to the logrotate files.

While this is a CloudLinux issue I took another look through our ticket system to see if we have any reports on this and this time I found a few. It looks like the proper resolution would be to do something like:

Code:
rpm --setperms  alt-php70-newrelic-daemon
Since the RPM has the incorrect permissions

In general though it may be best to contact CloudLinux directly Submit a request – CloudLinux
 

Mark West

Registered
Jul 6, 2018
1
2
0
United Kingdom
cPanel Access Level
Root Administrator
I logged a ticket with Cloudlinux - this is their reply:

Just perform the following command:
chmod 644 /etc/logrotate.d/alt-php*
You will not receive such notices anymore.

I have also created an internal task for our development team to fix it permanently in the future releases of alt-php packages.
The task ID is ALTPHP-536. You may want to subscribe to our blog CloudLinux - Main | New template . The ID will be posted there when fixed.
 
  • Like
Reactions: benito and sneader

nullmem

Member
Jan 21, 2018
11
1
3
Austin, TX
cPanel Access Level
Root Administrator
The problem is back, this time for alt-php73:

error: Ignoring alt-php73-newrelic-daemon because of bad file mode - must be 0644 or 0444.
error: Ignoring alt-php73-newrelic-php5 because of bad file mode - must be 0644 or 0444.
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
458
113
UK
cPanel Access Level
Root Administrator
I have just installed alt-php73, and confirm that the 2 files mentioned in the above post both have the execute flag set on them.

This seems to be exactly what happened the last time - so I guess Cloudlinux haven't learned yet :(
 

Lawrence Wright

Registered
Apr 11, 2012
2
3
53
cPanel Access Level
Root Administrator
The solution as mentioned by Mark West is to run this on any affected server.
Code:
chmod 644 /etc/logrotate.d/alt-php*
To confirm, run the following command.
Code:
stat -c "%a %n" /etc/logrotate.d/alt-php*
The output should show 644 for each of the files.
Code:
[[email protected]]# stat -c "%a %n" /etc/logrotate.d/alt-php*
644 /etc/logrotate.d/alt-php70-newrelic-daemon
644 /etc/logrotate.d/alt-php70-newrelic-php5
644 /etc/logrotate.d/alt-php71-newrelic-daemon
644 /etc/logrotate.d/alt-php71-newrelic-php5
644 /etc/logrotate.d/alt-php72-newrelic-daemon
644 /etc/logrotate.d/alt-php72-newrelic-php5
644 /etc/logrotate.d/alt-php73-newrelic-daemon
644 /etc/logrotate.d/alt-php73-newrelic-php5