LVM: Cannot create volume group on /dev/md0

    • LVM: Cannot create volume group on /dev/md0

      Hello,

      I am testing OMV in a proxmox VM with a bunch of virtual disks that form a RAID5 as /dev/md0. However, I run into a problem when creating a volume group on /dev/md0:

      devices: The value '/dev/md0' doesn't match the pattern '^(.+[,;])*.+$'.

      Error #0:OMV\Json\SchemaValidationException: devices: The value '/dev/md0' doesn't match the pattern '^(.+[,;])*.+$'. in /usr/share/php/openmediavault/json/schema.inc:478Stack trace:#0 /usr/share/php/openmediavault/json/schema.inc(370): OMV\Json\Schema->checkPattern('/dev/md0', Array, 'devices')#1 /usr/share/php/openmediavault/json/schema.inc(297): OMV\Json\Schema->validateString('/dev/md0', Array, 'devices')#2 /usr/share/php/openmediavault/json/schema.inc(624): OMV\Json\Schema->validateType('/dev/md0', Array, 'devices')#3 /usr/share/php/openmediavault/json/schema.inc(395): OMV\Json\Schema->checkProperties(Object(stdClass), Array, '')#4 /usr/share/php/openmediavault/json/schema.inc(285): OMV\Json\Schema->validateObject(Object(stdClass), Array, '')#5 /usr/share/php/openmediavault/json/schema.inc(257): OMV\Json\Schema->validateType(Object(stdClass), Array, '')#6 /usr/share/php/openmediavault/rpc/paramsvalidator.inc(59): OMV\Json\Schema->validate(Object(stdClass))#7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(178): OMV\Rpc\ParamsValidator->validate('{"name":"testvg...')#8 /usr/share/openmediavault/engined/rpc/logicalvolumemgmt.inc(381): OMV\Rpc\ServiceAbstract->validateMethodParams(Array, 'rpc.logicalvolu...')#9 [internal function]: OMVRpcServiceLogicalVolumeMgmt->createVolumeGroup(Array, Array)#10 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)#11 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('createVolumeGro...', Array, Array)#12 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('LogicalVolumeMg...', 'createVolumeGro...', Array, Array, 1)#13 {main}

      As I am new to OMV I am not really sure what causes this problem. But I know that

      vgcreate vg1 /dev/md0

      is no problem as I have it running on my production file server which is manually configured.

      Versions are:

      OMV 4.1.3
      LVM2: 4.0.7-1

      Thanks a lot,

      Ben
    • Which locale are you using on your OMV system (not the UI)?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • Than I really have no idea anymore and I assume a bug in PHP. As you can see in the error message this regex is super simple and the string to be processed should be matched; there are no strange unicode characters or something else. I am out of ideas.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • What hardware are you using? How did you install your system?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • By the way, do you still have the problem after you've upgraded to the latest versions of openmediavault and openmediavault-lvm2 packages?
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • This bug report sounds quiet similar: bugs.alpinelinux.org/issues/7781
      Please make sure you've an up-to-date system with the latest installed packages.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • OMV is running in a Proxmox VM. The hosts hardware is a Intel NUC. The drives for the raid are no real physical drives but rather virtual ones that are available as usual as /dev/sdx devices. OMV was able to create the RAID as /dev/md0 without problems.

      I used the openmediavault_4.1.3-amd64.iso. It is a fresh install from Thursday, so everything is up-to-date

      As mentioned in the original post, versions are:

      OMV 4.1.3
      LVM2: 4.0.7-1

      Best,

      Ben
    • OK, I waded my way through the code and found the following:

      What gets called in the schema validator using the checkPattern method is

      Source Code

      1. if (!preg_match('^(.+[,;])*.+$', '/dev/md0')) {
      2. ...
      I have extracted the relevant code into a small script to check in a shell. This then gives a warning:

      PHP Warning: preg_match(): No ending delimiter '^' found in /root/test.php on line 8

      and matching fails.

      Checking the documentation (my php is a bit rusty from time to time) it says that preg_match needs delimiters. So changing the call to


      Source Code

      1. if (!preg_match('/^(.+[,;])*.+$/', '/dev/md0')) {
      2. ...
      giving a perfect match. I then changed the rexexp in the relevant datamodel (rpc.logicalvolumemgmt.json) just for testing and voila, volume group can be created.

      Best,

      Ben

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

    • I am sorry to say but your system is not up to date, the latest version is 4.1.21. Use the UI to update your system.

      And about your finding in the code, above the mentioned Code there is a comment


      Source Code

      1. // Note, the pattern is defined according to the ECMA 262 regular
      2. // expression dialect. So it must be adapted to the PHP syntax.
      3. $regex = sprintf("/%s/u", $schema['pattern']);
      4. if (!preg_match($regex, $value)) {
      sorry, can not link to the code using the smartphone.

      So the problem is something different. Note, this issue only happens on a really really really really small number of systems.
      Absolutely no support through PM!

      I must not fear.
      Fear is the mind-killer.
      Fear is the little-death that brings total obliteration.
      I will face my fear.
      I will permit it to pass over me and through me.
      And when it has gone past I will turn the inner eye to see its path.
      Where the fear has gone there will be nothing.
      Only I will remain.

      Litany against fear by Bene Gesserit
    • Oh yes, entirely my vault with the outdated version. I am used to use docker containers for almost all of my services so I didn't even thought about that the iso image could be pretty ancient.

      Also, for some unknown reason the Update Manager in my case does not show any new versions, but also no error. However, I was able to install the LVM-Plugin.

      The code fragment strongly indicates that my problem is fixed in a newer version, so I have to find out why I cannot update.

      I think I better try a clean reinstall.

      Thanks a lot,

      Ben