Project

Profile

Help

Issue #7153

package import for same package and different version stores under different paths,

Added by mntzn 3 months ago. Updated about 2 months ago.

Status:
MODIFIED
Priority:
High
Assignee:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Debian:
Platform Release:
Target Release - Debian:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

steps to reproduce:

  1. reqs export URL=$your_pulp_fqdn export REPO_NAME=buster-releases wget http://ftp.de.debian.org/debian/pool/main/j/jq/jq_1.5+dfsg-2+b1_amd64.deb wget http://ftp.de.debian.org/debian/pool/main/j/jq/jq_1.6-1_amd64.deb

  2. create repo export REPO=$(http ${URL}/pulp/api/v3/repositories/deb/apt/ name=${REPO_NAME} | jq -r '.pulp_href')

  3. create content from file http --form POST ${URL}/pulp/api/v3/content/deb/packages/ file@jq_1.5+dfsg-2+b1_amd64.deb repository=${REPO}

  4. create publication http POST ${URL}/pulp/api/v3/publications/deb/apt/ repository=${REPO} simple=true export PUB=$pulp_href_from_task_above

  5. host publication (create distribution) http POST ${URL}/pulp/api/v3/distributions/deb/apt/ name=${REPO_NAME} base_path=${REPO_NAME} publication=${PUB} export DISTR=$pulp_href_from_task_above

  6. add same package different version http --form POST ${URL}/pulp/api/v3/content/deb/packages/ repository=${REPO}

  7. add publication from latest $REPO http POST ${URL}/pulp/api/v3/publications/deb/apt/ repository=${REPO} simple=true export PUB=$pulp_href_from_task_above

http PUT ${URL}${DISTR} name=${REPO_NAME} base_path=${REPO_NAME} publication=${PUB}

Expected result: both .debs are stored under single directory in ${URL}/pulp/content/buster-releases/pool/all/j/jq, similar to what official debian repos do, i.e: http://ftp.de.debian.org/debian/pool/main/j/jq/

Actual Result: package with same name stored in different paths. i.e: jq (1.5+dfsg-2)/ jq/

Additionally, when trying to download .deb for "jq (1.5+dfsg-2)", pulp throws 500 with following exception:

Jul 16 06:27:21 FQDN gunicorn[10752]: [2020-07-16 06:27:21 +0000] [10759] [ERROR] Error handling request
Jul 16 06:27:21 FQDN gunicorn[10752]: Traceback (most recent call last):
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/pulpcore/content/handler.py", line 365, in _match_and_stream
Jul 16 06:27:21 FQDN gunicorn[10752]:     publication.published_artifact.get(relative_path=index_path)
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
Jul 16 06:27:21 FQDN gunicorn[10752]:     return getattr(self.get_queryset(), name)(*args, **kwargs)
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/django/db/models/query.py", line 408, in get
Jul 16 06:27:21 FQDN gunicorn[10752]:     self.model._meta.object_name
Jul 16 06:27:21 FQDN gunicorn[10752]: pulpcore.app.models.publication.PublishedArtifact.DoesNotExist: PublishedArtifact matching query does not exist.
Jul 16 06:27:21 FQDN gunicorn[10752]: During handling of the above exception, another exception occurred:
Jul 16 06:27:21 FQDN gunicorn[10752]: Traceback (most recent call last):
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
Jul 16 06:27:21 FQDN gunicorn[10752]:     resp = await task
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
Jul 16 06:27:21 FQDN gunicorn[10752]:     resp = await handler(request)
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/pulpcore/content/handler.py", line 137, in stream_content
Jul 16 06:27:21 FQDN gunicorn[10752]:     return await self._match_and_stream(path, request)
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/pulpcore/content/handler.py", line 369, in _match_and_stream
Jul 16 06:27:21 FQDN gunicorn[10752]:     dir_list = await self.list_directory(None, publication, rel_path)
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/pulpcore/content/handler.py", line 291, in list_directory
Jul 16 06:27:21 FQDN gunicorn[10752]:     directory_list.add(file_or_directory_name(path, pa.relative_path))
Jul 16 06:27:21 FQDN gunicorn[10752]:   File "/usr/local/lib/pulp/lib/python3.7/site-packages/pulpcore/content/handler.py", line 284, in file_or_directory_name
Jul 16 06:27:21 FQDN gunicorn[10752]:     return "{}{}".format(result.groups()[1], result.groups()[2])
Jul 16 06:27:21 FQDN gunicorn[10752]: AttributeError: 'NoneType' object has no attribute 'groups'

Running: "component": "pulpcore", "version": "3.5.0" "component": "pulp_deb", "version": "2.5.0b1.dev0"

Associated revisions

Revision 0a827266 View on GitHub
Added by msinghal 2 months ago

Fix relative path of packages

fixes #7153 https://pulp.plan.io/issues/7153

History

#1 Updated by mntzn 3 months ago

sorry formatting got all messed up, same contents as above on pastebin: https://pastebin.com/raw/aR47ZCyH

#2 Updated by ttereshc 3 months ago

  • Description updated (diff)

#3 Updated by quba42 3 months ago

  • Sprint/Milestone set to Katello

#4 Updated by quba42 3 months ago

  • Priority changed from Normal to High

#5 Updated by pulpbot 2 months ago

  • Status changed from NEW to POST

#6 Updated by quba42 2 months ago

Note that the following policy document describes the root cause of this issue exactly:

https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source

#7 Updated by msinghal 2 months ago

  • Status changed from POST to MODIFIED

#8 Updated by quba42 about 2 months ago

  • Sprint/Milestone changed from Katello to 2.6.0b1

Please register to edit this issue

Also available in: Atom PDF