landscape-client divide by zero error

Bug #269634 reported by Matt Mossholder
2
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
High
Christopher Armstrong
Landscape Server
Fix Released
High
Christopher Armstrong
landscape-client (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: landscape-client

I noticed that update-motd was throwing some errors after I upgraded to Intrepid Alpha 5. From the looks of things, it doesn't like one of the mounted filesystems.

 ================

2008-09-12 19:41:35,863 ERROR Disk plugin raised an exception.
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/landscape/sysinfo/sysinfo.py", line 98, in run
    result = plugin.run()
  File "/usr/lib/python2.5/site-packages/landscape/sysinfo/disk.py", line 38, in run
    usage(main_info))
  File "/usr/lib/python2.5/site-packages/landscape/sysinfo/disk.py", line 22, in usage
    return "%0.1f%% of %s" % ((used / total) * 100, format_megabytes(total))
ZeroDivisionError: float division

================

Disk Utilization:

Filesystem Size Used Avail Use% Mounted on
/dev/sda3 12G 5.7G 5.7G 51% /
tmpfs 1005M 0 1005M 0% /lib/init/rw
varrun 1005M 364K 1005M 1% /var/run
varlock 1005M 0 1005M 0% /var/lock
udev 1005M 72K 1005M 1% /dev
tmpfs 1005M 372K 1005M 1% /dev/shm
lrm 1005M 2.4M 1003M 1% /lib/modules/2.6.27-3-generic/volatile
/dev/sda1 216G 76G 134G 37% /export/home
mythtv:/myth 732G 471G 262G 65% /myth
/dev/sdb1 7.8G 35M 7.8G 1% /media/8GB-Photos

================
Mounted Filesystems:

/dev/sda3 on / type ext3 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
lrm on /lib/modules/2.6.27-3-generic/volatile type tmpfs (rw,mode=755)
/dev/sda1 on /export/home type ext3 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
mythtv:/myth on /myth type nfs (rw,rsize=8192,wsize=9192,addr=192.168.0.4)
automount(pid6170) on /home type autofs (rw,fd=4,pgrp=6170,minproto=2,maxproto=4)
nfsd on /proc/fs/nfsd type nfsd (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
/export/home/mattcm on /home/mattcm type none (rw,bind)
/dev/sdb1 on /media/8GB-Photos type vfat (rw,nosuid,nodev,uhelper=hal,shortname=mixed,uid=5000,utf8,umask=077,flush)

Changed in landscape-client:
importance: Undecided → High
Changed in landscape:
importance: Undecided → High
milestone: none → thames-pre-8
Changed in landscape-client:
status: New → Confirmed
Revision history for this message
Christopher Armstrong (radix) wrote :

Please review linked branch

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This happened because autofs reports a zero sized filesystem when it is stat()ed (/home in this case). The branch fixed it in my tests.

qa + 1

Changed in landscape-client:
status: New → In Progress
Changed in landscape:
status: New → In Progress
Revision history for this message
Christopher Armstrong (radix) wrote :

Actually I just made a bit more changes to do something a bit better. It will fall back to / if the capacity of /home cannot be ascertained. It also now handles the case where / ALSO doesn't have a capacity.

plz review

Revision history for this message
Thomas Herve (therve) wrote :

Cool +1

Revision history for this message
Kevin McDermott (bigkevmcd) wrote :

Small clean change :-)

+1

Changed in landscape:
assignee: nobody → radix
status: In Progress → Fix Committed
Changed in landscape-client:
assignee: nobody → radix
status: In Progress → Fix Committed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Bug #271886 has a fix for this.

Changed in landscape-client:
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package landscape-client - 1.0.21-0ubuntu1

---------------
landscape-client (1.0.21-0ubuntu1) intrepid; urgency=low

  [ Christopher Armstrong ]
  * New upstream release (LP: #271886):
    - Bug fix release:
    - Avoid the PotentialZombieWarning on landscape-client startup.
     (LP: #257346)
    - When run as root, read sysinfo configuration from /etc and and write
      logs to /var/log instead of /root. (LP: #268560)
    - Avoid ZeroDivisionErrors when /home is an autofs. (LP: #269634)
    - Don't corrupt a pid file when trying to start the client when it's
      already running. (LP: #269634)
    - Remove the pid file when shutting down the client. (LP: #257081)

  [ Mathias Gug ]
  * debian/landscape-client.init: specify the pid file and use --startas
    instead of --exec when starting landscape-client so that the init script
    doesn't fail if landscape-client is already running.

 -- Mathias Gug <email address hidden> Fri, 19 Sep 2008 17:28:08 -0400

Changed in landscape-client:
status: In Progress → Fix Released
Changed in landscape-client:
status: Fix Committed → Fix Released
Changed in landscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.