https://pulp.plan.io/https://pulp.plan.io/favicon.ico2021-11-02T19:30:35ZPulpPulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=769492021-11-02T19:30:35Zdkliban@redhat.com
<ul></ul><pre><code class="diff syntaxhl" data-language="diff"><span class="gh">diff --git a/pulpcore/app/tasks/upload.py b/pulpcore/app/tasks/upload.py
index 89d876816..dbd140f90 100644
</span><span class="gd">--- a/pulpcore/app/tasks/upload.py
</span><span class="gi">+++ b/pulpcore/app/tasks/upload.py
</span><span class="p">@@ -26,7 +26,7 @@</span> def commit(upload_id, sha256):
return
chunks = models.UploadChunk.objects.filter(upload=upload).order_by("offset")
<span class="gd">- with NamedTemporaryFile("ab") as temp_file:
</span><span class="gi">+ with NamedTemporaryFile(mode="ab", dir=".", delete=False) as temp_file:
</span> for chunk in chunks:
temp_file.write(chunk.file.read())
temp_file.flush()
</code></pre>
<p>That patch got him as far as trying to create an RPM from a file but then pulp_rpm plugin complained about the file.</p>
<pre><code>
[dfurlong@snjlv-sysengutil01 ~]$ time /opt/systems/bin/syseng-pulpctlv3 --username=admin content-upload --type=rpm --platform=rhel7 --repo=acme --release=trunk --path=/home/dfurlong/acme-trino-363-1.el7.x86_64.rpm
2021-11-02 15:12:44|ERROR |Server: ncc1r8.us.acme.net, Task: /pulp/api/v3/tasks/452c9c7e-1715-4751-9462-0f68a649feb3/ is in a failed state. With message: RPM file cannot be parsed for metadata.
Traceback (most recent call last):
File "/opt/systems/bin/syseng-pulpctlv3", line 11, in <module>
controller.run()
File "/home/dfurlong/systems/syseng_code/python/site_syseng/prog/pulpctl/pulpctl.py", line 1107, in run
self.args.action(self)
File "/home/dfurlong/systems/syseng_code/python/site_syseng/prog/pulpctl/pulpctl.py", line 437, in <lambda>
content_upload_subparser.set_defaults(action=lambda s: cls.do_content_upload(s))
File "/home/dfurlong/systems/syseng_code/python/site_syseng/prog/pulpctl/pulpctl.py", line 1601, in do_content_upload
self.pulp3_servers.primary.content_create(artifacts, self.args.type)
File "/home/dfurlong/systems/syseng_code/python/site_syseng/prog/pulpctl/pulpserver.py", line 204, in content_create
href = self.tasks_retrieve_create_resource_7708(task_href=task, type=type)
File "/home/dfurlong/systems/syseng_code/python/site_syseng/prog/pulpctl/pulpserver.py", line 671, in tasks_retrieve_create_resource_7708
raise ValueError(
ValueError: ('task_href: %s, has failed with error %f', '/pulp/api/v3/tasks/452c9c7e-1715-4751-9462-0f68a649feb3/', {'traceback': ' File "/opt/acme/lib/python3.8/site-packages/pulpcore/tasking/pulpcore_worker.py", line 272, in _perform_task\n result = func(*args, **kwargs)\n File "/opt/acme/lib/python3.8/site-packages/pulpcore/app/tasks/base.py", line 34, in general_create\n serializer.is_valid(raise_exception=True)\n File "/opt/acme/lib/python3.8/site-packages/rest_framework/serializers.py", line 220, in is_valid\n self._validated_data = self.run_validation(self.initial_data)\n File "/opt/acme/lib/python3.8/site-packages/rest_framework/serializers.py", line 422, in run_validation\n value = self.validate(value)\n File "/opt/acme/lib/python3.8/site-packages/pulpcore/plugin/serializers/content.py", line 104, in validate\n data = self.deferred_validate(data)\n File "/opt/acme/lib/python3.8/site-packages/pulp_rpm/app/serializers/package.py", line 240, in deferred_validate\n raise NotAcceptable(detail="RPM file cannot be parsed for metadata.")\n', 'description': 'RPM file cannot be parsed for metadata.'})
</code></pre> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=769502021-11-02T19:33:15Zdkliban@redhat.com
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>ASSIGNED</i></li><li><strong>Assignee</strong> set to <i>dkliban@redhat.com</i></li></ul> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=769512021-11-02T19:34:14Zpulpbot
<ul><li><strong>Status</strong> changed from <i>ASSIGNED</i> to <i>POST</i></li></ul><p>PR: <a href="https://github.com/pulp/pulpcore/pull/1708" class="external">https://github.com/pulp/pulpcore/pull/1708</a></p> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=769852021-11-04T20:14:17Zdkliban@redhat.com
<ul><li><strong>Status</strong> changed from <i>POST</i> to <i>MODIFIED</i></li></ul><p>Applied in changeset <a class="changeset" title="Assembles chunked_uploads in workers working directory fixes: #9550 https://pulp.plan.io/issues/..." href="https://pulp.plan.io/projects/pulp/repository/pulpcore/revisions/b7210102dc02a055d79c4cef4a5e86ccfbbdeb30">pulpcore|b7210102dc02a055d79c4cef4a5e86ccfbbdeb30</a>.</p> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=770562021-11-05T13:47:51Zdkliban@redhat.com
<ul><li><strong>Copied to</strong> <i><a class="issue tracker-7 status-11 priority-6 priority-default closed" href="/issues/9556">Backport #9556</a>: Backport 9550 to 3.14: Ensure correct tmp location is used when reconstructing chunked uploads</i> added</li></ul> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=771162021-11-15T19:13:53Zttereshcttereshc@redhat.com
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-12 priority-6 priority-default closed" href="/issues/9569">Task #9569</a>: Eliminate all instances when Pulp writes to /tmp and always use the worker working directory</i> added</li></ul> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=777402021-12-14T14:12:45Zpulpbot
<ul><li><strong>Sprint/Milestone</strong> set to <i>3.17.0</i></li></ul> Pulp - Issue #9550: Ensure correct tmp location is used when reconstructing chunked uploadshttps://pulp.plan.io/issues/9550?journal_id=777762021-12-14T14:41:21Zpulpbot
<ul><li><strong>Status</strong> changed from <i>MODIFIED</i> to <i>CLOSED - CURRENTRELEASE</i></li></ul>