Bug 2026151 - Can't sync private Azure registry to Satellite
Summary: Can't sync private Azure registry to Satellite
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: 6.13.0
Assignee: satellite6-bugs
QA Contact: addubey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-23 21:45 UTC by Rafael Cavalcanti
Modified: 2023-10-13 19:33 UTC (History)
11 users (show)

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:
Clone Of:
Environment:
Last Closed: 2023-05-03 13:21:03 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp_container issues 619 0 None closed Accept token under the name access_token for compatibility with oauth2 2022-03-16 15:27:00 UTC
Github pulp pulp_container pull 618 0 None Merged Accept token under access_token for compatibility with oauth2. 2022-03-16 15:27:01 UTC
Red Hat Issue Tracker SAT-14122 0 None None None 2022-11-30 19:18:19 UTC
Red Hat Issue Tracker SAT-14313 0 None None None 2023-01-24 17:16:00 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:21:16 UTC

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


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