Actions
Issue #3436
closedCreating duplicate content results in 500 IntegrityError
Start date:
Due date:
Estimated time:
Severity:
3. High
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 46
Quarter:
Description
$ http POST http://localhost:8000/api/v3/content/file/ relative_path=hello.tar.gz artifact="http://localhost:8000/api/v3/artifacts/79993432-e329-4bef-86bb-9bd481cee489/" [392/1963]
HTTP/1.0 201 Created
Allow: GET, POST, HEAD, OPTIONS
Content-Length: 226
Content-Type: application/json
Date: Tue, 06 Mar 2018 19:33:49 GMT
Server: WSGIServer/0.2 CPython/3.5.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"_href": "http://localhost:8000/api/v3/content/file/db0dc6fe-d0c0-445c-af08-cd38aa9f4c42/",
"artifact": "http://localhost:8000/api/v3/artifacts/79993432-e329-4bef-86bb-9bd481cee489/",
"relative_path": "hello.tar.gz",
"type": "file"
}
$ http POST http://localhost:8000/api/v3/content/file/ relative_path=hello.tar.gz artifact="http://localhost:8000/api/v3/artifacts/79993432-e329-4bef-86bb-9bd481cee489/"
HTTP/1.0 500 Internal Server Error
Content-Length: 23305
Content-Type: text/plain
Date: Tue, 06 Mar 2018 19:33:53 GMT
Server: WSGIServer/0.2 CPython/3.5.4
Vary: Cookie
X-Frame-Options: SAMEORIGIN
IntegrityError at /api/v3/content/file/
UNIQUE constraint failed: pulp_file_filecontent.relative_path, pulp_file_filecontent.digest
Related issues
Updated by dalley almost 7 years ago
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
- Tags Pulp 3 added
Updated by dkliban@redhat.com almost 7 years ago
- Sprint Candidate changed from No to Yes
Updated by CodeHeeler almost 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to CodeHeeler
Updated by daviddavis over 6 years ago
Adding a checklist item to add a pulp-smash issue.
Updated by kersom about 6 years ago
- Related to Test #4125: Test if creating duplicate content results in 400 added
Updated by CodeHeeler about 6 years ago
- Status changed from ASSIGNED to NEW
- Assignee deleted (
CodeHeeler)
Updated by amacdona@redhat.com about 6 years ago
Removed checklist item since there is a related issue
Updated by jortel@redhat.com about 6 years ago
- Sprint changed from Sprint 34 to Sprint 46
Updated by daviddavis about 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
Updated by daviddavis about 6 years ago
- Status changed from ASSIGNED to POST
Added by daviddavis about 6 years ago
Updated by daviddavis about 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset 50dad60c8a6dde95b4c5c1224536b74858f9b7af.
Updated by kersom about 6 years ago
If the same artifact is used by with different relative_path no 400 HTTP Error is raised. It that the expected behaviour?
2 different content units using the same artifact and 2 different relative_path.
{'_href': '/pulp/api/v3/content/file/files/16/',
'artifact': '/pulp/api/v3/artifacts/13/',
'created': '2018-12-19T18:30:50.562582Z',
'relative_path': '4d12bb9d-82a5-4f07-ad41-1dfe9e9140da',
'type': 'file'}
{'_href': '/pulp/api/v3/content/file/files/17/',
'artifact': '/pulp/api/v3/artifacts/13/',
'created': '2018-12-19T18:30:50.670502Z',
'relative_path': '0e512076-e7f7-4502-8d21-83d30fe60aa4',
'type': 'file'}
Updated by daviddavis about 6 years ago
If the same artifact is used by with different relative_path no 400 HTTP Error is raised. It that the expected behaviour?
That's correct. Artifacts are unique by relative_path and file. This would be same file with two different names for example.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Fixing duplicate content exception
fixes #3436 https://pulp.plan.io/issues/3436