Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2022135

Summary: lvmdbusd Traceback "json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 4 column 3 (char 36)"
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Tony Asleson <tasleson>
lvm2 sub component: lvmdbusd QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: low CC: agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, tasleson, zkabelac
Version: 8.6Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.14-7.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 09:11:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2021-11-10 20:24:30 UTC
Description of problem:
lvmdbus traceback doing jsonlookup after vgcfgrestore


Nov  8 13:30:53 hayes-02 qarshd[486105]: Running cmdline: pvcreate -ff -y --norestorefile --uuid hiArg4-Vpcc-NuK1-7Rh1-mAnS-mAyu-zNkGFU /dev/sdb1
Nov  8 13:30:57 hayes-02 qarshd[486114]: Running cmdline: vgcfgrestore --yes raid_sanity

Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: 2722:2729 - JSONDecodeError Expecting property name enclosed in double quotes: line 4 column 3 (char 36),
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: JSON=
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  {
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:      "report": [
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:          {
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  Consider prunning raid_sanity VG archive with more then 709 MiB in 4904 files (check archiving is needed in lvm.conf).
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  Consider prunning raid_sanity VG archive with more then 709 MiB in 4905 files (check archiving is needed in lvm.conf).
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:              "vg": [
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"vg_name":"raid_sanity", "vg_uuid":"u9dFUl-IBjy-tKo2-lBX0-AJ0o-GdQb-Bg1fx5", "vg_fmt":"lvm2", "vg_size":"10718506123264", "vg_free":"10717960863744", "vg_sysid":"", "vg_extent_size":"4194304", "vg_extent_count":"2555491", "vg_free_count":"2555361", "vg_profile":"", "max_lv":"0", "max_pv":"0", "pv_count":"13", "lv_count":"1", "snap_count":"0", "vg_seqno":"62", "vg_mda_count":"13", "vg_mda_free":"513536", "vg_mda_size":"1044480", "vg_mda_used_count":"13", "vg_attr":"wz--n-", "vg_tags":""}
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:              ]
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:              ,
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:              "pv": [
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"pv_name":"/dev/sdb1", "pv_uuid":"hiArg4-Vpcc-NuK1-7Rh1-mAnS-mAyu-zNkGFU", "pv_fmt":"lvm2", "pv_size":"999917879296", "pv_free":"999808827392", "pv_used":"109051904", "dev_size":"999922053120", "pv_mda_size":"1044480", "pv_mda_free":"513536", "pv_ba_start":"0", "pv_ba_size":"0", "pe_start":"1048576", "pv_pe_count":"238399", "pv_pe_alloc_count":"26", "pv_attr":"a--", "pv_tags":"", "vg_name":"raid_sanity", "vg_uuid":"u9dFUl-IBjy-tKo2-lBX0-AJ0o-GdQb-Bg1fx5", "pv_missing":""},
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"pv_name":"/dev/sdc1", "pv_uuid":"Xhl0KV-ctB4-JVGA-Yyz5-jKJ5-Oaz9-ZdiUrr", "pv_fmt":"lvm2", "pv_size":"999917879296", "pv_free":"999808827392", "pv_used":"109051904", "dev_size":"999922053120", "pv_mda_size":"1044480", "pv_mda_free":"513536", "pv_ba_start":"0", "pv_ba_size":"0", "pe_start":"1048576", "pv_pe_count":"238399", "pv_pe_alloc_count":"26", "pv_attr":"a--", "pv_tags":"", "vg_name":"raid_sanity", "vg_uuid":"u9dFUl-IBjy-tKo2-lBX0-AJ0o-GdQb-Bg1fx5", "pv_missing":""},
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"pv_name":"/dev/sdd1", "pv_uuid":"wGrabN-ft6X-vk4Y-czxD-C2K9-m4RC-FoATxT", "pv_fmt":"lvm2", "pv_size":"999917879296", "pv_free":"999808827392", "pv_used":"109051904", "dev_size":"999922053120", "pv_mda_size":"1044480", "pv_mda_free":"513536", "pv_ba_start":"0", "pv_ba_size":"0", "pe_start":"1048576", "pv_pe_count":"238399", "pv_pe_alloc_count":"26", "pv_attr":"a--", "pv_tags":"", "vg_name":"raid_sanity", "vg_uuid":"u9dFUl-IBjy-tKo2-lBX0-AJ0o-GdQb-Bg1fx5", "pv_missing":""},


[...]


