This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2168865 - Registry Service Accounts token is not accepted in "Upstream Authentication Token" of a docker repo in Satellite 6
Summary: Registry Service Accounts token is not accepted in "Upstream Authentication T...
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.11.4
Hardware: All
OS: All
high
high
Target Milestone: stream
Assignee: Ian Ballou
QA Contact: Sam Bible
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-10 10:23 UTC by Sayan Das
Modified: 2024-06-06 16:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-06-06 16:07:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 37238 0 Normal Closed Registry Service Accounts token is not accepted in "Upstream Authentication Token" of a docker repo 2024-03-26 13:53:36 UTC
Red Hat Issue Tracker   SAT-19748 0 None Migrated None 2024-06-06 16:07:40 UTC

Description Sayan Das 2023-02-10 10:23:59 UTC
Description of problem:

One has the ability to create a Registry Service account and generate a token related to the same to further use them as shared credentials but the generated token could be quite long.

While for a container\docker type repo, The "Upstream Password" field accepts that Token, The "Upstream Authentication Token" field rejects the same with error 

An error occurred saving the Repository: PG::StringDataRightTruncation: ERROR: value too long for type character varying(1024)


Version-Release number of selected component (if applicable):

Satellite 6.11 , 6.12 and 6.13 ( probably Satellite 6.10 as well )


How reproducible:

Easily and Always


Steps to Reproduce:
1. Create a new Satellite 6.x ( x being 11 12 or 13 )

2. Import a manifest with some valid subs

3. Go to https://access.redhat.com/terms-based-registry/#/accounts and create a new service account and token.

4. Discovery "rhel8/toolbox" docker type repo using the exact same username and token from Satellite UI Content --> Products page and create the repo

5. Sync the repo

6. Edit the "Upstream Authorization" field and try to put the token inside ""Upstream Authentication Token" field -> Save

7. Try to remove the token from there and put it in "Upstream Password" field and save

8. Re-sync the repo.


Actual results:


Step 5: Sync Success ( as the token gets saved as password )

Step 6: Error:

An error occurred saving the Repository: PG::StringDataRightTruncation: ERROR: value too long for type character varying(1024)

Step 7 and 8: Successfully saved and repo can be synced


The reason seems to be this i.e. upstream_password column has a record type set to Text but upstream_authentication_token is of varchar(1024)

# echo "\d+ katello_root_repositories;" | su - postgres -c "psql foreman" | egrep "Column|upstream" | awk -F'|' '{print $1,$2,$4}'
             Column                           Type               Nullable 
 docker_upstream_name              character varying(255)                 
 upstream_username                 character varying(255)                 
 upstream_password                 text                                   
 upstream_authentication_token     character varying(1024)               


Expected results:

A) As tokens are expected to be longer than normal passwords, set "upstream_authentication_token" type to "text" or increase the length for varchar 


B) If the token can be used in both upstream_password as well as upstream_authentication_token fields, Then just have one field present. 


Additional info:

NA

Comment 1 Ian Ballou 2023-02-10 15:44:49 UTC
I believe the upstream authentication token field was never intended for docker repo workflows. We should hide it.

Comment 2 Sayan Das 2023-02-10 17:04:22 UTC
If that's the case then yes and agreed.

Comment 3 Ian Ballou 2024-03-08 20:57:12 UTC
Created redmine issue https://projects.theforeman.org/issues/37238 from this bug

Comment 4 Bryan Kearney 2024-03-09 00:03:04 UTC
Upstream bug assigned to iballou

Comment 5 Bryan Kearney 2024-03-09 00:03:06 UTC
Upstream bug assigned to iballou

Comment 6 Bryan Kearney 2024-03-20 16:13:41 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37238 has been resolved.

Comment 8 Sam Bible 2024-05-23 14:42:42 UTC
Version-6.16 - Stream 60

Steps to Verify:
1.Create a custom Yum Repo (Repo Discovery was used here)
2.Create a custom Container/Docker Repo (Again, Repo Discovery)
3.Sync the repos.
4.Check the "Upstream Authorization" Field on both Repo types.

Actual results:
The Upstream Authorization Token field is present on the Yum Repo, and isn't present on the Docker Repo.

Expected results:
The Upstream Authorization Token field is present on the Yum Repo, and isn't present on the Docker Repo.

Comment 9 Eric Helms 2024-06-06 16:07:42 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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