Issue #1648
closedv1 upload fails with AttributeError: 'Repository' object has no attribute 'repo_obj'
Description
While reviewing the recipes, I found that the v1 upload now fails:
(pulp_docker)[vagrant@dev docs]$ sudo docker pull busybox
(pulp_docker)[vagrant@dev docs]$ sudo docker save busybox > busybox.tar
(pulp_docker)[vagrant@dev docs]$ pulp-admin docker repo create --repo-id=busybox
Repository [busybox] successfully created
(pulp_docker)[vagrant@dev docs]$ pulp-admin docker repo uploads upload --repo-id=busybox -f busybox.tar
+----------------------------------------------------------------------+
Unit Upload
+----------------------------------------------------------------------+
Extracting necessary metadata for each request...
[==================================================] 100%
Analyzing: busybox.tar
... completed
Creating upload requests on the server...
[==================================================] 100%
Initializing: busybox.tar
... completed
Starting upload of selected units. If this process is stopped through ctrl+c,
the uploads will be paused and may be resumed later using the resume command or
canceled entirely using the cancel command.
Uploading: busybox.tar
[==================================================] 100%
1323008/1323008 bytes
... completed
Importing into the repository...
This command may be exited via ctrl+c without affecting the request.
[\]
Running...
Task Failed
Pulp exception occurred: PulpExecutionException
Deleting the upload request...
... completed
From the logs:
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) Error from the importer while importing uploaded unit to repository [busybox]
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) Traceback (most recent call last):
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) File "/home/vagrant/devel/pulp/server/pulp/server/managers/content/upload.py", line 209, in import_uploaded_unit
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) unit_metadata, file_path, conduit, call_config)
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) File "/home/vagrant/devel/pulp_docker/plugins/pulp_docker/plugins/importers/importer.py", line 132, in upload_unit
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) upload_step.process_lifecycle()
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 562, in process_lifecycle
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) super(PluginStep, self).process_lifecycle()
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 159, in process_lifecycle
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) step.process()
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 256, in process
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) self.finalize()
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 1168, in finalize
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) repo_controller.rebuild_content_unit_counts(self.get_repo().repo_obj)
Feb 09 18:09:34 dev pulp[7094]: pulp.server.managers.content.upload:ERROR: (7094-75872) AttributeError: 'Repository' object has no attribute 'repo_obj'
Feb 09 18:09:34 dev pulp[7094]: pulp.server.async.tasks:INFO: Task failed : [f2a70110-3359-4497-a53f-1110fa6afdb8]
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) Task pulp.server.managers.content.upload.import_uploaded_unit[f2a70110-3359-4497-a53f-1110fa6afdb8] raised unexpected: PulpExecutionException(AttributeError("'Repository' object has no attribute 'repo_obj'",),)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) Traceback (most recent call last):
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) R = retval = fun(*args, **kwargs)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/server/async/tasks.py", line 473, in __call__
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) return super(Task, self).__call__(*args, **kwargs)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/server/async/tasks.py", line 103, in __call__
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) return super(PulpTask, self).__call__(*args, **kwargs)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) return self.run(*args, **kwargs)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/server/managers/content/upload.py", line 209, in import_uploaded_unit
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) unit_metadata, file_path, conduit, call_config)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp_docker/plugins/pulp_docker/plugins/importers/importer.py", line 132, in upload_unit
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) upload_step.process_lifecycle()
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 562, in process_lifecycle
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) super(PluginStep, self).process_lifecycle()
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 159, in process_lifecycle
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) step.process()
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 256, in process
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) self.finalize()
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) File "/home/vagrant/devel/pulp/server/pulp/plugins/util/publish_step.py", line 1168, in finalize
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) repo_controller.rebuild_content_unit_counts(self.get_repo().repo_obj)
Feb 09 18:09:34 dev pulp[6811]: celery.worker.job:ERROR: (6811-75872) PulpExecutionException: Pulp exception occurred: PulpExecutionException
This is a regression from Docker 1.x.
Related issues
Updated by bmbouter almost 9 years ago
I've fixed several issues like this before so here is some info. There are new-style (mongoengine) and old-style (not-mongoengine) based repository objects. If you already have the new style object you can just use it without repo_obj giving you the new style because you already have it.Since the thing you're working with doesn't have that attribute, it very likely is already the new style object type. As a fix, try removing the .repo_obj altogether and it likely is the object type that your code expects.
Updated by rbarlow almost 9 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to rbarlow
Updated by rbarlow almost 9 years ago
- Status changed from ASSIGNED to POST
- Triaged changed from No to Yes
Updated by rbarlow almost 9 years ago
I filed the recipe checklist items as tasks instead, since upload still does not work:
https://pulp.plan.io/issues/1651
https://pulp.plan.io/projects/pulp_docker/issues/new
Added by rbarlow almost 9 years ago
Added by rbarlow almost 9 years ago
Added by rbarlow almost 9 years ago
Added by rbarlow almost 9 years ago
Updated by rbarlow almost 9 years ago
- Blocks Issue #1650: Uploading a v1 Docker Image causes AttributeError: 'UploadStep' object has no attribute 'v1_tags' added
Updated by rbarlow almost 9 years ago
- Status changed from POST to MODIFIED
- % Done changed from 0 to 100
Applied in changeset 5b3bb4de1091dcc43b6dabe39a3042d09ecf28e2.
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from MODIFIED to 5
Updated by dkliban@redhat.com almost 9 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Pass the old-style repo object to the UploadStep.
https://pulp.plan.io/issues/1648
fixes #1648