Bug 987531 - [LVM2 name validation needed] DeviceCreateError: ('vgcreate failed for fedora-\xc5\x82\xc5\x81: running lvm vgcreate -s 4m --config devices { ... } fedora-\xc5\x82\xc5\x81 /dev/sda2 failed', 'fedora-\xc5\x82\xc5\x
[LVM2 name validation needed] DeviceCreateError: ('vgcreate failed for fedora...
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Anaconda Maintenance Team
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-23 11:16 EDT by Steve Tyler
Modified: 2014-01-29 15:45 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-29 15:45:05 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
anaconda-tb-49kybv (404.95 KB, text/plain)
2013-07-23 11:16 EDT, Steve Tyler
no flags Details

  None (edit)
Description Steve Tyler 2013-07-23 11:16:51 EDT
Created attachment 777360 [details]

Description of problem:
Changing the volume group name to include non-ASCII characters (fedora-łŁ) results in a DeviceCreateError exception during installation.

Version-Release number of selected component (if applicable):
anaconda 19.30.13-1

How reproducible:

Steps to Reproduce:
1. Initialize a disc image and start the F19 installer:
   $ qemu-img create f19-test-3.img 12G
   $ qemu-kvm -m 4096 -hda f19-test-3.img -cdrom ~/xfr/fedora/F19/Fedora-19-x86_64-DVD.iso -vga std -boot menu=on

2. Select Polish as the installation language.
3. From Installation Summary, click keyboard icon to switch keyboard to "pl".
4. Enter Custom Partitioning.
5. Click to auto-create disk configuration.
6. Select a logical volume.
7. Click to modify the volume group name.
8. Append non-ASCII characters:
   Press alt-L for "ł".
   Press alt-shift-L for "Ł".
9. Begin Installation.

Actual results:
DeviceCreateError exception during volume group creation.

13:23:12,025 INFO program: Running... lvm vgcreate -s 4m --config  devices { filter=["r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }  fedora-łŁ /dev/sda2
13:23:12,066 INFO program:   New volume group name "fedora-łŁ" is invalid
13:23:12,067 INFO program:   Run `vgcreate --help' for more information.
13:23:12,067 DEBUG program: Return code: 3

Expected results:
Invalid volume group names are rejected before installation begins.

Additional info:

This bug report is essentially a duplicate of Bug 883689, which is assigned to LVM2. I am opening this, because it doesn't look like that bug will be addressed any time soon, and because anaconda could do the validation itself with a simple function. From the LVM2 documentation and the LVM2 source, it should be easy to identify the length and character-set rules. Those are highly unlikely to ever change, so embedding them in anaconda does not seem like a potential maintenance problem.

Bug 883689 - RFE: export a Python name-validation function ([vgcreate] New volume group name "ñ" is invalid)
Comment 1 Steve Tyler 2013-07-23 11:27:58 EDT
(In reply to Steve Tyler from comment #0)
> This bug report is essentially a duplicate of Bug 883689, which is assigned
> to LVM2. I am opening this, because it doesn't look like that bug will be
> addressed any time soon, ...

Specifically, Bug 883689, Comment 11:
"This seems reasonable.  However, until anaconda picks up and uses the python bindings for lvm (instead of command line) they should really do some type of validation in anaconda."
Comment 2 Steve Tyler 2013-07-23 12:53:07 EDT
The LVM2 name validation function and the maximum name length:

int validate_name(const char *n)

#define NAME_LEN 128


$ sudo repoquery lvm2

Note You need to log in before you can comment on or make changes to this bug.