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 1703920

Summary: IOError: [Errno 13] Permission denied: '/etc/rhsm/syspurpose/syspurpose.json'
Product: Red Hat Enterprise Linux 7 Reporter: qianzhan
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.7CC: csnyder
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-02 15:54:52 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:
Attachments:
Description Flags
rhsm.log none

Description qianzhan 2019-04-29 06:31:32 UTC
Description of problem:
IOError: [Errno 13] Permission denied: '/etc/rhsm/syspurpose/syspurpose.json'

Version-Release number of selected component (if applicable):
subscription-manager-1.24.4-1.el7.x86_64
tfm-rubygem-katello-3.10.0.46-1.el7sat.noarch
katello-3.10.0-0.6.rc1.el7sat.noarch
candlepin-2.5.15-1.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. Register RHEL-7.7-20190424.0 against Satellite6.5-snapshot25.0
2. Set splay=0 and certcheckinterval=2 in rhsm.conf
3. Check rhsm.log:

2019-04-29 14:20:51,472 [INFO] rhsmcertd-worker:11328:MainThread @dmiinfo.py:76 - Using dmidecode dump file: /dev/mem
2019-04-29 14:20:54,185 [INFO] rhsmcertd-worker:11328:MainThread @connection.py:638 - Response: status=200, request="GET /rhsm/consumers/c0b17e82-ac23-41cb-9754-78f6563f68bf"
2019-04-29 14:20:56,402 [INFO] rhsmcertd-worker:11328:MainThread @connection.py:638 - Response: status=200, request="PUT /rhsm/consumers/c0b17e82-ac23-41cb-9754-78f6563f68bf"
2019-04-29 14:20:56,403 [WARNING] rhsmcertd-worker:11328:MainThread @base_action_client.py:71 - Exception caught while running <subscription_manager.syspurposelib.SyspurposeSyncActionInvoker object at 0x7f42a5bc5c10> update
2019-04-29 14:20:56,403 [ERROR] rhsmcertd-worker:11328:MainThread @base_action_client.py:72 - [Errno 13] Permission denied: '/etc/rhsm/syspurpose/syspurpose.json'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/subscription_manager/base_action_client.py", line 62, in _run_update
    update_report = lib.update()
  File "/usr/lib64/python2.7/site-packages/subscription_manager/certlib.py", line 32, in update
    self.report = self.locker.run(self._do_update)
  File "/usr/lib64/python2.7/site-packages/subscription_manager/certlib.py", line 18, in run
    return action()
  File "/usr/lib64/python2.7/site-packages/subscription_manager/syspurposelib.py", line 138, in _do_update
    return action.perform()
  File "/usr/lib64/python2.7/site-packages/subscription_manager/syspurposelib.py", line 199, in perform
    result = store.sync()
  File "/usr/lib/python2.7/site-packages/syspurpose/files.py", line 289, in sync
    self.update_local(local_result),
  File "/usr/lib/python2.7/site-packages/syspurpose/files.py", line 361, in update_local
    return self.update_file(self.path, data)
  File "/usr/lib/python2.7/site-packages/syspurpose/files.py", line 494, in update_file
    f = io.open(path, mode, encoding='utf-8')
IOError: [Errno 13] Permission denied: '/etc/rhsm/syspurpose/syspurpose.json'


Actual results:
As step 3.

Expected results:
There should not be any error for syspurpose.json

Additional info:
Please refer attachment 'rhsm.log'

Comment 2 qianzhan 2019-04-29 06:32:56 UTC
Created attachment 1559793 [details]
rhsm.log

Comment 3 Chris Snyder 2019-04-29 18:26:25 UTC
I suspect this has the same root cause as https://bugzilla.redhat.com/show_bug.cgi?id=1703573 .

If you `setenforce 0`, do you get the same issue?

Comment 4 qianzhan 2019-04-30 07:19:18 UTC
I can not get the same issue any more:

[root@ent-01-vm-04 ~]# setenforce 0
[root@ent-01-vm-04 ~]# getenforce
Permissive
[root@ent-01-vm-04 ~]# cat /var/log/rhsm/rhsm.log | grep Err
[root@ent-01-vm-04 ~]#

Comment 5 Chris Snyder 2019-05-02 15:54:52 UTC

*** This bug has been marked as a duplicate of bug 1703573 ***