Project

Profile

Help

Issue #2505

Getting an incorrect exception when trying to sync a local repo with bad permissions

Added by daviddavis almost 4 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Master
Platform Release:
2.12.2
OS:
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 15
Quarter:

Description

Here's the error I am seeing:

Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.repomd.alternate:INFO: The content container reported: {'downloads': {'___/primary/___': {'total_failed': 1, 'total_succeeded': 0}}, 
'total_sources': 0} for base URL: file:///home/vagrant/zoolander/
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184) 'error_code'
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184) Traceback (most recent call last):
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184)   File "/home/vagrant/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/sync.py", line 268, in run
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184)     self.update_content(metadata_files, url)
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184)   File "/home/vagrant/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/sync.py", line 553, in update_c
ontent
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184)     if error[constants.ERROR_CODE] == constants.ERROR_KEY_ID_FILTER:
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp_rpm.plugins.importers.yum.sync:ERROR: (10582-05184) KeyError: 'error_code'
Dec 22 15:14:53 dev.example.com pulp[10582]: pulp.server.async.tasks:INFO: Task failed : [d354cd87-1de3-4f49-9e43-3eafc68d41c3]
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184) Task pulp.server.managers.repo.sync.sync[d354cd87-1de3-4f49-9e43-3eafc68d41c3] raised unexpected: PulpExecutionException('Imp
orter indicated a failed response',)
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184) Traceback (most recent call last):
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)     R = retval = fun(*args, **kwargs)
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)   File "/home/vagrant/devel/pulp/server/pulp/server/async/tasks.py", line 498, in __call__
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)     return super(Task, self).__call__(*args, **kwargs)
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)   File "/home/vagrant/devel/pulp/server/pulp/server/async/tasks.py", line 105, in __call__
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)     return super(PulpTask, self).__call__(*args, **kwargs)
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)     return self.run(*args, **kwargs)
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)   File "/home/vagrant/devel/pulp/server/pulp/server/controllers/repository.py", line 816, in sync
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184)     raise pulp_exceptions.PulpExecutionException(_('Importer indicated a failed response'))
Dec 22 15:14:54 dev.example.com pulp[10424]: celery.worker.job:ERROR: (10424-05184) PulpExecutionException: Importer indicated a failed response

Steps to recreate:

1. Create a local repo
2. chmod 700 one of the files
3. Try to sync the repo

CLI steps:

mkdir zoolander
cd zoolander
wget https://davidd.fedorapeople.org/repos/zoo-lander/cat-1.0-1.noarch.rpm
wget https://davidd.fedorapeople.org/repos/zoo-lander/camel-0.1-1.noarch.rpm
wget https://davidd.fedorapeople.org/repos/zoo-lander/bear-4.1-1.noarch.rpm
createrepo .
chmod 777 *
sudo chown root bear-4.1-1.noarch.rpm
sudo chmod 000 bear-4.1-1.noarch.rpm 
pulp-admin rpm repo create --repo-id zoolander --feed file://`pwd`
pulp-admin rpm repo sync run --repo-id zoolander

Here's the link to where the error is occuring:

https://github.com/pulp/pulp_rpm/blob/531bed622ec86192c230d455400137c2a3814048/plugins/pulp_rpm/plugins/importers/yum/sync.py#L553

Here's what error looks like:

{'url': u'file:///home/vagrant/zoolander/cat-1.0-1.noarch.rpm', 'errors': ["[Errno 13] Permission denied: u'///home/vagrant/zoolander/cat-1.0-1.noarch.rpm'"]}

Associated revisions

Revision 3678b312 View on GitHub
Added by dalley over 3 years ago

Fixes KeyError when Nectar download fails.

Pulp RPM is doing some wonky stuff with error reporting. It's set up to accept errors in a particular format which Nectar does not abide by. This causes a KeyError when Nectar encounters a download failure, because one of the fields it expects to find does not exist.

closes #2505

History

#1 Updated by daviddavis almost 4 years ago

  • Project changed from Nectar to RPM Support

#2 Updated by daviddavis almost 4 years ago

  • Subject changed from Improperly handled error in yum importer for permission denied to local file to Improperly handled permission denied error in yum importer

#3 Updated by daviddavis over 3 years ago

  • Version set to Master

#4 Updated by daviddavis over 3 years ago

  • Subject changed from Improperly handled permission denied error in yum importer to Getting an incorrect exception when trying to sync a local repo with bad permissions

#5 Updated by bizhang over 3 years ago

  • Severity changed from 2. Medium to 1. Low
  • Triaged changed from No to Yes

#6 Updated by mhrivnak over 3 years ago

  • Sprint/Milestone set to 32

#7 Updated by dalley over 3 years ago

  • Groomed changed from No to Yes

#8 Updated by dalley over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley
  • Priority changed from Normal to Low

#9 Updated by dalley over 3 years ago

  • Priority changed from Low to Normal

#10 Updated by dalley over 3 years ago

  • Status changed from ASSIGNED to NEW
  • Assignee deleted (dalley)

#11 Updated by daviddavis over 3 years ago

Note that my steps to reproduce don't work. I also had to change owner on the bear package:

sudo chown root bear-4.1-1.noarch.rpm
sudo chmod 000 bear-4.1-1.noarch.rpm # for good measure

#12 Updated by dalley over 3 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#13 Updated by jortel@redhat.com over 3 years ago

The downloading support planned for pulp3 currently will result in a 403 which should be dealt with appropriately by the rpm importer. So, I don't think there is any need for a pulp3 story on this.

#14 Updated by mhrivnak over 3 years ago

  • Sprint/Milestone changed from 32 to 33

#15 Updated by dalley over 3 years ago

  • Status changed from ASSIGNED to POST

#16 Updated by dalley over 3 years ago

  • Description updated (diff)

#17 Updated by dalley over 3 years ago

  • Status changed from POST to MODIFIED

#18 Updated by semyers over 3 years ago

  • Platform Release set to 2.12.2

The POSTed pull request was not the commit that was merged. Despite showing as "closed" on github, the commit related to https://github.com/pulp/pulp_rpm/pull/1023/commits is present on 2.12-dev and master.

#19 Updated by semyers over 3 years ago

  • Status changed from MODIFIED to 5

#20 Updated by bizhang over 3 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#21 Updated by bmbouter over 2 years ago

  • Sprint set to Sprint 15

#22 Updated by bmbouter over 2 years ago

  • Sprint/Milestone deleted (33)

#23 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF