space on disk running low error logging /var/log/cups/error.log

I have Lubuntu 16.10 installed on my disk mounted as /.

The problem is that the CUPS log file( /var/log/cups/error.log) grows all the time until I no have free space left on the disk...

So when I delete that file, the space on disk freed up again

I already tried:

  • fsck
  • disk usage analyzer
  • every apt-cleaning/autocleaning, and dependencies fixing.

How should I proceed?

du -sxh:

9,0G    .

Model: ATA ST3160815AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type      File system     Flags
 1      32,3kB  50,3GB  50,3GB  primary   ext4            boot
 2      50,3GB  160GB   110GB   extended
 5      50,3GB  158GB   108GB   logical   ext4
 6      158GB   160GB   2136MB  logical   linux-swap(v1)

parted --list && sudo df -h:

Model: ATA ST3160815AS (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32,3kB  50,3GB  50,3GB  primary  ext4         boot
 2      50,3GB  160GB   110GB   primary  ext4


Filesystem      Size  Used Avail Use% Mounted on
udev            985M     0  985M   0% /dev
tmpfs           201M  6,3M  195M   4% /run
/dev/sda1        46G   43G  709M  99% /
tmpfs          1003M  188K 1003M   1% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs          1003M     0 1003M   0% /sys/fs/cgroup
tmpfs           201M   36K  201M   1% /run/user/1000
/dev/sda2       101G   60M   96G   1% /media/aram/

Solution 1:

I had the same problem. The log files grows very quickly and after a few hours it consumes all available space in /. At this point things start going really bad. Also the cups process hogs the CPU (100% in one core - that explains the 50% you see in a dual-cure).

Deleting the file at this point doesn't seem to help immediately. I guess the file is still in use by the cups process and it won't free the disk space... but after a reboot I got some free disk space and had time do investigate /var/log/cups/error_log.

Here's what I found in the first few lines

E [16/Oct/2016:09:48:02 +0300] MFCJ625DW: File \"/usr/lib/cups/filter/brother_lpdwrapper_mfcj625dw\" has insecure permissions (0100775/uid=0/gid=0).
E [16/Oct/2016:09:48:02 +0300] MFCJ625DW: Directory \"/usr/lib/cups/filter\" has insecure permissions (040775/uid=0/gid=0).
E [16/Oct/2016:09:48:02 +0300] MFCJ625DW: File \"/usr/lib/cups/filter/brother_lpdwrapper_mfcj625dw\" has insecure permissions (0100775/uid=0/gid=0).
E [16/Oct/2016:09:48:02 +0300] MFCJ625DW: Directory \"/usr/lib/cups/filter\" has insecure permissions (040775/uid=0/gid=0).
E [16/Oct/2016:09:48:03 +0300] Directory \"/usr/lib/cups/notifier\" has insecure permissions (040775/uid=0/gid=0).
W [16/Oct/2016:09:48:03 +0300] Notifier for subscription 1879 (dbus://) went away, retrying!
E [16/Oct/2016:09:48:03 +0300] Directory \"/usr/lib/cups/notifier\" has insecure permissions (040775/uid=0/gid=0).
W [16/Oct/2016:09:48:03 +0300] Notifier for subscription 1879 (dbus://) went away, retrying!
W [16/Oct/2016:09:48:03 +0300] Notifier for subscription 1879 (dbus://) went away, retrying!

And then the last warning is repeated over and over again... over 45000 times per second! (No wonder the disk is filled after a short time)


Assuming you have a similar problem, note that the thing cups keeps complaining about is very simple to fix:

Directory \"/usr/lib/cups/notifier\" has insecure permissions (040775/uid=0/gid=0).

Once you change the permissions with sudo chmod 755 /usr/lib/cups/notifier, the file should stop growing. (while you are at it, fix the other files it complains about).