Bug #3073

DUC indexing fail with empty backup property

Added by Edoardo Spadoni over 6 years ago. Updated over 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-duc
Target version:v6.6-rc1
Security class: Resolution:
Affected version:v6.6 NEEDINFO:No

Description

Duc indexing fail if the proerty Mount is not set.

Step to reproduce:
  • install duc on clean machine
  • click Update on Dashboard > Disk Usage
  • as you can see an error is displayed and the graph is not showed.

Related issues

Related to NethServer 6 - Bug #3062: DUC (Disk Usage): Backup directory visualized in the graph CLOSED

Associated revisions

Revision 42993f1f
Added by Edoardo Spadoni over 6 years ago

bug. fix empty backup property. Refs #3073

History

#1 Updated by Edoardo Spadoni over 6 years ago

  • Subject changed from DUC indexing fail with empty backup property (Refs http://dev.nethserver.org/issues/3062) to DUC indexing fail with empty backup property

(Refs http://dev.nethserver.org/issues/3062)

Error in: /var/log/messages

Mar  4 10:21:24 localhost esmith::event: Event: nethserver-duc-save 
Mar  4 10:21:24 localhost esmith::event: Indexed 57853 files and 7388 directories, (763.8MB total) in 0.28 secs.
Mar  4 10:21:24 localhost esmith::event: Traceback (most recent call last):
Mar  4 10:21:24 localhost esmith::event:   File "/usr/share/duc/xml2json.py", line 182, in <module>
Mar  4 10:21:24 localhost esmith::event:     main()
Mar  4 10:21:24 localhost esmith::event:   File "/usr/share/duc/xml2json.py", line 177, in main
Mar  4 10:21:24 localhost esmith::event:     out = xml2json(input, options, strip_ns, strip)
Mar  4 10:21:24 localhost esmith::event:   File "/usr/share/duc/xml2json.py", line 150, in xml2json
Mar  4 10:21:24 localhost esmith::event:     return elem2json(elem, options, strip_ns=strip_ns, strip=strip)
Mar  4 10:21:24 localhost esmith::event:   File "/usr/share/duc/xml2json.py", line 121, in elem2json
Mar  4 10:21:24 localhost esmith::event:     if(a[-1] == ""):
Mar  4 10:21:24 localhost esmith::event: IndexError: list index out of range
Mar  4 10:21:24 localhost esmith::event: Action: /etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index FAILED: 1 [0.407756]
Mar  4 10:21:24 localhost esmith::event: Event: nethserver-duc-save FAILED

#2 Updated by Edoardo Spadoni over 6 years ago

  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

Simply check if property is null

#3 Updated by Edoardo Spadoni over 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Edoardo Spadoni
  • % Done changed from 20 to 30

#4 Updated by Edoardo Spadoni over 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • Assignee deleted (Edoardo Spadoni)
  • % Done changed from 30 to 60

#5 Updated by Giacomo Sanchietti over 6 years ago

  • Related to Bug #3062: DUC (Disk Usage): Backup directory visualized in the graph added

#6 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from MODIFIED to ON_QA
  • % Done changed from 60 to 70
Package in nethserver-testing:
  • nethserver-duc-1.0.1-1.1.g42993f1.ns6.noarch.rpm
Test case
  • Check the bus is not reproducible

#7 Updated by Edoardo Spadoni over 6 years ago

  • Description updated (diff)

#8 Updated by Filippo Carletti over 6 years ago

  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

I installed a fresh 6.6rc1, went to disk usage in dashboard and hit Update.
I reveiced an error and found these lines in /var/log/messages:

Mar  4 12:09:01 ns66rc1 httpd-admin: [WARNING] NethServer\Module\Dashboard\Duc: stat(): stat failed for /var/cache/duc/duc.json
Mar  4 12:09:02 ns66rc1 httpd-admin: [WARNING] NethServer\Module\Dashboard\Duc: file_get_contents(/var/cache/duc/duc.json): failed to open stream: No such file or directory
Mar  4 12:09:04 ns66rc1 httpd-admin: [WARNING] NethServer\Module\Dashboard\Duc: stat(): stat failed for /var/cache/duc/duc.json
Mar  4 12:09:04 ns66rc1 httpd-admin: [WARNING] NethServer\Module\Dashboard\Duc: file_get_contents(/var/cache/duc/duc.json): failed to open stream: No such file or directory
Mar  4 12:09:04 ns66rc1 esmith::event[4273]: Event: nethserver-duc-save 
Mar  4 12:09:06 ns66rc1 esmith::event[4273]: Indexed 57711 files and 7391 directories, (763.4MB total) in 1.69 secs.
Mar  4 12:09:06 ns66rc1 esmith::event[4273]: Traceback (most recent call last):
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:   File "/usr/share/duc/xml2json.py", line 182, in <module>
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:     main()
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:   File "/usr/share/duc/xml2json.py", line 177, in main
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:     out = xml2json(input, options, strip_ns, strip)
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:   File "/usr/share/duc/xml2json.py", line 150, in xml2json
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:     return elem2json(elem, options, strip_ns=strip_ns, strip=strip)
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:   File "/usr/share/duc/xml2json.py", line 121, in elem2json
Mar  4 12:09:06 ns66rc1 esmith::event[4273]:     if(a[-1] == ""):
Mar  4 12:09:06 ns66rc1 esmith::event[4273]: IndexError: list index out of range
Mar  4 12:09:06 ns66rc1 esmith::event[4273]: Action: /etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index FAILED: 1 [1.87003]
Mar  4 12:09:06 ns66rc1 esmith::event[4273]: Event: nethserver-duc-save FAILED

Then I updated nethserver duc, hit click and received no errors.
Here's the log:

Mar  4 12:10:30 ns66rc1 yum[4311]: Updated: nethserver-duc-1.0.1-1.1.g42993f1.ns6.noarch
Mar  4 12:10:33 ns66rc1 esmith::event[4318]: Event: nethserver-duc-save 
Mar  4 12:10:33 ns66rc1 esmith::event[4318]: Indexed 57733 files and 7410 directories, (786.3MB total) in 0.24 secs.
Mar  4 12:10:33 ns66rc1 esmith::event[4318]: Action: /etc/e-smith/events/nethserver-duc-save/S20nethserver-duc-index SUCCESS [0.36796]
Mar  4 12:10:33 ns66rc1 esmith::event[4318]: Event: nethserver-duc-save SUCCESS

#9 Updated by Giacomo Sanchietti over 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100
Released in nethserver-base:
  • nethserver-duc-1.0.2-1.ns6.noarch.rpm

#10 Updated by Davide Principi over 6 years ago

  • Target version changed from v6.6 to v6.6-rc1

Also available in: Atom PDF