Disk Usage: no graph

Since a day or two I don’t get a graph from the disk usage module. Any pointers on how to troubleshoot this?

Hi,
I think(not sure ever used it on smartphone before) l have the same problem.

Martin

Run the following command:

/etc/e-smith/events/actions/nethserver-duc-index

I am getting this back:

 # /etc/e-smith/events/actions/nethserver-duc-index
Traceback (most recent call last):
  File "/usr/share/duc/xml2json.py", line 190, in <module>
    main()
  File "/usr/share/duc/xml2json.py", line 185, in main
    out = xml2json(input, options, strip_ns, strip)
  File "/usr/share/duc/xml2json.py", line 154, in xml2json
    return elem2json(elem, options, strip_ns=strip_ns, strip=strip)
  File "/usr/share/duc/xml2json.py", line 129, in elem2json
    size = recToDelete(child, a)
  File "/usr/share/duc/xml2json.py", line 100, in recToDelete
    size = int(obj.attrib['size'])
KeyError: 'size'

Just in case, I ran the command for a 2nd time, and got exactly the same messages back…

Hi @robb, could be an issue related to backup data path, can you provide the output of this command:

/sbin/e-smith/config getprop backup-data Mount

Hi Eduardo, thnx for the reply.
This is the ouytput for the command:

/sbin/e-smith/config getprop backup-data Mount
/mnt/backup

However, I do have the modified module for backup installed that adds backup to a webdav volume on a remote system. Could that be a cause for the graph not showing?

FYI some WebDAV server mounts may return negative values as storage left.

I have no graph at all… just a blank page… So no value whatsoever.

Hi, try to apply this patch

--- /usr/share/duc/xml2json.py.ori	2017-02-07 11:32:05.058898510 +0100
+++ /usr/share/duc/xml2json.py	2017-02-07 11:32:12.926992358 +0100
@@ -93,21 +93,20 @@
     global size
 
     if(elem.attrib['name'] == backupdirs[-1]):
-        size = int(elem.attrib['size'])
+        size = int(elem.attrib['size_actual'])
     else:
         for obj in list(elem):
             if(obj.attrib['name'] == backupdirs[-1]):
-                size = int(obj.attrib['size'])
-                obj.attrib['size'] = str(int(obj.attrib['size']) - size)
-                if(int(obj.attrib['size']) < MIN_SIZE):
+                size = int(obj.attrib['size_actual'])
+                obj.attrib['size_actual'] = str(int(obj.attrib['size_actual']) - size)
+                if(int(obj.attrib['size_actual']) < MIN_SIZE):
                     elem.remove(obj)
             else:
                 size = recToDelete(obj, backupdirs)
                 if(obj.attrib['name'] in backupdirs):
-                    obj.attrib['size'] = str(int(obj.attrib['size']) - size)
-                    if(int(obj.attrib['size']) < MIN_SIZE):
+                    obj.attrib['size_actual'] = str(int(obj.attrib['size_actual']) - size)
+                    if(int(obj.attrib['size_actual']) < MIN_SIZE):
                         elem.remove(obj)
-
     return size
 
 def elem2json(elem, options, strip_ns=1, strip=1):
@@ -127,8 +126,8 @@
         for child in elem:
             if(child.attrib['name'] == a[0]):
                 size = recToDelete(child, a)
-                child.attrib['size'] = str(int(child.attrib['size']) - size)
-                if(int(child.attrib['size']) < MIN_SIZE):
+                child.attrib['size_actual'] = str(int(child.attrib['size_actual']) - size)
+                if(int(child.attrib['size_actual']) < MIN_SIZE):
                     elem.remove(child)
 
     # remove fake folder

and relaunch the action

/etc/e-smith/events/actions/nethserver-duc-index

There is a bug on a property name (from size to size_actual). If the patch works, we will do the commit.

2 Likes

I have applied the proposed patch and now waiting for the result.
I checked collecd graphs and also there I see no graph for df. Is that related?

I can confirm that the patch works and after running the script again, I have back a nice looking graph. :heart_eyes:

3 Likes

Great :D, we will integrate the patch in the new version

2 Likes

@maddin have you tested the patch to check if your problem is related?

Can someone test it also on NS 6.8? (/cc @edoardo_spadoni)

Edit: issue opened https://github.com/NethServer/dev/issues/5214

I’d like to involve @Jim and @flatspin in this since they know the matter very well

I applied this changes on my NS6.8 and can’t notice any difference. My df graph worked before and seems to work fine now. Sorry.

1 Like

Does this mean that the DUC module only needed a fix on NS7?

hi @edoardo_spadoni,

sry, no, and no need. Because of the wording I thought rob was talking about the visualization of the “Disk usage” - and that one does not show anything on my smartphone(chrome 55.0.2883.91 ANDROID 5.1) but under Firefox and laptop everything is fine!

So sry for false alarm!

Martin

NS 6 and N 7 use the same release of DUC, so we should fix both versions.

If you could install the package from testing and verify that everything is still fine, I will release the rpm on Monday :wink:

I will revert to old config and install from testing tomorrow. Let you know how it goes.

1 Like