Bug 737145 - redhat.repo contains 50 blank lines at the top
redhat.repo contains 50 blank lines at the top
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.2
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Bryan Kearney
John Sefler
:
Depends On:
Blocks: rhsm-rhel62 691780 747120 748554
  Show dependency treegraph
 
Reported: 2011-09-09 14:33 EDT by Alexander Todorov
Modified: 2013-01-10 05:54 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 12:24:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Alexander Todorov 2011-09-09 14:33:47 EDT
Description of problem:
# cat -n redhat.repo
     1  #
     2  # Certificate-Based Repositories
     3  # Managed by (rhsm) subscription-manager
     4  #
     5  
     6  
     7  
     8  
     9  
    10  
    11  
    12  
    13  
    14  
    15  
    16  
    17  
    18  
    19  
    20  
    21  
    22  
    23  
    24  
    25  
    26  
    27  
    28  
    29  
    30  
    31  
    32  
    33  
    34  
    35  
    36  
    37  
    38  
    39  
    40  
    41  
    42  
    43  
    44  
    45  
    46  
    47  
    48  
    49  
    50  
    51  
    52  
    53  
    54  
    55  
    56  
    57  
    58  
    59  
    60  [rhel-ha-for-rhel-6-server-beta-debug-rpms]
    61  name = Red Hat Enterprise Linux High Availability (for RHEL 6 Server) Beta (Debug RPMs)
    62  baseurl = https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/highavailability/debug
    63  enabled = 0
    64  gpgcheck = 1

... skip ...

Version-Release number of selected component (if applicable):
subscription-manager-0.96.8-1.el6.x86_64

How reproducible:
always on virt-guest

Steps to Reproduce:
1. Register the system (stage env) and subscribe to employee subscription
2. Try to install a package so that redhat.repo is generated
3. Open the file in text editor
  
Actual results:
There are more than 50 blank lines at the top and when opened in console text editor it looks like it is empty. 

Expected results:
No blanks

Additional info:
Comment 4 James Bowes 2011-10-07 08:42:17 EDT
fixed in master, 87751d4182e
and RHEL6.2, 22c4d3ff65d6 (next build 0.96.14-1)
Comment 5 J.C. Molet 2011-10-10 16:47:25 EDT
I ran this against the test data and it inserted two newlines instead of 50.  This is acceptable as a visual separation between the comments normally found in the redhat.repo and the repo section.

Marking this VERIFIED, against:
subscription-manager-gnome-0.96.13-1.git.5.2e86717.el6.x86_64
subscription-manager-0.96.13-1.git.5.2e86717.el6.x86_64
python-rhsm-0.96.13-1.git.0.a237980.el6.noarch
subscription-manager-firstboot-0.96.13-1.git.5.2e86717.el6.x86_64

Steps to reproduce:

[root@jmolet-vm0 ~]# subscription-manager register --user testuser1 --password password --org admin
The system has been registered with id: fd8743dc-925f-448c-886c-b9513a232d1f 
[root@jmolet-vm0 ~]# cat /etc/yum.repos.d/redhat.repo 

[root@jmolet-vm0 ~]# subscription-manager subscribe --auto
Installed Product Current Status:

ProductName:         	Awesome OS for S390 Bits 
Status:               	Not Subscribed           


ProductName:         	Stackable with Awesome OS for x86_64 Bits
Status:               	Subscribed               

... and lots more ...       

[root@jmolet-vm0 ~]# yum repolist
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating certificate-based repositories.

... and yum stuff gets printed ..

[root@jmolet-vm0 ~]# head /etc/yum.repos.d/redhat.repo 



[awesomeos-i386]
name = awesomeos-i386
baseurl = https://cdn.redhat.com/path/to/awesomeos/i386
enabled = 0
gpgcheck = 1
gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
sslverify = 1
Comment 6 John Sefler 2011-10-15 01:31:58 EDT
This is still failing for me.....

[root@hp-dl385g5p-01 ~]# rpm -q subscription-manager
subscription-manager-0.96.14-1.el6.x86_64
[root@hp-dl385g5p-01 ~]# rpm -q python-rhsm
python-rhsm-0.96.13-1.el6.noarch



[root@hp-dl385g5p-01 ~]# cat -n /etc/yum.repos.d/redhat.repo | head -n 50
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#


