Bug 1142412 - 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: Dimitar Yordanov
URL:
Whiteboard:
Depends On: 1142337
Blocks: 465198 1165223
TreeView+ depends on / blocked
 
Reported: 2014-09-16 17:39 UTC by Stephen Herr
Modified: 2018-12-06 18:01 UTC (History)
7 users (show)

Fixed In Version: spacewalk-backend-2.0.3-32
Doc Type: Bug Fix
Doc Text:
Previously, in the event of networking problems, empty or corrupt configuration files could be deployed on client servers. This update, when combined on the clients with the rhncfg packages of version 5.10.55-11 or later, verifies the checksum of the received files before deploying them, which ensures that the correct files are deployed.
Clone Of: 1142337
: 1165223 (view as bug list)
Environment:
Last Closed: 2014-12-18 12:25:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1142337 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 Knowledge Base (Solution) 1198383 0 None None None Never
Red Hat Product Errata RHBA-2014:2017 0 normal SHIPPED_LIVE Red Hat Satellite bug fix update 2014-12-18 17:25:05 UTC

Internal Links: 1142337

Description Stephen Herr 2014-09-16 17:39:11 UTC
+++ This bug was initially created as a clone of Bug #1142337 +++

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:

--- Additional comment from Stephan Dühr on 2014-09-16 11:27:09 EDT ---

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

--- Additional comment from Stephan Dühr on 2014-09-16 12:44:32 EDT ---

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.)

--- Additional comment from Stephen Herr on 2014-09-16 13:38:20 EDT ---

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 2.

Comment 1 Stephen Herr 2014-09-16 18:33:32 UTC
Committing to Spacewalk master:
f277fad6b1e808da221314a6253698187230084b

Comment 14 errata-xmlrpc 2014-12-18 12:25:46 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.

https://rhn.redhat.com/errata/RHBA-2014-2017.html


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