Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1919888 - Global Registration: Unable to re-register with satellite using the Curl Command
Summary: Global Registration: Unable to re-register with satellite using the Curl Command
Keywords:
Status: CLOSED DUPLICATE of bug 1900664
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: Leos Stejskal
QA Contact: Stephen Wadeley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-25 11:26 UTC by Jaskaran Singh Narula
Modified: 2021-02-12 09:01 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-12 09:01:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 31810 0 Normal Duplicate Global Registration: Unable to re-register with satellite using the Curl Command 2021-02-13 10:49:29 UTC

Description Jaskaran Singh Narula 2021-01-25 11:26:44 UTC
Description of problem:
When trying to re-register a system using the generated curl command it throws the error mentioning that the system is already registered and it would need to use the option --force. 

Error: 
--------
This system is already registered. Use --force to override
---------

When --force option is using the below error is the output. 

Error: 
================================================================================================
[root@localhost ~]# curl -X GET "https://satellite.example.com:9090/register?activation_key=new&hostgroup_id=3&location_id=2&operatingsystem_id=3&organization_id=1" -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjo0LCJpYXQiOjE2MTE1Njk4ODEsImp0aSI6ImUxMzJkOGU1OGQ2MTc4YTc4ODM3ZjU2ZjY0MzJiZmZhYTZjYmI2OWY0ODFmMGFiYmFjNTJkOGZhZWVlN2JjMDMiLCJleHAiOjE2MTE1ODQyODF9.fLNNZqN_7HNYFcCyspX6Usqt6AN3u5oOUA3DIdEB6Pk' | bash --force
bash: --force: invalid option
Usage:	bash [GNU long option] [option] ...
	bash [GNU long option] [option] script-file ...
GNU long options:
	--debug
	--debugger
	--dump-po-strings
	--dump-strings
	--help
	--init-file
	--login
	--noediting
	--noprofile
	--norc
	--posix
	--rcfile
	--rpm-requires
	--restricted
	--verbose
	--version
Shell options:
	-ilrsD or -c command or -O shopt_option		(invocation only)
	-abefhkmnptuvxBCHP or -o option
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10369  100 10369    0     0  20017      0 --:--:-- --:--:-- --:--:-- 20017
curl: (23) Failed writing body (0 != 10369)
================================================================================================

Version-Release number of selected component (if applicable):
[root@localhost ~]# rpm -qa | grep -i satellite 
satellite-6.9.0-0.3.beta.el7sat.noarch
ansiblerole-satellite-receptor-installer-0.6.13-1.el7sat.noarch
satellite-maintain-0.0.1-1.el7sat.noarch
satellite-common-6.9.0-0.3.beta.el7sat.noarch
satellite-installer-6.9.0.6-1.el7sat.noarch
tfm-rubygem-foreman_theme_satellite-7.0.1.4-1.el7sat.noarch
satellite-cli-6.9.0-0.3.beta.el7sat.noarch


How reproducible:
100% 

Steps to Reproduce:
1. Register a client system using the generated curl command 
2. Do NOT un-register the system and then run the same curl command again. It will ask to use the --force option. 
3. Run the same curl command with the --force option. 

Actual results:
Do not register the system the second time. 

Expected results:
[1] It should use the option or --force 
[2] Curl command should process any additional parameters supported for subscription-manager. 



Additional info:

Comment 3 Leos Stejskal 2021-02-04 16:07:16 UTC
Created redmine issue https://projects.theforeman.org/issues/31810 from this bug

Comment 4 Peter Ondrejka 2021-02-11 14:39:20 UTC
I'd say better approach to re-registration would be to run sub-man clean, overall feels like a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1900664

Comment 5 Leos Stejskal 2021-02-12 09:01:35 UTC

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


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