[root@hp-dl385g5p-01 ~]# subscription-manager subscribe --pool 8a99f981308acf4201309911639a0c51
Successfully subscribed the system to Pool 8a99f981308acf4201309911639a0c51
[root@hp-dl385g5p-01 ~]# yum -q repolist
[root@hp-dl385g5p-01 ~]# cat -n /etc/yum.repos.d/redhat.repo | head -n 50
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
     6	
     7	[rhel-ha-for-rhel-6-server-beta-debug-rpms]
     8	name = Red Hat Enterprise Linux High Availability (for RHEL 6 Server) Beta (Debug RPMs)
     9	baseurl = https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/highavailability/debug
    10	enabled = 0
    11	gpgcheck = 1
    12	gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    13	sslverify = 1
    14	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    15	sslclientkey = /etc/pki/entitlement/6091562328979435946-key.pem
    16	sslclientcert = /etc/pki/entitlement/6091562328979435946.pem
    17	metadata_expire = 86400
    18	
    19	[rhel-6-server-rpms]
    20	name = Red Hat Enterprise Linux 6 Server (RPMs)
    21	baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/os
    22	enabled = 1
    23	gpgcheck = 1
    24	gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    25	sslverify = 1
    26	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    27	sslclientkey = /etc/pki/entitlement/6091562328979435946-key.pem
    28	sslclientcert = /etc/pki/entitlement/6091562328979435946.pem
    29	metadata_expire = 86400
    30	
    31	[rhel-rs-for-rhel-6-server-beta-source-rpms]
    32	name = Red Hat Enterprise Linux Resilient Storage (for RHEL 6 Server) Beta (Source RPMs)
    33	baseurl = https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/resilientstorage/source/SRPMS
    34	enabled = 0
    35	gpgcheck = 1
    36	gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    37	sslverify = 1
    38	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    39	sslclientkey = /etc/pki/entitlement/6091562328979435946-key.pem
    40	sslclientcert = /etc/pki/entitlement/6091562328979435946.pem
    41	metadata_expire = 86400
    42	
    43	[rhel-6-server-source-rpms]
    44	name = Red Hat Enterprise Linux 6 Server (Source RPMs)
    45	baseurl = https://cdn.redhat.com/content/dist/rhel/server/6/$releasever/$basearch/source/SRPMS
    46	enabled = 0
    47	gpgcheck = 1
    48	gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    49	sslverify = 1
    50	sslcacert = /etc/rhsm/ca/redhat-uep.pem


[root@hp-dl385g5p-01 ~]# subscription-manager unsubscribe --all
[root@hp-dl385g5p-01 ~]# yum -q repolist
[root@hp-dl385g5p-01 ~]# cat -n /etc/yum.repos.d/redhat.repo | head -n 50
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
     6	
     7	
     8	
     9	
    10	
    11	
    12	
    13	
    14	
    15	
    16	
    17	
    18	
    19	
    20	
    21	
    22	
    23	
    24	
    25	
    26	
    27	
    28	
    29	
    30	
    31	
    32	
    33	
    34	
    35	
    36	
    37	
    38	
    39	
    40	
    41	
    42	
    43	
    44	
    45	
    46	
    47	
    48	
    49	


[root@hp-dl385g5p-01 ~]# subscription-manager subscribe --pool 8a99f981308acf4201309911639a0c51
Successfully subscribed the system to Pool 8a99f981308acf4201309911639a0c51
[root@hp-dl385g5p-01 ~]# yum -q repolist
[root@hp-dl385g5p-01 ~]# cat -n /etc/yum.repos.d/redhat.repo | head -n 60
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
     6	
     7	
     8	
     9	
    10	
    11	
    12	
    13	
    14	
    15	
    16	
    17	
    18	
    19	
    20	
    21	
    22	
    23	
    24	
    25	
    26	
    27	
    28	
    29	
    30	
    31	
    32	
    33	
    34	
    35	
    36	
    37	
    38	
    39	
    40	
    41	
    42	
    43	
    44	
    45	
    46	
    47	
    48	
    49	
    50	
    51	
    52	[rhel-ha-for-rhel-6-server-beta-debug-rpms]
    53	name = Red Hat Enterprise Linux High Availability (for RHEL 6 Server) Beta (Debug RPMs)
    54	baseurl = https://cdn.redhat.com/content/beta/rhel/server/6/$releasever/$basearch/highavailability/debug
    55	enabled = 0
    56	gpgcheck = 1
    57	gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    58	sslverify = 1
    59	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    60	sslclientkey = /etc/pki/entitlement/4820244449090838841-key.pem


^^^ THE ABOVE EXAMPLE SHOWS THAT AS YOU UNSUBSCRIBE, BLANK LINES ARE LEFT BEHIND AND THEN A NEW SUBSCRIBE SIMPLY APPENDS ONTO THE END OF THE BLANK LINES.


