Project

Profile

Help

Issue #7153

closed

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

Added by mntzn over 4 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
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"

Actions #1

Updated by mntzn over 4 years ago

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

Actions #2

Updated by ttereshc over 4 years ago

  • Description updated (diff)
Actions #3

Updated by quba42 over 4 years ago

  • Sprint/Milestone set to Katello
Actions #4

Updated by quba42 over 4 years ago

  • Priority changed from Normal to High
Actions #5

Updated by pulpbot over 4 years ago

  • Status changed from NEW to POST
Actions #6

Updated by quba42 over 4 years 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

Actions #7

Updated by msinghal over 4 years ago

  • Status changed from POST to MODIFIED
Actions #8

Updated by quba42 over 4 years ago

  • Sprint/Milestone changed from Katello to 2.6.0b1
Actions #9

Updated by quba42 over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF