In Progress EA-9789 - NGINX Anacron Logrotate Error

Operating System & Version
Centos 7
cPanel & WHM Version
11.94.0.4

finna

Registered
Apr 4, 2021
3
1
3
Madripoor
cPanel Access Level
Root Administrator
Hi,

I enabled NGINX after reading of it's availability and watching the demonstration video with cPanelAdam.

Now getting the following error on Anacron job 'cron.daily':

Bash:
/etc/cron.daily/logrotate:

Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1-ssl_log of '/var/log/nginx/domains/* '
isa check for "path" failed: Pattern given instead of single file (logrotate’s `sharedscripts` enabled?)
error: error running non-shared postrotate script for /var/log/nginx/domains/cpanel.* of '/var/log/nginx/domains/* '
isa check for "path" failed: Pattern given instead of single file (logrotate’s `sharedscripts` enabled?)
error: error running non-shared postrotate script for /var/log/nginx/domains/cpanel.*-bytes_log of '/var/log/nginx/domains/* '
Some system info:

operating_system_name: centos
operating_system_version: 7

WHM Version:
version: 11.94.0.4

Thanks
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,491
1,008
313
cPanel Access Level
Root Administrator
Hey there! I'm not finding much on my end for this error as there are many similar cron messages, but not that specific issue with nginx. I did send @cPanelAdam a message on this, but he actually has today off so I won't hear back until tomorrow. I'll keep this thread marked as new for now and let you know once I have more details.
 

allpar

Well-Known Member
Sep 16, 2005
53
3
158
FWIW, I do have it, but only when run by cron; not when entered manually.:

/etc/cron.daily/logrotate:

Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1 of '/var/log/nginx/domains/* '
Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1-bytes_log of '/var/log/nginx/domains/* '
Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1-ssl_log of '/var/log/nginx/domains/* '

(and so on)
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,491
1,008
313
cPanel Access Level
Root Administrator
The update for case EA_9673, which is what the original case of CPANEL-36504 was turned into, was released on April 14. Since it is an EasyApache update, it is not tied to a specific version of cPanel.

@allpar - can you let me know what version of ea-nginx you are using? 1.19.9 or higher would have the fix applied.
 

matt1206

Active Member
Dec 20, 2011
43
2
58
cPanel Access Level
Root Administrator
The update for case EA_9673, which is what the original case of CPANEL-36504 was turned into, was released on April 14. Since it is an EasyApache update, it is not tied to a specific version of cPanel.

@allpar - can you let me know what version of ea-nginx you are using? 1.19.9 or higher would have the fix applied.
Was this fixed, or has the issue been reintroduced?

updated a bunch of my servers to the latest version of cPanel and installed the nginx for reverse caching.

All of them started reporting this now

Code:
/etc/cron.daily/logrotate:

Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1-bytes_log of '/var/log/nginx/domains/* '
Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1-ssl_log of '/var/log/nginx/domains/* '
 

grogo

Registered
May 23, 2021
4
0
1
Italy
cPanel Access Level
Root Administrator
Hi all,

Same error here since enabled NGINX reverse proxy.

Bash:
rpm -qa | grep ea-nginx
ea-nginx-1.20.0-5.5.2.cpanel.x86_64
Error from Anacron job 'cron.daily'
Code:
Could not determine owner of “127.0.0.1”
error: error running non-shared postrotate script for /var/log/nginx/domains/127.0.0.1-ssl_log of '/var/log/nginx/domains/* '
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,491
1,008
313
cPanel Access Level
Root Administrator
Our team has done some additional testing with this issue and created the following article to help resolve this:


We are working on this in case EA-9789 and I'll be sure to pose an update once I have more details. You can also follow along with that support article if you are signed in to the ticket system for further updates.
 
Last edited:

grogo

Registered
May 23, 2021
4
0
1
Italy
cPanel Access Level
Root Administrator
Hello @cPRex , Zendesk attached link doesn't seem to work.

However, I've successfully opened a ticket; i'll post here what cPanel Support suggested to do


In any case, I did some research to determine what we know about this reported issue so far. And as I understand it, although the word 'error' is mentioned in the output, this could be treated as informational and may be related to the rate that the nginx logs are rotated. We've seen this issue in relation to AWstats and had the following support article which provided a workaround to that effort here:

Statistics programs such as AWstats show either old visitor information or no information when Nginx is in use

Otherwise, the notifications could be suppressed. To do so you would need to add the following to /etc/logrotate.conf anywhere after the "create" statement:
Code:
# Do not send e-mail with the last rotated log
nomail
Once completed you would then need to restart the cron system in your server:
Code:
/scripts/restartsrv_crond
Despite that solution was successfully applied, I'm still getting "logrotate.log" every day in my mailbox.

Update
cPanel support just updated my case with additional details:

Fortunately, we've been looking into the origin of this issue further and have uncovered more effective workarounds as well as the reason this is occurring in the first place. You can find the relevant insights in our newly published article here: logrotate returns "Could not determine owner of “127.0.0.1”" for Nginx logs.
 
Last edited by a moderator:

cPJustinD

Administrator
Staff member
Jan 12, 2021
286
51
103
Houston
cPanel Access Level
Root Administrator
This appears to be related to an internal case that was recently filed, EA-9789.

To address this error, we advise removing the offending log file cited in the error from the location '/var/log/nginx/domains/'. These should not be generated during normal requests and only occur after a Nginx service restart if page requests have been made to localhost/127.0.0.1.
More information on this can be found here:
logrotate returns "Could not determine owner of “127.0.0.1”" for Nginx logs
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,491
1,008
313
cPanel Access Level
Root Administrator
Update - this issue is resolved with version 1.21 of the ea-nginx package. Since this is an RPM build, it's not tied to any specific version of cPanel, although versions 94 and 96 both currently download that version by default.