OMV7: rpc-admin -u admin config isDirty => The value \"null\" is not an object.

  • hello,


    I based a script on the return of the command: /usr/sbin/omv-rpc -u admin config isDirty 2>&1| jq .

    which should return true or false. With omv6 it was ok.

    Hereunder is the return since I migrated to OMV7. I have the same error on two separate servers.

    Code
    /usr/sbin/omv-rpc -u admin config isDirty 2>&1| jq .
    {
    "response": null,
    "error": {
    "code": 0,
    "message": ": The value \"null\" is not an object.",
    "trace": "OMV\\Json\\SchemaValidationException: : The value \"null\" is not an object. in /usr/share/php/openmediavault/json/schema.inc:395\nStack trace:\n#0 /usr/share/php/openmediavault/json/schema.inc(289): OMV\\Json\\Schema->validateObject()\n#1 /usr/share/php/openmediavault/json/schema.inc(261): OMV\\Json\\Schema->validateType()\n#2 /usr/share/php/openmediavault/rpc/paramsvalidator.inc(59): OMV\\Json\\Schema->validate()\n#3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(179): OMV\\Rpc\\ParamsValidator->validate()\n#4 /usr/share/openmediavault/engined/rpc/config.inc(59): OMV\\Rpc\\ServiceAbstract->validateMethodParams()\n#5 [internal function]: Engined\\Rpc\\Config->isDirty()\n#6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(122): call_user_func_array()\n#7 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\\Rpc\\ServiceAbstract->callMethod()\n#8 /usr/sbin/omv-engined(535): OMV\\Rpc\\Rpc::call()\n#9 {main}"
    }
    }


    getInformation gives also the status: /usr/sbin/omv-rpc -u admin system getInformation | jq .configDirty

    the return is: false

    the content of /var/lib/openmediavault/dirtymodules.json is []. The file was modified last April, 10th.


    is config isDirty deprecated ?

    I tried with parameters empty json with no better luck:

    /usr/sbin/omv-rpc -u admin config isDirty "{}"

    {"response":null,"error":{"code":0,"message":": The value [] is not an object." .....


    it looks like isDirty cannot accept an empty parameter .

    omv 7.0.5-1 sandworm | 64 bit | baremetal

    plugins :: autoshutdown 7.0 | backup 7.1.4 | compose 7.1.6 | cputemp 7.0.1 | diskstats 7.0-2 | fail2ban 7.0.1 | flashmemory 7.0 | kernel 7.0.5, keyring 1.0.2-2 | kvm 7.0.13 | md 7.0-7 | nut 7.0.3-1 | remotemount 7.0.1 | resetperms 7.1 | sharerootfs 7.0-1 | symlinks 7.0 | usbbackup 7.0.2-1

  • KM0201

    Hat das Thema freigeschaltet.
    • Neu
    • Offizieller Beitrag

    It still exists - https://github.com/openmediava…ngined/rpc/config.inc#L54


    The validation config is looking for an array but it isn't required.

    openmediavault/deb/openmediavault/usr/share/openmediavault/datamodels/rpc.config.json at master · openmediavault/openmediavault
    openmediavault is the next generation network attached storage (NAS) solution based on Debian Linux. Thanks to the modular design of the framework it can be…
    github.com


    On OMV 6.x, there was no validation. So, you just need to pass an empty modules array:


    sudo omv-rpc -u admin config isDirty '{"modules":[]}'

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • thanks for the answer.

    According to the comments "If empty, * all modules will be checked.",.

    Even if parameters var is empty, validation is perfomed on null object:

    $this->validateMethodParams($params, "rpc.config.isDirty");


    so the code hereunder is the workaround to use isDirty, much less easier than previously.

    Code
    sudo omv-rpc -u admin config isDirty "{\"modules\":$(</var/lib/openmediavault/dirtymodules.json)}"

    omv 7.0.5-1 sandworm | 64 bit | baremetal

    plugins :: autoshutdown 7.0 | backup 7.1.4 | compose 7.1.6 | cputemp 7.0.1 | diskstats 7.0-2 | fail2ban 7.0.1 | flashmemory 7.0 | kernel 7.0.5, keyring 1.0.2-2 | kvm 7.0.13 | md 7.0-7 | nut 7.0.3-1 | remotemount 7.0.1 | resetperms 7.1 | sharerootfs 7.0-1 | symlinks 7.0 | usbbackup 7.0.2-1

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!