Broken confdbadm while trying to develop on openmediavault-autoshutdown

    • OMV 3.x
    • Resolved
    • Broken confdbadm while trying to develop on openmediavault-autoshutdown

      Hello,

      I have an issue after I modified some js script in /var/www/openmediavault/js/omv/module/admin/service/autoshutdown/Settings.js to add forced up days
      I reverted to default but it seems that omv database is broken


      Source Code

      1. root@openmediavault:~# omv-confdbadm read conf.service.autoshutdown
      2. Traceback (most recent call last):
      3. File "/usr/sbin/omv-confdbadm", line 66, in <module>
      4. sys.exit(main())
      5. File "/usr/sbin/omv-confdbadm", line 63, in main
      6. return cmd_inst.execute(*sys.argv)
      7. File "/usr/share/openmediavault/confdbadm/commands.d/read.py", line 62, in execute
      8. objs = db.get(cmd_args.id, cmd_args.uuid)
      9. File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 79, in get
      10. query.execute()
      11. File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 674, in execute
      12. self._response = self._elements_to_object(elements)
      13. File "/usr/lib/python3/dist-packages/openmediavault/config/database.py", line 448, in _elements_to_object
      14. result.set_dict(self._element_to_dict(elements[0]), False)
      15. File "/usr/lib/python3/dist-packages/openmediavault/config/object.py", line 197, in set_dict
      16. self.set(key, value, validate)
      17. File "/usr/lib/python3/dist-packages/openmediavault/config/object.py", line 171, in set
      18. self.assert_exists(name)
      19. File "/usr/lib/python3/dist-packages/openmediavault/config/object.py", line 143, in assert_exists
      20. (name, self.model.id))
      21. openmediavault.exceptions.AssertException: The property 'days-tuesday' does not exist in the model 'conf.service.autoshutdown'.
      Display All
      If I try to recreate, I get a permission error


      Source Code

      1. root@openmediavault:~# omv-confdbadm create conf.service.autoshutdown
      2. ERROR: Failed to create the default configuration: [Errno 13] Permission denied


      I also tried to remove openmediavault and install it back, same issue

      Does someone have an idea how to fix this ? Thx by advance ^^
    • ryecoaaron wrote:

      Do you have a github repo of what code you changed? Hard to help otherwise.
      Unfortunately no, I just added buttons to autoshutdown plugin in order to add forced up days, something like that :

      Source Code

      1. items: [{
      2. xtype: 'checkbox',
      3. name: 'days-sunday',
      4. fieldLabel: _('Sunday'),
      5. checked: true
      6. }, {
      7. xtype: 'checkbox',
      8. name: 'days-monday',
      9. fieldLabel: _('Monday'),
      10. checked: true
      11. }, {
      12. xtype: 'checkbox',
      13. name: 'days-tuesday',
      14. fieldLabel: _('Tuesday'),
      15. checked: true
      16. }, {
      17. xtype: 'checkbox',
      18. name: 'days-wednesday',
      19. fieldLabel: _('Wednesday'),
      20. checked: true
      21. }, {
      22. xtype: 'checkbox',
      23. name: 'days-thursday',
      24. fieldLabel: _('Thursday'),
      25. checked: true
      26. }, {
      27. xtype: 'checkbox',
      28. name: 'days-friday',
      29. fieldLabel: _('Friday'),
      30. checked: true
      31. }, {
      32. xtype: 'checkbox',
      33. name: 'days-saturday',
      34. fieldLabel: _('Saturday'),
      35. checked: true
      36. }]
      Display All
      I modified datamodels to add variables, it worked until I changed the type from days-xxxx to updays-xxx, it broke after that

      So I reverted all files to default (from plugin master branch github.com/OpenMediaVault-Plug…enmediavault-autoshutdown), but it keeps crashing, like it's still looking for the datamodel of the now inexistant buttons
    • I temporarily "fixed" the problem by re-adding datamodels :

      Source Code

      1. /usr/share/openmediavault/datamodels/conf.service.autoshutdown.json
      2. 46 "uphours-end": {
      3. 47 "type": "integer",
      4. 48 "minimum": 0,
      5. 49 "maximum": 23,
      6. 50 "default": 20
      7. 51 },
      8. 52 "days-monday": {
      9. 53 "type": "boolean",
      10. 54 "default": false
      11. 55 },
      12. 56 "days-tuesday": {
      13. 57 "type": "boolean",
      14. 58 "default": false
      15. 59 },
      16. 60 "days-wednesday": {
      17. 61 "type": "boolean",
      18. 62 "default": false
      19. 63 },
      20. 64 "days-thursday": {
      21. 65 "type": "boolean",
      22. 66 "default": false
      23. 67 },
      24. 68 "days-friday": {
      25. 69 "type": "boolean",
      26. 70 "default": false
      27. 71 },
      28. 72 "days-saturday": {
      29. 73 "type": "boolean",
      30. 74 "default": false
      31. 75 },
      32. 76 "days-sunday": {
      33. 77 "type": "boolean",
      34. 78 "default": false
      35. 79 },
      36. 80 "nsocketnumbers": {
      37. 81 "type": "string",
      38. 82 "default": "21,22,80,139,445,3689,6991,9091,49152"
      39. 83 },
      Display All
      root@openmediavault:/usr/share/openmediavault/datamodels# omv-confdbadm read conf.service.autoshutdown
      {"checkclockactive": true, "hddiocheck": true, "sleep": 180, "days-tuesday": false, "days-friday": false, "days-sunday": false, "checksamba": true, "days-monday": false, "uphours-begin": 4, "uldlrate": 50, "uldlcheck": true, "days-thursday": false, "nsocketnumbers": "21,22,80,443,445,8077,8078,8201,9091,32400,58050,58051", "extraoptions": "FORCE_NIC=eth2\nPINGLIST=/root/lib/PINGLIST", "days-saturday": false, "verbose": false, "fake": true, "loadaveragecheck": true, "shutdowncommand": 2, "uphours-end": 5, "syslog": true, "checkcli": true, "cycles": 6, "enable": true, "days-wednesday": false, "loadaverage": 40, "hddiorate": 401, "range": "17"}

      The post was edited 1 time, last by yo1frenchtoast ().

    • yo1frenchtoast wrote:

      So I reverted all files to default (from plugin master branch github.com/OpenMediaVault-Plug…enmediavault-autoshutdown), but it keeps crashing, like it's still looking for the datamodel of the now inexistant buttons
      You need to fix the xml in config.xml. Purging the plugin and re-installing would be the best way to do that.

      If you want help on this, please fork the plugin and commit code changes to a github repo. It is much easier to see what changes you made that way.
      omv 4.0.5 arrakis | 64 bit | 4.12 backports kernel | omvextrasorg 4.0.4
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please don't PM for support... Too many PMs!
    • ryecoaaron wrote:

      yo1frenchtoast wrote:

      So I reverted all files to default (from plugin master branch github.com/OpenMediaVault-Plug…enmediavault-autoshutdown), but it keeps crashing, like it's still looking for the datamodel of the now inexistant buttons
      You need to fix the xml in config.xml. Purging the plugin and re-installing would be the best way to do that.
      If you want help on this, please fork the plugin and commit code changes to a github repo. It is much easier to see what changes you made that way.
      That fixed the issue, thank you very much !

      I now understand how it works, I will be able to continue my modification on the plugin ;)
    • Users Online 1

      1 Guest