Skip to content

Agents log rotation is unstable #10180

Closed
Closed

Description

@akrasnov-drv
ISSUE TYPE
  • Other
COMPONENT NAME

KVM agent logs

CLOUDSTACK VERSION
4.20.0.0
CONFIGURATION

default /etc/logrotate.d/cloudstack-agent and /etc/cloudstack/agent/log4j-cloud.xml

OS / ENVIRONMENT

Ubuntu 22.04.5 LTS

SUMMARY

Regularly agent log is rotated but cloudstack agent keeps writing to old file.

STEPS TO REPRODUCE

just added kvm hosts to cloudstack cluster and used it to run several VMs
I believe at rotation time (0:17) there were several VMs running but no new tasks were executed

EXPECTED RESULTS

I'd expect that agent writes to the new agent.log after rotation

ACTUAL RESULTS

But it keeps writing to the old file

-rw-r--r-- 1 root root       0 Jan 13 00:17 agent.log
-rw-r--r-- 1 root root  319990 Jan 13 09:28 agent.log.1

Please advise.
Thanks.

Activity

  1. boring-cyborg commented on Jan 13, 2025

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. akrasnov-drv commented on Jan 13, 2025

    @akrasnov-drv
    Author

    Looks like properly rotated files have different naming

        -rw-r--r-- 1 root root  274543 Jan 13 09:42 agent.log
        -rw-r--r-- 1 root root     358 Jan  8 11:57 agent.log.2025-01-07.gz
        -rw-r--r-- 1 root root   19103 Jan  9 00:00 agent.log.2025-01-08.gz
        -rw-r--r-- 1 root root   43687 Jan 10 00:00 agent.log.2025-01-09.gz
        -rw-r--r-- 1 root root   42734 Jan 11 00:00 agent.log.2025-01-10.gz
        -rw-r--r-- 1 root root   41832 Jan 12 00:00 agent.log.2025-01-11.gz
        -rw-r--r-- 1 root root   39186 Jan 13 00:00 agent.log.2025-01-12.gz
    

    must be some conflict with my logrotate configuration

  3. akrasnov-drv commented on Jan 13, 2025

    @akrasnov-drv
    Author

    Found conflicting entry in logrotate.d

  4. akrasnov-drv commented on Jan 13, 2025

    @akrasnov-drv
    Author

    Not CloudStack issue

  5. DaanHoogland commented on Jan 13, 2025

    @DaanHoogland
    Contributor

    thanks for providing the question and the answer @akrasnov-drv . I am converting this to a q&a discussion item for future reference.

  6. locked and limited conversation to collaborators on Jan 13, 2025
  7. converted this issue into a discussion #10181 on Jan 13, 2025
  8. added this to the unplanned milestone on Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions