Bug 1980948

Summary: logrotate of nginx error_log reports gzip: stdin: file size changed while zipping
Product: [Fedora] Fedora EPEL Reporter: Kenneth Porter <shiva>
Component: nginxAssignee: Felix Kaechele <felix>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: felix, hello, jeremy, jkaluza, jorton, luhliari, ollie.yeoh, pavel.lisy, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nginx-1.20.1-9.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-27 02:41:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kenneth Porter 2021-07-10 03:48:33 UTC
Daily logrotate intermittently reports "gzip: stdin: file size changed while zipping". Setting it to --verbose reveals that nginx is still writing to one of its logs. I'm adding delaycompress to its logrotate config file. Verbose report:

rotating pattern: /var/log/nginx/*.log  after 1 days (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/nginx/access.log
  log needs rotating
considering log /var/log/nginx/error.log
  log needs rotating
rotating log /var/log/nginx/access.log, log->rotateCount is 10
dateext suffix '-20210709'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
rotating log /var/log/nginx/error.log, log->rotateCount is 10
dateext suffix '-20210709'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
fscreate context set to unconfined_u:object_r:httpd_log_t:s0
renaming /var/log/nginx/access.log to /var/log/nginx/access.log-20210709
creating new /var/log/nginx/access.log mode = 0640 uid = 990 gid = 0
fscreate context set to unconfined_u:object_r:httpd_log_t:s0
renaming /var/log/nginx/error.log to /var/log/nginx/error.log-20210709
creating new /var/log/nginx/error.log mode = 0640 uid = 990 gid = 0
running postrotate script
compressing log with: /bin/gzip
set default create context to unconfined_u:object_r:httpd_log_t:s0
removing old log /var/log/nginx/access.log-20210628.gz
compressing log with: /bin/gzip
set default create context to unconfined_u:object_r:httpd_log_t:s0
gzip: stdin: file size changed while zipping
removing old log /var/log/nginx/error.log-20210628.gz

Comment 1 Felix Kaechele 2021-10-08 02:24:42 UTC
Hi Kenneth,

thanks for taking the time to report this. The notification email must have slipped through the cracks. Sorry about that.

I have queued your fix for the next version.

Thanks again!

Comment 2 Fedora Update System 2021-10-19 00:41:09 UTC
FEDORA-EPEL-2021-4297ff9918 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-4297ff9918

Comment 3 Fedora Update System 2021-10-19 16:12:04 UTC
FEDORA-EPEL-2021-4297ff9918 has been pushed to the Fedora EPEL 7 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2021-4297ff9918

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2021-10-27 02:41:47 UTC
FEDORA-EPEL-2021-4297ff9918 has been pushed to the Fedora EPEL 7 stable repository.
If problem still persists, please make note of it in this bug report.