moving back to NEW/FailedQA
Comment 7 James Bowes 2011-10-18 09:23:06 EDT
new fixed checked in to handle wholesale removal and readdition of repos.
rhel6.2 752b60f7f2a1a
master 5c75be7023aa
Comment 8 John Sefler 2011-10-18 14:09:52 EDT
Verifying Version...
[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.15-1.git.7.fbf42c7.el6.x86_64

[root@jsefler-onprem-62server ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: 0272e18d-70bc-4969-a201-6f4d91bc40d1
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo 
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
[root@jsefler-onprem-62server ~]# 
[root@jsefler-onprem-62server ~]# subscription-manager subscribe --pool 8a90f8053317f594013317f6f18906f6 --pool 8a90f8053317f594013317f6f13c06ea --pool 8a90f8053317f594013317f6ef9b069e --pool 8a90f8053317f594013317f6e60904f3
Successfully subscribed the system to Pool 8a90f8053317f594013317f6f18906f6
Successfully subscribed the system to Pool 8a90f8053317f594013317f6f13c06ea
Successfully subscribed the system to Pool 8a90f8053317f594013317f6ef9b069e
Successfully subscribed the system to Pool 8a90f8053317f594013317f6e60904f3
[root@jsefler-onprem-62server ~]# yum -q repolist
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
https://cdn.redhat.com/foo/path/always/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"
Trying other mirror.
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo 
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
     6	[awesomeos]
     7	name = awesomeos
     8	baseurl = https://cdn.redhat.com/path/to/awesomeos
     9	enabled = 1
    10	gpgcheck = 1
    11	gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
    12	sslverify = 1
    13	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    14	sslclientkey = /etc/pki/entitlement/1655614377564299070-key.pem
    15	sslclientcert = /etc/pki/entitlement/1655614377564299070.pem
    16	metadata_expire = 3600
    17	
    18	[awesomeos-x86_64]
    19	name = awesomeos-x86_64
    20	baseurl = https://cdn.redhat.com/path/to/awesomeos/x86_64
    21	enabled = 0
    22	gpgcheck = 1
    23	gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
    24	sslverify = 1
    25	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    26	sslclientkey = /etc/pki/entitlement/8497383352960602118-key.pem
    27	sslclientcert = /etc/pki/entitlement/8497383352960602118.pem
    28	metadata_expire = 3600
    29	
    30	[awesomeos-all]
    31	name = awesomeos-all
    32	baseurl = https://cdn.redhat.com/path/to/awesomeos/all
    33	enabled = 0
    34	gpgcheck = 1
    35	gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
    36	sslverify = 1
    37	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    38	sslclientkey = /etc/pki/entitlement/1655614377564299070-key.pem
    39	sslclientcert = /etc/pki/entitlement/1655614377564299070.pem
    40	metadata_expire = 3600
    41	
    42	[never-enabled-content]
    43	name = never-enabled-content
    44	baseurl = https://cdn.redhat.com/foo/path/never
    45	enabled = 0
    46	gpgcheck = 1
    47	gpgkey = https://cdn.redhat.com/foo/path/never/gpg
    48	sslverify = 1
    49	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    50	sslclientkey = /etc/pki/entitlement/5662653900645123485-key.pem
    51	sslclientcert = /etc/pki/entitlement/5662653900645123485.pem
    52	metadata_expire = 600
    53	
    54	[always-enabled-content]
    55	name = always-enabled-content
    56	baseurl = https://cdn.redhat.com/foo/path/always
    57	enabled = 1
    58	gpgcheck = 1
    59	gpgkey = https://cdn.redhat.com/foo/path/always/gpg
    60	sslverify = 1
    61	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    62	sslclientkey = /etc/pki/entitlement/5662653900645123485-key.pem
    63	sslclientcert = /etc/pki/entitlement/5662653900645123485.pem
    64	metadata_expire = 200
    65	
    66	[content-label]
    67	name = content
    68	baseurl = https://cdn.redhat.com/foo/path
    69	enabled = 1
    70	gpgcheck = 1
    71	gpgkey = https://cdn.redhat.com/foo/path/gpg/
    72	sslverify = 1
    73	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    74	sslclientkey = /etc/pki/entitlement/5662653900645123485-key.pem
    75	sslclientcert = /etc/pki/entitlement/5662653900645123485.pem
    76	metadata_expire = 0
    77	
    78	[awesomeos-z80]
    79	name = awesomeos-z80
    80	baseurl = https://cdn.redhat.com/path/to/awesomeos/z80
    81	enabled = 0
    82	gpgcheck = 1
    83	gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
    84	sslverify = 1
    85	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    86	sslclientkey = /etc/pki/entitlement/1655614377564299070-key.pem
    87	sslclientcert = /etc/pki/entitlement/1655614377564299070.pem
    88	metadata_expire = 3600
[root@jsefler-onprem-62server ~]# 
[root@jsefler-onprem-62server ~]# subscription-manager list --consumed | grep Serial
SerialNumber:       	5662653900645123485      
SerialNumber:       	1655614377564299070      
SerialNumber:       	8497383352960602118      
SerialNumber:       	7333167010416872216      
[root@jsefler-onprem-62server ~]# subscription-manager unsubscribe --serial 5662653900645123485 --serial 1655614377564299070
[root@jsefler-onprem-62server ~]# yum -q repolist
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
https://cdn.redhat.com/foo/path/always/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"
Trying other mirror.
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo 
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
     6	[awesomeos]
     7	name = awesomeos
     8	baseurl = https://cdn.redhat.com/path/to/awesomeos
     9	enabled = 1
    10	gpgcheck = 1
    11	gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
    12	sslverify = 1
    13	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    14	sslclientkey = /etc/pki/entitlement/8497383352960602118-key.pem
    15	sslclientcert = /etc/pki/entitlement/8497383352960602118.pem
    16	metadata_expire = 3600
    17	
    18	[awesomeos-x86_64]
    19	name = awesomeos-x86_64
    20	baseurl = https://cdn.redhat.com/path/to/awesomeos/x86_64
    21	enabled = 0
    22	gpgcheck = 1
    23	gpgkey = https://cdn.redhat.com/path/to/awesomeos/gpg/
    24	sslverify = 1
    25	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    26	sslclientkey = /etc/pki/entitlement/8497383352960602118-key.pem
    27	sslclientcert = /etc/pki/entitlement/8497383352960602118.pem
    28	metadata_expire = 3600
    29	
    30	[never-enabled-content]
    31	name = never-enabled-content
    32	baseurl = https://cdn.redhat.com/foo/path/never
    33	enabled = 0
    34	gpgcheck = 1
    35	gpgkey = https://cdn.redhat.com/foo/path/never/gpg
    36	sslverify = 1
    37	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    38	sslclientkey = /etc/pki/entitlement/5662653900645123485-key.pem
    39	sslclientcert = /etc/pki/entitlement/5662653900645123485.pem
    40	metadata_expire = 600
    41	
    42	[always-enabled-content]
    43	name = always-enabled-content
    44	baseurl = https://cdn.redhat.com/foo/path/always
    45	enabled = 1
    46	gpgcheck = 1
    47	gpgkey = https://cdn.redhat.com/foo/path/always/gpg
    48	sslverify = 1
    49	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    50	sslclientkey = /etc/pki/entitlement/5662653900645123485-key.pem
    51	sslclientcert = /etc/pki/entitlement/5662653900645123485.pem
    52	metadata_expire = 200
    53	
    54	[content-label]
    55	name = content
    56	baseurl = https://cdn.redhat.com/foo/path
    57	enabled = 1
    58	gpgcheck = 1
    59	gpgkey = https://cdn.redhat.com/foo/path/gpg/
    60	sslverify = 1
    61	sslcacert = /etc/rhsm/ca/redhat-uep.pem
    62	sslclientkey = /etc/pki/entitlement/5662653900645123485-key.pem
    63	sslclientcert = /etc/pki/entitlement/5662653900645123485.pem
    64	metadata_expire = 0
    65	
[root@jsefler-onprem-62server ~]# subscription-manager unsubscribe --all
[root@jsefler-onprem-62server ~]# yum -q repolist
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo 
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
[root@jsefler-onprem-62server ~]# 


^^^ BLANK LINES IN redhat.repo ARE NOW PURGED AS CONTENT COMES AND GOES.
Comment 9 John Sefler 2011-10-18 14:11:26 EDT
[root@jsefler-onprem-62server ~]# yum -q repolist
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
[root@jsefler-onprem-62server ~]# for i in `seq 1 10`; do echo "" >> /etc/yum.repos.d/redhat.repo; done
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
     6	
     7	
     8	
     9	
    10	
    11	
    12	
    13	
    14	
    15	
[root@jsefler-onprem-62server ~]# yum -q repolist
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
[root@jsefler-onprem-62server ~]# cat -n /etc/yum.repos.d/redhat.repo
     1	#
     2	# Certificate-Based Repositories
     3	# Managed by (rhsm) subscription-manager
     4	#
     5	
[root@jsefler-onprem-62server ~]# 


^^^ FINAL TEST INDEPENDENT OF SUBSCRIBE/UNSUBSCRIBES.
Moving to VERIFIED
Comment 10 errata-xmlrpc 2011-12-06 12:24:11 EST
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-2011-1695.html

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