Bug 1142337 - rhncfg-client produces "Corrupt file received: Content checksums do not match!" errors when using macros
Summary: rhncfg-client produces "Corrupt file received: Content checksums do not match...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Configuration Management
Version: 560
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: ---
Assignee: Stephen Herr
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks: 465198 1142412 1165223
TreeView+ depends on / blocked
 
Reported: 2014-09-16 15:25 UTC by Stephan Dühr
Modified: 2018-12-06 18:01 UTC (History)
3 users (show)

Fixed In Version: rhncfg-5.10.55-11
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1142412 (view as bug list)
Environment:
Last Closed: 2014-09-18 14:20:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1142412 0 urgent CLOSED rhncfg-client produces "Corrupt file received: Content checksums do not match!" errors when using macros 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2014:1261 0 normal SHIPPED_LIVE rhncfg bug fix update 2014-09-18 18:20:31 UTC

Internal Links: 1142412

Description Stephan Dühr 2014-09-16 15:25:00 UTC
Description of problem:

When Config-Files with macros are used, using rhncfg-client get or rhncfg-client verify fails with
Traceback (most recent call last):
  File "/usr/bin/rhncfg-client", line 38, in <module>
    sys.exit(Main().main() or 0)
  File "/usr/share/rhn/config_common/rhn_main.py", line 207, in main
    handler.run()
  File "/usr/share/rhn/config_client/rhncfgcli_get.py", line 25, in run
    self.options.exclude)
  File "/usr/share/rhn/config_common/deploy.py", line 42, in deploy_files
    finfo = repository.get_file_info(*args, **kwargs)
  File "/usr/share/rhn/config_client/rpc_cli_repository.py", line 91, in get_file_info
    temp_file, dirs_created = f.process(result, directory=dest_directory)
  File "/usr/share/rhn/config_common/file_utils.py", line 81, in process
    raise Exception, "Corrupt file received: Content checksums do not match!"
Exception: Corrupt file received: Content checksums do not match!

Version-Release number of selected component (if applicable):
rhncfg-client-5.10.55-10.el6sat.noarch
rhncfg-5.10.55-10.el6sat.noarch
rhncfg-actions-5.10.55-10.el6sat.noarch

How reproducible:
Use a macro in a config file, eg. in /etc/postfix/main.cf:
myhostname = {| rhn.system.hostname |}

Steps to Reproduce:
1. add
myhostname = {| rhn.system.hostname |}
to /etc/postfix/main.cf in a config channel.
Probably the same for any other file/macro
2. run rhncfg-client get /etc/postfix/main.cf on the client system
3. 

Actual results:
Traceback (most recent call last):
  File "/usr/bin/rhncfg-client", line 38, in <module>
    sys.exit(Main().main() or 0)
  File "/usr/share/rhn/config_common/rhn_main.py", line 207, in main
    handler.run()
  File "/usr/share/rhn/config_client/rhncfgcli_verify.py", line 73, in run
    (src, file_info, dirs_created) = self.repository.get_file_info(file)
  File "/usr/share/rhn/config_client/rpc_cli_repository.py", line 91, in get_file_info
    temp_file, dirs_created = f.process(result, directory=dest_directory)
  File "/usr/share/rhn/config_common/file_utils.py", line 81, in process
    raise Exception, "Corrupt file received: Content checksums do not match!"
Exception: Corrupt file received: Content checksums do not match!

Expected results:
Config files with macros should be deployed

Additional info:

Comment 1 Stephan Dühr 2014-09-16 15:27:09 UTC
forgot to mention that it works again after
yum downgrade rhncfg-5.10.55-8.el6sat rhncfg-client-5.10.55-8.el6sat rhncfg-actions-5.10.55-8.el6sat

Comment 2 Stephan Dühr 2014-09-16 16:44:32 UTC
I could reproduce this also with
rhncfg-5.10.77-1.el6.noarch
rhncfg-client-5.10.77-1.el6.noarch
rhncfg-actions-5.10.77-1.el6.noarch
from http://yum.spacewalkproject.org/nightly-client/RHEL/6/x86_64/
against spacewalk 2.2 (not spacewalk nightly, don't know if any
server part has an impact on this.)

Comment 3 Stephen Herr 2014-09-16 17:38:20 UTC
The fix for this problem is going to come in two parts.

Part 1 - client side:
We will release updated rhncfg* packages that cause this exception to not happen. This will ensure that the latest rhncfg works correctly against any version of Red Hat Satellite or RHN Classic.

Part 2 - serer side:
We will release updated spacewalk-backend packages for Satellite that will correctly checksum config files containing macros.

When using updated Satellite with an updated client then checksum validation of the config file contents will happen and work correctly before the config file is deployed. If using only an updated client then config file deployment will happen correctly, however the contents will not be validated (the same behavior as rhncfg-5.10.55-8).

This bug will track part 1. I will create a clone to track part 2.

Comment 4 Stephen Herr 2014-09-16 18:32:58 UTC
Committing to Spacewalk master:
2328a546d67847a61923bbe6f4085a8d2a802fba

Comment 7 Xixi 2014-09-16 21:32:03 UTC
KCS Solution https://access.redhat.com/solutions/1198383 with workaround has been updated with current status and BZ#s (thanks Stephen for heads-up!).

Comment 12 errata-xmlrpc 2014-09-18 14:20:42 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2014-1261.html


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