Bug #6439
closedrudder-agent is stuck, waiting for user input during log compression
Description
rudder 3.0.2
If I run manually "cf-agent -KI" on the policy server, it is apparently stuck right after:
2015-03-26T09:25:55+0100 info: /default/root_component_check/methods/'any'/default/compress_webapp_log/files/'/var/log/rudder/webapp'[0]: Transforming '/bin/gzip "/var/log/rudder/webapp/2015_03_13.stderrout.log"'
After some time I got bored and pressed Enter, and I could see the following log line:
2015-03-26T09:26:02+0100 info: /default/root_component_check/methods/'any'/default/compress_webapp_log/files/'/var/log/rudder/webapp'[0]: gzip: /var/log/rudder/webapp/2015_03_13.stderrout.log.gz already exists; do you wish to overwrite (y or n)? not overwritten 2015-03-26T09:26:02+0100 error: /default/root_component_check/methods/'any'/default/compress_webapp_log/files/'/var/log/rudder/webapp'[0]: Finished command related to promiser '/var/log/rudder/webapp' -- an error occurred, returned 2 2015-03-26T09:26:02+0100 error: /default/root_component_check/methods/'any'/default/compress_webapp_log/files/'/var/log/rudder/webapp'[0]: Transformer '/var/log/rudder/webapp/2015_03_13.stderrout.log' => '/bin/gzip "/var/log/rudder/webapp/2015_03_13.stderrout.log"' returned error
Then it's stuck the same way for 2015_03_16.stderrout.log…
I guess you should do what's necessary to ensure the commands called are not in interactive mode. ;-)
Thanks.
Updated by François ARMAND over 9 years ago
Hello,
Thanks for the report. As far as I understand, there is two problems here:
- of course gzip should not be used in interactive mode ever !
- we have already an archive for the 2015_03_13 logs. This should not happen.
For the second part, I can see two causes, and 4 choices about what to do. Let's start with the choices:
if both xxx and xxx.gz exists:
- 1/ do nothing
- 2/ keep the gz and delete the xxx
- 3/ delete the gz and gzip the xxx (or overwrite the existing gz)
- 4/ create a xxx.1.gz (or any other unique id that it is an other archive for the log - maybe a timestamp, so that it is really unique without dealing with incrementing things)
So for the possible cause to have both files present:
- 1/ some user uncompressed the archive not in place (to keep both, for example with gunzip c or gzcat) 2/ somehow, the application created some more entries in the xxx file (rotated to early ? badly closed file descriptor ? )
The cause 2 is the one we want to manage correctly, because it means that loosing any file loose information. By consequence, choice 2 and 3 are not possible. I don't know what is the best one, thought.
Updated by François ARMAND over 9 years ago
- Category set to System integration
- Status changed from New to 8
- Assignee set to Benoît PECCATTE
- Priority changed from N/A to 2
- Target version set to 2.10.13
Moreover, perhaps we should treat the two problems in two bugs. But they seem rather hard linked one to each other.
Benoit, any thought ?
Updated by Nicolas CHARLES over 9 years ago
I got stuck as well, on a freshly installed server. Don't know why it compressed immediately the log thought
Updated by Benoît PECCATTE over 9 years ago
- Found in version(s) old 3.0.3 added
We think the problem is:
- We use the range between 2 days ago and now to detect is a file should not be compressed
- If the current log file is written during execution, its change time will be after the "now" of cfengine
- The techniques then decides to compress current log whereas it shouldn't
Updated by Benoît PECCATTE over 9 years ago
- Status changed from 8 to In progress
Updated by Benoît PECCATTE over 9 years ago
- Target version changed from 2.10.13 to 2.11.10
Updated by Benoît PECCATTE over 9 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Benoît PECCATTE to Nicolas CHARLES
- Pull Request set to https://github.com/Normation/rudder-techniques/pull/646
Updated by Benoît PECCATTE over 9 years ago
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset rudder-techniques|commit:1f7f56122d08459c0368cd8d3910526641b6d9de.
Updated by Nicolas CHARLES over 9 years ago
Applied in changeset rudder-techniques|commit:8a457fec01a20dba461755e2be27b000c7ff38af.
Updated by Vincent MEMBRÉ over 9 years ago
- Subject changed from Stuck waiting for user input during log compression to rudder-agent is stuck, waiting for user input during log compression
Updated by Vincent MEMBRÉ over 9 years ago
This bug has been fixed in Rudder 2.11.10 and 3.0.4 which were released today.
- Announcement 2.11 3.0
- Changelog 2.11 3.0
- Download information: https://www.rudder-project.org/site/get-rudder/downloads/
Updated by Vincent MEMBRÉ over 9 years ago
- Status changed from Pending release to Released
Updated by Alexis Mousset over 9 years ago
- Related to Bug #6676: rudder-agent is stuck, waiting for user input during log compression (on 2.10) added
Updated by Nicolas CHARLES over 9 years ago
- Related to Bug #6995: rudder-agent is stuck, waiting for user input during log compression added