error: Ignoring alt-phpxx-newrelic-daemon because of bad file mode - must be 0644 or 0444.
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
-
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! 0 -
One thing to note (I too have encountered this error) this error seems to have been triggered after the extensions update yesterday. 0 -
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. 0 -
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 0 -
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/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 :(0 -
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: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 " CloudLinux0 -
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. 0 -
Hi @Mark West That's great to know, I'm glad they've opened a case on it and glad you got their official solution. Thank you for updating here. 0 -
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. 0 -
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 :( 0 -
The solution as mentioned by Mark West is to run this on any affected server. chmod 644 /etc/logrotate.d/alt-php*
To confirm, run the following command.stat -c "%a %n" /etc/logrotate.d/alt-php*
The output should show 644 for each of the files.[root@server]# 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-php50
Please sign in to leave a comment.
Comments
11 comments