Project

Profile

Help

Issue #7153

Updated by ttereshc over 2 years ago

steps to reproduce: 

 0. 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 

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

 2. 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} 

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

 4. 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 

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

 6. 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"

Back