Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2026151

Summary: Can't sync private Azure registry to Satellite
Product: Red Hat Satellite Reporter: Rafael Cavalcanti <rcavalca>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: addubey
Severity: medium Docs Contact:
Priority: medium    
Version: 6.9.0CC: addubey, ahumbe, dalley, dkliban, ggainey, ipanova, jpasqual, jsherril, juwatts, rchan, swadeley
Target Milestone: 6.13.0Keywords: Patch, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pulp-container-2.10.3, pulp-container-2.9.5, pulp-container-2.8.7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 13:21:03 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:

Description Rafael Cavalcanti 2021-11-23 21:45:22 UTC
Description of problem:
After creating a custom product and repository of docker type and setting the upstream URL to private Azure registry, the sync fails with the following error:
---
Nov 22 11:24:51 recife pulp: nectar.downloaders.threaded:INFO: [252ace36] Download succeeded: https://rcavalca.azurecr.io/oauth2/token?scope=repository%3Ahello-world%3Apull&service=rcavalca.azurecr.io.
Nov 22 11:24:51 recife pulp: pulp.server.async.tasks:INFO: [252ace36] Task failed : [252ace36-004f-417a-918a-6d2e914e1115]
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192) Task pulp.server.managers.repo.sync.sync[252ace36-004f-417a-918a-6d2e914e1115] raised unexpected: KeyError('token',)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192) Traceback (most recent call last):
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     R = retval = fun(*args, **kwargs)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 688, in __call__
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     return super(Task, self).__call__(*args, **kwargs)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 110, in __call__
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     return super(PulpTask, self).__call__(*args, **kwargs)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     return self.run(*args, **kwargs)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 802, in sync
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     sync_report = sync_repo(transfer_repo, conduit, call_config)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 905, in wrap_f
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     return f(*args, **kwargs)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/importers/importer.py", line 84, in sync_repo
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     self.sync_step = sync.SyncStep(repo=repo, conduit=sync_conduit, config=config)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/importers/sync.py", line 80, in __init__
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     v2_found = v2_enabled and self.index_repository.api_version_check()
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/registry.py", line 327, in api_version_check
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     headers, body = self._get_path(self.API_VERSION_CHECK_PATH)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/registry.py", line 513, in _get_path
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     auth_header, self.name)
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)   File "/usr/lib/python2.7/site-packages/pulp_docker/plugins/auth_util.py", line 98, in request_token
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192)     return json.loads(token_data.getvalue())['token']
Nov 22 11:24:51 recife pulp: celery.app.trace:ERROR: [252ace36] (956-36192) KeyError: 'token'
Nov 22 11:24:51 recife pulp: celery.app.trace:INFO: [6dfa1dcb] Task pulp.server.async.tasks._release_resource[6dfa1dcb-4e57-49df-9892-e321714a4871] succeeded in 0.00277396291494s: None
---

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


How reproducible:
100%

Steps to Reproduce:
1. Create a custom product
2. Create a repository of docker type as follows:
---
hammer repository info --product azure --name hello-world --organization ACME
ID:                          352
Name:                        hello-world
Label:                       hello-world
Description:                 
Organization:                ACME
Red Hat Repository:          no
Content Type:                docker
Mirror on Sync:              yes
URL:                         https://<username>.azurecr.io/
Publish Via HTTP:            yes
Published At:                recife.newdns.lab/acme-azure-hello-world
Relative Path:               acme-azure-hello-world
Download Policy:             
Upstream Repository Name:    hello-world
Container Image Tags Filter: 
Container Repository Name:   acme-azure-hello-world
HTTP Proxy:                  
    HTTP Proxy Policy: global_default_http_proxy
Product:                     
    ID:   1193
    Name: azure
GPG Key:                     

Sync:                        
    Status:         Warning
    Last Sync Date: 1 day
Created:                     2021/11/22 16:49:33
Updated:                     2021/11/22 16:57:27
Content Counts:              
    Container Image Manifest Lists: 0
    Container Image Manifests:      0
    Container Image Tags:           0
---


Actual results:
The sync fails/warning

Expected results:
The sync completes with success

Additional info:

Comment 7 Ina Panova 2022-03-07 17:10:44 UTC
Here is the PR I've just submitted https://github.com/pulp/pulp_container/pull/618

Comment 20 errata-xmlrpc 2023-05-03 13:21:03 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 (Important: Satellite 6.13 Release), 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://access.redhat.com/errata/RHSA-2023:2097