3

I just upgraded from a solid 24.10 Ubuntu desktop installation, to the just released 25.04 desktop. Overall it's a pretty solid release, but as always, there are some glitches. logrotate.service is broken, due to the cloud-init installation. logrotate.service fails to start due to these (partial) errors from cloud-init.

See: systemctl status logrotate.service

2025-05-15T06:35:31.576139-07:00 al-Inspiron-7700-AIO systemd[1]: Starting logrotate.service - Rotate log files...
2025-05-15T06:35:31.646233-07:00 al-Inspiron-7700-AIO logrotate[23856]: error: cloud-init-base:1 duplicate log entry for /var/log/cloud-init*.log
2025-05-15T06:35:31.646295-07:00 al-Inspiron-7700-AIO logrotate[23856]: error: found error in file cloud-init-base, skipping

The problem is with /etc/logrotate.d/cloud-init and /etc/logrotate.d/cloud-init-base in that they both contain references to the same log file:

/var/log/cloud-init*.log
{
    su root root
    missingok
    nocreate
    notifempty
    rotate 6
    compress
    delaycompress
    size 1M
}

Here's the software:

Software Installed version Latest version
cloud-guest-utils 0.33-1 0.33-1
cloud-init 25.1.1-0ubuntu2 25.1.1-0ubuntu2
cloud-init-base 25.1.1-0ubuntu2 25.1.1-0ubuntu2

Problem: When upgrading/installing 25.04, the cloud-init and cloud-init-base software causes the logrotate.service to fail.

Question: What's the best way to fix this?

heynnema
  • 73,649

1 Answers1

3

Previous to the 25.04 update there was only the file /etc/logrotate.d/cloud-init. After update to 25.04 there is also a file /etc/logrotate.d/cloud-init-base, as you have noticed.

Testing reveals this:

$ dpkg -S /etc/logrotate.d/cloud-init
cloud-init: /etc/logrotate.d/cloud-init
$ dpkg -S /etc/logrotate.d/cloud-init-base
cloud-init-base: /etc/logrotate.d/cloud-init-base

However, looking at the file list of package cloud-init in plucky reveals no such file as /etc/logrotate.d/cloud-init. So, probably this is left over from the previous version of package cloud-init in oracular. I think this is due to renaming of cloud-init to cloud-init-base in plucky.

I would recommend doing:

# apt purge cloud-init && apt install cloud-init

which was also what I did.

If you do not wish to do the above, doing just

# cd /etc/logrotate.d && mv cloud-init cloud-init.old

should be enough.

There is also an old bug report related to this.

FedKad
  • 13,420