ne_threads":"", "vdo_logical_threads":"", "vdo_physical_threads":"", "vdo_max_discard":"", "vdo_write_policy":"", "vdo_header_size":""},
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"seg_pe_ranges":"/dev/sde1:0-0", "segtype":"linear", "lv_uuid":"6No3eV-7Voh-UP2L-kUza-93X1-baEk-64hK25", "vdo_compression":"", "vdo_deduplication":"", "vdo_use_metadata_hints":"", "vdo_minimum_io_size":"", "vdo_block_map_cache_size":"", "vdo_block_map_era_length":"", "vdo_use_sparse_index":"", "vdo_index_memory_size":"", "vdo_slab_size":"", "vdo_ack_threads":"", "vdo_bio_threads":"", "vdo_bio_rotation":"", "vdo_cpu_threads":"", "vdo_hash_zone_threads":"", "vdo_logical_threads":"", "vdo_physical_threads":"", "vdo_max_discard":"", "vdo_write_policy":"", "vdo_header_size":""},
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"seg_pe_ranges":"/dev/sdf1:1-25", "segtype":"linear", "lv_uuid":"jE4mhk-ww1b-yumi-maT2-jinK-sCZn-GG3kGh", "vdo_compression":"", "vdo_deduplication":"", "vdo_use_metadata_hints":"", "vdo_minimum_io_size":"", "vdo_block_map_cache_size":"", "vdo_block_map_era_length":"", "vdo_use_sparse_index":"", "vdo_index_memory_size":"", "vdo_slab_size":"", "vdo_ack_threads":"", "vdo_bio_threads":"", "vdo_bio_rotation":"", "vdo_cpu_threads":"", "vdo_hash_zone_threads":"", "vdo_logical_threads":"", "vdo_physical_threads":"", "vdo_max_discard":"", "vdo_write_policy":"", "vdo_header_size":""},
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:                  {"seg_pe_ranges":"/dev/sdf1:0-0", "segtype":"linear", "lv_uuid":"uYlnbe-8Hx5-hlXC-xD0F-VBcw-Ox9d-EWDwbn", "vdo_compression":"", "vdo_deduplication":"", "vdo_use_metadata_hints":"", "vdo_minimum_io_size":"", "vdo_block_map_cache_size":"", "vdo_block_map_era_length":"", "vdo_use_sparse_index":"", "vdo_index_memory_size":"", "vdo_slab_size":"", "vdo_ack_threads":"", "vdo_bio_threads":"", "vdo_bio_rotation":"", "vdo_cpu_threads":"", "vdo_hash_zone_threads":"", "vdo_logical_threads":"", "vdo_physical_threads":"", "vdo_max_discard":"", "vdo_write_policy":"", "vdo_header_size":""}
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:              ]
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:          }
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:      ]
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  }
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: 2722:2729 - update_thread exception:
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: Traceback (most recent call last):
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib/python3.6/site-packages/lvmdbusd/fetch.py", line 168, in update_thread
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    need_main_thread)
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib/python3.6/site-packages/lvmdbusd/fetch.py", line 80, in load
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    cfg.db.refresh(log)
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib/python3.6/site-packages/lvmdbusd/lvmdb.py", line 406, in refresh
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    a = cmdhandler.lvm_full_report_json()
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib/python3.6/site-packages/lvmdbusd/cmdhandler.py", line 635, in lvm_full_report_json
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    raise joe
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib/python3.6/site-packages/lvmdbusd/cmdhandler.py", line 631, in lvm_full_report_json
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    return json.loads(out)
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    return _default_decoder.decode(s)
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  File "/usr/lib64/python3.6/json/decoder.py", line 355, in raw_decode
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:    obj, end = self.scan_once(s, idx)
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 4 column 3 (char 36)
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: 2722:2729 - LVM dbus flight recorder START
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: 2722:2729 - EC= 0 for ['/usr/sbin/lvm', 'fullreport', '--noheading', '--separator', '{|}', '--nosuffix', '--unbuffered', '--units', 'b', '-a', '--configreport', 'pv', '-o', 'pv_name,pv_uuid,pv_fmt,pv_size,pv_free,pv_used,dev_size,pv_mda_size,pv_mda_free,pv_ba_start,pv_ba_size,pe_start,pv_pe_count,pv_pe_alloc_count,pv_attr,pv_tags,vg_name,vg_uuid,pv_missing', '--configreport', 'vg', '-o', 'vg_name,vg_uuid,vg_fmt,vg_size,vg_free,vg_sysid,vg_extent_size,vg_extent_count,vg_free_count,vg_profile,max_lv,max_pv,pv_count,lv_count,snap_count,vg_seqno,vg_mda_count,vg_mda_free,vg_mda_size,vg_mda_used_count,vg_attr,vg_tags', '--configreport', 'lv', '-o', 'lv_uuid,lv_name,lv_path,lv_size,vg_name,pool_lv_uuid,pool_lv,origin_uuid,origin,data_percent,lv_attr,lv_tags,vg_uuid,lv_active,data_lv,metadata_lv,lv_parent,lv_role,lv_layout,snap_percent,metadata_percent,copy_percent,sync_percent,lv_metadata_size,move_pv,move_pv_uuid,vdo_operating_mode,vdo_compression_state,vdo_index_state,vdo_used_size,vdo_saving_percent', '--configreport', 'seg', '-o', 'seg_pe_ranges,segtype,lv_uuid,vdo_compression,vdo_deduplication,vdo_use_metadata_hints,vdo_minimum_io_size,vdo_block_map_cache_size,vdo_block_map_era_length,vdo_use_sparse_index,vdo_index_memory_size,vdo_slab_size,vdo_ack_threads,vdo_bio_threads,vdo_bio_rotation,vdo_cpu_threads,vdo_hash_zone_threads,vdo_logical_threads,vdo_physical_threads,vdo_max_discard,vdo_write_policy,vdo_header_size', '--configreport', 'pvseg', '-o', 'pvseg_start,pvseg_size,segtype,pv_uuid,lv_uuid,pv_name', '--reportformat', 'json', '--config', 'global/notify_dbus=0']
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: STARTED: 1636399857.795689, ENDED: 1636399857.938170
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: STDOUT=  {


Version-Release number of selected component (if applicable):
kernel-4.18.0-348.4.el8.kpq0    BUILT: Wed Oct 27 15:00:32 CDT 2021
lvm2-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:17 CDT 2021
lvm2-libs-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:17 CDT 2021
lvm2-dbusd-2.03.14-1.el8    BUILT: Wed Oct 20 10:18:48 CDT 2021

Comment 2 Tony Asleson 2021-11-11 16:04:01 UTC
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]: JSON=
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  {
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:      "report": [
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:          {
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  Consider prunning raid_sanity VG archive with more then 709 MiB in 4904 files (check archiving is needed in lvm.conf).
Nov  8 13:30:57 hayes-02 lvmdbusd[2722]:  Consider prunning raid_sanity VG archive with more then 709 MiB in 4905 files (check archiving is needed in lvm.conf).
...

lvm is outputting a log message in the middle of the JSON output.  These "Consider prunning ..." messages are being outputted to stdout.  Lvm when told to output JSON cannot print messages in the middle of the structured JSON output.  Please move this message and any others like it to stderr.

Comment 3 Zdenek Kabelac 2021-11-11 19:22:04 UTC
Yep - this message was added to inform users about somewhat 'unusual' setup where too large space is consumed by archives.

It's likely to be moved to 'WARNING' - but original I wanted to be just 'information'.

But this 'json' reporting is complicating this report in somewhat 'unexpected' way.

We may need to introduce logging which bypasses  'json'.

Comment 4 Peter Rajnoha 2022-01-05 09:45:13 UTC
Does log/report_command_log=1 help? That should separate the log messages from the usual report.

Comment 5 Corey Marthaler 2022-04-12 01:33:18 UTC
log/report_command_log=1  doesn't seem to do anything helpful here, unless I'm missing something.


[root@hayes-01 ~]# lvcreate -n foobar1 -L 50M FG
  Rounding up size to full physical extent 52.00 MiB
  Consider pruning FG VG archive with more then 379 MiB in 1381 files (check archiving is needed in lvm.conf).
  Logical volume "foobar1" created.

[root@hayes-01 ~]# lvcreate -n foobar2 -L 50M FG
  Rounding up size to full physical extent 52.00 MiB
  Consider pruning FG VG archive with more then 380 MiB in 1382 files (check archiving is needed in lvm.conf).
  Logical volume "foobar2" created.

[root@hayes-01 ~]# lvcreate --config 'log {report_command_log = 1}' -n foobar3 -L 50M FG
  Command Log
  ===========
  Seq LogType Context    ObjType ObjName ObjID                                  ObjGrp  ObjGrpID Msg                                                                                                          Errno RetCode
    1 print   processing vg      FG      WzF688-Xsy9-QL8R-JOAM-42j8-enky-JRe6Tj                  Rounding up size to full physical extent 52.00 MiB                                                               0       0
    2 print   processing vg      FG      WzF688-Xsy9-QL8R-JOAM-42j8-enky-JRe6Tj                  Consider pruning FG VG archive with more then 380 MiB in 1383 files (check archiving is needed in lvm.conf).     0       0
    3 print   processing vg      FG      WzF688-Xsy9-QL8R-JOAM-42j8-enky-JRe6Tj                  Logical volume "foobar3" created.                                                                                0       0

[root@hayes-01 ~]# lvcreate --config 'log {report_command_log = 0}' -n foobar4 -L 50M FG
  Rounding up size to full physical extent 52.00 MiB
  Consider pruning FG VG archive with more then 381 MiB in 1384 files (check archiving is needed in lvm.conf).
  Logical volume "foobar4" created.

Comment 6 Peter Rajnoha 2022-04-12 07:31:41 UTC
If you switch to JSON output (like "lvcreate --reportformat json --config 'log {report_command_log = 1}' -n foobar3 -L 50M FG"), then the command log will be in its own proper JSON section, not as plain text interleaved with other JSON output. Then lvmdbusd should be able to parse it properly as it'll be full JSON output.

Comment 7 Peter Rajnoha 2022-04-12 07:33:18 UTC
(...so then the fix would be for lvmdbusd needs to call lvm commands with that report_command_log=1)

Comment 8 Peter Rajnoha 2022-04-12 08:03:30 UTC
I've just noticed that we already include report_command_log=1 lvmdbusd.profile that lvmdbusd uses:

  log {                                                                                                                                   
          # lvmdbusd relies on command log report to inspect LVM command's execution status                                               
          report_command_log=1                                                                                                                                                                                                                                                                                                   
          # display only outermost LVM shell-related log that lvmdbusd inspects first after LVM command execution (it calls 'lastlog' for more detailed log afterwards if needed)
          command_log_selection="log_context=shell"                                                                                       
          command_log_cols="log_seq_num,log_type,log_context,log_object_type,log_object_name,log_object_id,log_object_group,log_object_group_id,log_message,log_errno,log_ret_code"
          command_log_sort="log_seq_num"                                                                                                  
  }

It seems the report_command_log is not applied through the config profile - a bug then. Will check further...

Comment 9 Peter Rajnoha 2022-08-24 16:59:50 UTC
I got to this again after a while...

Trying this on command line with /etc/lvm/archive full of files to trigger the "Consider pruning..." message, it works as expected:

  # vgcfgrestore --yes vg
    Restored volume group vg.


  # LVM_COMMAND_PROFILE=lvmdbusd lvm fullreport
    {
        "report": [
        ... (complete JSON report without any messages interleaved)
        "log": [
        ]
    }

When I change the "command_log_selection" to "command_log_selection=all" in lvmdbusd.priofile to report full log, I get:

 # vgcfgrestore --yes vg
   Restored volume group vg.

  # LVM_COMMAND_PROFILE=lvmdbusd lvm fullreport
    {
       "report": [
            ... (complete JSON report without any messages interleaved)

       "log": [
          {"log_seq_num":"1", "log_type":"print", "log_context":"processing", "log_object_type":"vg", "log_object_name":"vg", "log_object_id":"mWuhgp-HWfp-9AfH-nnCD-wYNy-yXLT-bhCE7H", "log_object_group":"", "log_object_group_id":"", "log_message":"Consider pruning vg VG archive with more then 8 MiB in 10061 files (check archiving is needed in lvm.conf).", "log_errno":"0", "log_ret_code":"0"},
          {"log_seq_num":"2", "log_type":"print", "log_context":"processing", "log_object_type":"vg", "log_object_name":"vg", "log_object_id":"mWuhgp-HWfp-9AfH-nnCD-wYNy-yXLT-bhCE7H", "log_object_group":"", "log_object_group_id":"", "log_message":"Consider pruning vg VG archive with more then 8 MiB in 10062 files (check archiving is needed in lvm.conf).", "log_errno":"0", "log_ret_code":"0"},
            ...

Which means the "Consider pruning..." messages are properly reported in the "log" report and not interleaved without any JSON formatting.

However, if I check this inside systemctl status lvm2-lvmdbusd.profile, I can see the same issue as Corey hit. Now, I'm not quite sure what the issue is inside lvmdbusd then - it should be calling an equivalent to "LVM_COMMAND_PROFILE=lvmdbusd lvm fullreport" and so the report should end up correctly formatted as it is when running the lvm fullreport from command line. So something must be different there inside lvmdbusd...

Comment 10 Tony Asleson 2022-08-24 17:44:02 UTC
(In reply to Peter Rajnoha from comment #9)
> However, if I check this inside systemctl status lvm2-lvmdbusd.profile, I
> can see the same issue as Corey hit. Now, I'm not quite sure what the issue
> is inside lvmdbusd then - it should be calling an equivalent to
> "LVM_COMMAND_PROFILE=lvmdbusd lvm fullreport" and so the report should end
> up correctly formatted as it is when running the lvm fullreport from command
> line. So something must be different there inside lvmdbusd...

I believe the problem is that when we are in fork & exec mode lvmdbusd isn't setting LVM_COMMAND_PROFILE=lvmdbusd.
Lvmdbusd does when we are using lvmshell.  I'll add this to my existing patch set.

Comment 11 Peter Rajnoha 2022-08-25 08:26:25 UTC
OK, switching over to you then...

Comment 12 Tony Asleson 2022-09-19 19:02:23 UTC
Correction posted upstream: https://sourceware.org/git/?p=lvm2.git;a=commit;h=a5e6947d74f7b88f7f0df4328a923ad82a970634

Comment 15 Corey Marthaler 2023-01-03 22:45:28 UTC
Marking this Verified:Tested in the latest rpms.

kernel-4.18.0-447.el8    BUILT: Thu Dec 22 12:57:53 CST 2022
lvm2-2.03.14-9.el8    BUILT: Thu Dec  8 10:40:55 CST 2022
lvm2-libs-2.03.14-9.el8    BUILT: Thu Dec  8 10:40:55 CST 2022


This scenario no longer causes the JSONDecodeError traceback when the 'Consider pruning' warnings are present.

[root@hayes-02 archive]# pwd
/etc/lvm/archive
[root@hayes-02 archive]# ls -lrt | wc -l
1559
[root@hayes-02 tmp]# ps -ef | grep lvmdbus
root        2847       1 37 16:03 ?        00:14:51 /usr/libexec/platform-python /usr/sbin/lvmdbusd


SCENARIO (raid1) - [recover_corrupt_mda_below_raid_w_no_restorefile]
Create a raid, corrupt its metadata and restore the volume using no backup file
Create a raid on hayes-02, corrupt its metadata, and then restore the volume using no backup file
hayes-02: lvcreate --yes  --nosync --type raid1 -m 1 -n corrupt_meta_raid -L 300M raid_sanity
  WARNING: New raid1 won't be synchronised. Don't read what you didn't write!
Corrupting PV /dev/sdc1 (used in this raid)
1000+0 records in
1000+0 records out
512000 bytes (512 kB, 500 KiB) copied, 0.0169215 s, 30.3 MB/s
Running vgck (bug 894136)
  WARNING: Couldn't find device with uuid 6COfwU-ReLn-6moA-XmLZ-kfdb-G2Ji-hUQle3.
  WARNING: VG raid_sanity is missing PV 6COfwU-ReLn-6moA-XmLZ-kfdb-G2Ji-hUQle3 (last written to /dev/sdc1).
  The volume group is missing 1 physical volumes.
Activating VG in partial readonly mode
vgchange -an --partial raid_sanity
  PARTIAL MODE. Incomplete logical volumes will be processed.
  WARNING: Couldn't find device with uuid 6COfwU-ReLn-6moA-XmLZ-kfdb-G2Ji-hUQle3.
  WARNING: VG raid_sanity is missing PV 6COfwU-ReLn-6moA-XmLZ-kfdb-G2Ji-hUQle3 (last written to /dev/sdc1).
Recreating PV using its old uuid
pvcreate -ff -y --norestorefile --uuid "6COfwU-ReLn-6moA-XmLZ-kfdb-G2Ji-hUQle3" /dev/sdc1
Restoring the VG back to its original state
vgcfgrestore --yes raid_sanity
Reactivating VG

Waiting until all mirror|raid volumes become fully syncd...
   1/1 mirror(s) are fully synced: ( 100.00% )
Sleeping 15 sec
perform raid rebuilding (lvchange --yes --rebuild /dev/sdc1 raid_sanity/corrupt_meta_raid)
rebuild attr:raid_sanity-corrupt_meta_raid: 0 614400 raid raid1 2 aA 231168/614400 recover 0 0 -

Waiting until all mirror|raid volumes become fully syncd...
   1/1 mirror(s) are fully synced: ( 100.00% )
Sleeping 15 sec

Deactivating raid corrupt_meta_raid... and removing


[root@hayes-02 tmp]# grep JSONDecodeError /var/log/messages
[root@hayes-02 tmp]#

Comment 19 errata-xmlrpc 2023-05-16 09:11:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (lvm2 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3048