Bug 2026151 - Can't sync private Azure registry to Satellite
Summary: Can't sync private Azure registry to Satellite
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-23 21:45 UTC by Rafael Cavalcanti
Modified: 2022-05-16 14:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


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

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


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