Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1281775

Summary: spacewalk-data-fsck should emit an error when there is totally wrong path instead of ValueError
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: OtherAssignee: Gennadii Altukhov <galtukho>
Status: CLOSED CURRENTRELEASE QA Contact: Dimitar Yordanov <dyordano>
Severity: low Docs Contact:
Priority: unspecified    
Version: 570CC: dyordano, galtukho, tkasparek, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:10:19 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:
Bug Depends On:    
Bug Blocks: 1358815    

Description Jan Hutař 2015-11-13 12:17:22 UTC
Description of problem:
spacewalk-data-fsck should emit an error when there is totally wrong path instead of "ValueError: too many values to unpack"


Version-Release number of selected component (if applicable):
spacewalk-backend-tools-2.3.3-33.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. # spacewalk-sql -i
   rhnschema=# update rhnPackage set path = 'redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/FOOBAR/enca-1.16-1.el6.x86_64.rpm' where id=16330;
2. # mkdir /var/satellite/redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/FOOBAR/
   # cp /var/satellite/redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/enca-1.16-1.el6.x86_64.rpm /var/satellite/redhat/1/5ea/enca/1.16-1.el6/x86_64/<hash>/FOOBAR/
3. # spacewalk-data-fsck -v --fix-file-path


Actual results:
# spacewalk-data-fsck -v --fix-file-path
Checking if packages from database are present on filesystem
Traceback (most recent call last):
  File "/usr/bin/spacewalk-data-fsck", line 321, in <module>
    exit_value += check_db_vs_disk(options)
  File "/usr/bin/spacewalk-data-fsck", line 102, in check_db_vs_disk
    report['restore'] +=  check_disk_nevrao(abs_path, row.copy(), True)
  File "/usr/bin/spacewalk-data-fsck", line 148, in check_disk_nevrao
    file['basename']) = row['path'].split('/')
ValueError: too many values to unpack


Expected results:
Just error message should be printed and the tool should go on


Additional info:
I understand that I have create the breakage manually (and I guess that change in the DB is not required at all), but this tool is supposed to deal with breakages AFAICT.

Comment 1 Jan Hutař 2015-11-13 12:18:04 UTC
This was found when working on bug 1201007

Comment 2 Gennadii Altukhov 2016-01-21 09:41:27 UTC
Taking...

Comment 3 Gennadii Altukhov 2016-01-21 13:40:04 UTC
spacewalk.git:

81e1a9c3a4edde4e760cc6b866b762c782db1b18

changes to fix:
0) Added processing of ValueError exception