Issue #2720
closed
Can't sync file repo that uses basic auth
Status:
CLOSED - CURRENTRELEASE
Description
I have a repo which has a username and password set on its importer:
Config:
Basic Auth Password: *****
Basic Auth Username: labuser
Feed: http://repo.example.com/repos/locked
However, I get a 401 when it attempts to sync this repo:
pulp_rpm.plugins.importers.iso.sync:ERROR: Failed to download http://repo.example.com/repos/locked/PULP_MANIFEST: Unauthorized.
I can confirm that the username/pass works though by curling or browsing to the url.
@beav indicated that it looks like the user/pass aren't being used when the http request is being made.
- Subject changed from Can't download file repo that uses basic auth to Can't sync file repo that uses basic auth
- Priority changed from Normal to High
- Sprint/Milestone set to 37
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- Platform Release set to 2.13.1
- Status changed from MODIFIED to 5
[root@qe-blade-12 ~]# pulp-admin iso repo create --repo-id protected-file --feed http://file.rdu.redhat.com/~pthomas/file-protected/ --relative-url iso-repo
Successfully created repository [protected-file]
[root@qe-blade-12 ~]#
[root@qe-blade-12 ~]#
[root@qe-blade-12 ~]#
[root@qe-blade-12 ~]# pulp-admin rpm repo sync run --repo-id protected-file
+----------------------------------------------------------------------+
Synchronizing Repository [protected-file]
+----------------------------------------------------------------------+
This command may be exited via ctrl+c without affecting the request.
Task Failed
Importer indicated a failed response
[root@qe-blade-12 ~]# pulp-admin rpm repo update --repo-id protected-file --basicauth-user testuser --basicauth-pass redhat --feed http://file.rdu.redhat.com/~pthomas/file-protected/
Repository [protected-file] successfully updated
[root@qe-blade-12 ~]#
[root@qe-blade-12 ~]#
[root@qe-blade-12 ~]#
[root@qe-blade-12 ~]# pulp-admin rpm repo sync run --repo-id protected-file
+----------------------------------------------------------------------+
Synchronizing Repository [protected-file]
+----------------------------------------------------------------------+
This command may be exited via ctrl+c without affecting the request.
Task Succeeded
Task Succeeded
[root@qe-blade-12 ~]# pulp-admin iso repo list
+----------------------------------------------------------------------+
ISO Repositories
+----------------------------------------------------------------------+
Id: protected-file
Display Name: None
Description: None
Content Unit Counts:
Iso: 3
- Status changed from 5 to CLOSED - CURRENTRELEASE
- Sprint/Milestone deleted (
37)
Also available in: Atom
PDF
Fix file syncs that require basic auth
fixes #2720 https://pulp.plan.io/issues/2720