cfy logs download fails due to tar: 'file changed as we read it'

Description

When a service writes frequently into log, the command "cfy logs download" can't make log archive.

[centos@cloudify ~]$ cfy logs download -vvv
[centos@localhost] sudo: journalctl > /tmp/jctl && mv /tmp/jctl /var/log/cloudify/journalctl.log
Creating logs archive in manager: /tmp/cloudify-manager-logs_20181113T111556_localhost.tar.gz
[centos@localhost] sudo: tar -czf /tmp/cloudify-manager-logs_20181113T111556_localhost.tar.gz -C /var/log cloudify
[centos@localhost] out: tar: cloudify/nginx/cloudify.access.log: file changed as we read it
[centos@localhost] out: tar: cloudify/stage/app.log: file changed as we read it
[centos@localhost] out: tar: cloudify/stage/access.log: file changed as we read it
[centos@localhost] out:

Warning: sudo() received nonzero return code 1 while executing 'tar -czf /tmp/cloudify-manager-logs_20181113T111556_localhost.tar.gz -C /var/log cloudify'!

Failed to execute: sudo -S -p 'sudo password:' /bin/bash -l -c "tar -czf /tmp/cloudify-manager-logs_20181113T111556_localhost.tar.gz -C /var/log cloudify" ()

Steps to Reproduce

Environment:
OS (CLI), HA cluster, cloud provider
------------------------------------
CM 4.5, single or cluster

Steps to reproduce:
------------------
1. generate traffic to NGINX. For example: ab -n 5000 http://10.239.2.10/
2. run the command: cfy logs download -vvv
3. Get error

Expected result:
---------------

Actual result:
-------------

Why Propose Close?

None

Activity

Show:
Barak Azulay
November 13, 2019, 2:40 PM

This issue is an excuse to see what happens when we collect logs on 5.0.5

when you have a cluster up talk to me about this issue.

 

Yoni Itzhak
December 15, 2019, 4:39 PM

I haven’t managed to reproduce the issue, but it seems to me that fix should be implemented anyway. Furthermore, the command cfy logs download doesn’t work on a Manager cluster (please see the related , I’d be happy to work on it if needed).

Barak Azulay
December 15, 2019, 5:28 PM

there is no point in holding back on this one … this is a smaller issue than mentioned above (CY-2101), and I think we should handle it.

Yoni Itzhak
December 15, 2019, 5:35 PM

The issue was fixed by David on the 3.12.

Ofer Yarom
December 16, 2019, 8:31 AM

Great:)

Assignee

Yoni Itzhak

Reporter

Vladimir Antonovich

Labels

Severity

Medium

Target Version

5.0.5

Premium Only

no

Found In Version

4.5

QA Owner

None

Bug Type

unknown

Customer Encountered

Yes

Customer Name

c238

Release Notes

yes

Priority

None

Priority

Unprioritized
Configure