Issue #4452
closedfetching a published PULP_MANIFEST throws a 404 if file repo version contains no units
Description
1. Create a repository
2. Create a file publisher
3. Publish the publisher
4. Create a distribution from the publication
5. Fetch PULP_MANIFEST
Receive a 404. According to the docs a PULP_MANIFEST should be created by default for all file publishes (unless the filename has been configured differently in the publisher).
Related issues
Updated by CodeHeeler almost 6 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 49
Updated by amacdona@redhat.com almost 6 years ago
- Subject changed from fetching PULP_MANIFEST throws a 404 if file repo version contains no units to fetching a published PULP_MANIFEST throws a 404 if file repo version contains no units
Updated by ttereshc almost 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to ttereshc
Updated by ttereshc almost 6 years ago
@jsherril, I'm not able to reproduce it.
I think you are missing a step of creating a repo version, without it publish fails.
If you create an empty repo version and then publish it, empty PULP_MANIFEST is available.
See my steps below.
# create a repo
http POST http://localhost:8000/pulp/api/v3/repositories/ name=foo
export REPO_HREF=$(http :8000/pulp/api/v3/repositories/ | jq -r '.results[] | select(.name == "foo") | ._href')
# create a publisher
http POST http://localhost:8000/pulp/api/v3/publishers/file/file/ name=bar
export PUBLISHER_HREF=$(http :8000/pulp/api/v3/publishers/file/file/ | jq -r '.results[] | select(.name == "bar") | ._href')
# attempt to publish with no repo version
http POST ':8000'$PUBLISHER_HREF'publish/' repository=$REPO_HREF
HTTP/1.1 400 Bad Request
Allow: POST, OPTIONS
Content-Length: 71
Content-Type: application/json
Date: Wed, 27 Feb 2019 11:59:47 GMT
Server: WSGIServer/0.2 CPython/3.6.8
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"non_field_errors": [
"Repository has no version available to publish"
]
}
# create an empty repo version
http POST ':8000'$REPO_HREF'versions/'
# try to publish again
http POST ':8000'$PUBLISHER_HREF'publish/' repository=$REPO_HREF
export PUBLICATION_HREF=$(http :8000/pulp/api/v3/publications/ | jq -r --arg PUBLISHER_HREF "$PUBLISHER_HREF" '.results[] | select(.publisher==$PUBLISHER_HREF) | ._href')
# create a distribution
http POST http://localhost:8000/pulp/api/v3/distributions/ name='baz' base_path='foo' publication=$PUBLICATION_HREF
# PULP_MANIFEST is available and empty
http GET http://localhost:8080/pulp/content/foo/PULP_MANIFEST
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 0
Content-Type: application/octet-stream
Date: Wed, 27 Feb 2019 12:01:52 GMT
Last-Modified: Wed, 27 Feb 2019 12:00:45 GMT
Server: Python/3.6 aiohttp/3.5.4
I don't recall any recent changes in that area but, FWIW, I'm at the latest commit of the master branch of pulp, pulpcore-plugin and pulp_file:
- pulp 45f5ee314a2eb0aea22f9e5f1c2968512ef52dfe
- pulpcore-plugin ea03cd9b0977fafbe94b370e50e6ea22a8d9e9c0
- pulp_file b710a18c885f4e209a3a993ba10f168027bd3337
Updated by jsherril@redhat.com almost 6 years ago
- Status changed from ASSIGNED to CLOSED - WORKSFORME
I cannot reproduce this anymore
Updated by bherring almost 6 years ago
- Copied to Test #4538: fetching a published PULP_MANIFEST throws a 404 if file repo version contains no units added
Updated by ggainey over 4 years ago
- Tags Katello added
- Tags deleted (
Katello-P2)