Project

Profile

Help

Issue #3063

406 returned when a 404 should be

Added by dkliban@redhat.com about 2 years ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
3. High
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

Install pulpcore without any plugins.
Create repository.

http POST http://localhost:8000/api/v3/repositories/ name=foo2

Attempt to add file importer

(pulp) [vagrant@pulp3 pulp_example]$ http POST http://localhost:8000/api/v3/repositories/foo2/importers/file/ name='bar' download_policy='immediate' sync_mode='mirror' feed_url='https://repos.fedorapeople.org/pulp/pulp/demo_repos/test_file_repo/PULP_MANIFEST'
HTTP/1.0 406 Not Acceptable
Allow: GET, HEAD, OPTIONS
Content-Length: 57
Content-Type: application/coreapi+json
Date: Tue, 10 Oct 2017 17:29:50 GMT
Server: WSGIServer/0.2 CPython/3.5.4
Vary: Accept
X-Frame-Options: SAMEORIGIN

{
    "detail": "Could not satisfy the request Accept header." 
}

Downgrading djangorestframework to 3.6.4 and
Reverting urls.py to to 97093b071224700ff93fb6256292a53b424ddf1f commit produces the right response
git checkout 97093b071224700ff93fb6256292a53b424ddf1f platform/pulpcore/app/urls.py

(pulp) [vagrant@pulp3 pulp_example]$ http POST http://localhost:8000/api/v3/repositories/foo2/importers/file/ name='bar' download_policy='immediate' sync_mode='mirror' feed_url='https://repos.fedorapeople.org/pulp/pulp/demo_repos/test_file_repo/PULP_MANIFEST'
HTTP/1.0 404 Not Found
Content-Length: 17054
Content-Type: text/html
Date: Tue, 10 Oct 2017 17:35:53 GMT
Server: WSGIServer/0.2 CPython/3.5.4
X-Frame-Options: SAMEORIGIN

<!DOCTYPE html>
<html lang="en">
<head>

The follwoing commit broke things:
https://github.com/pulp/pulp/commit/8ecb2c2babe553014bde1a96232d0e6865068ef2

Associated revisions

Revision cfff931a View on GitHub
Added by daviddavis almost 2 years ago

Fix the api schema route

The issue was that we were mapping all /api/v3/ routes to the api schema
which meant that all routes that didn't match another route displayed
the api schema. It also caused some weird behaviors where we saw some
406s instead of 404. I also needed to move the route above the other
routers because they assigned /api/v3/ to a route which returns a list
of resources.

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

Revision cfff931a View on GitHub
Added by daviddavis almost 2 years ago

Fix the api schema route

The issue was that we were mapping all /api/v3/ routes to the api schema
which meant that all routes that didn't match another route displayed
the api schema. It also caused some weird behaviors where we saw some
406s instead of 404. I also needed to move the route above the other
routers because they assigned /api/v3/ to a route which returns a list
of resources.

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

Revision cfff931a View on GitHub
Added by daviddavis almost 2 years ago

Fix the api schema route

The issue was that we were mapping all /api/v3/ routes to the api schema
which meant that all routes that didn't match another route displayed
the api schema. It also caused some weird behaviors where we saw some
406s instead of 404. I also needed to move the route above the other
routers because they assigned /api/v3/ to a route which returns a list
of resources.

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

History

#1 Updated by dkliban@redhat.com about 2 years ago

  • Description updated (diff)

#2 Updated by amacdona@redhat.com almost 2 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to amacdona@redhat.com
  • Priority changed from Normal to High
  • Severity changed from 2. Medium to 3. High
  • Triaged changed from No to Yes
  • Tags Pulp 3 added

#3 Updated by daviddavis almost 2 years ago

  • Status changed from ASSIGNED to POST
  • Assignee changed from amacdona@redhat.com to daviddavis

#4 Updated by daviddavis almost 2 years ago

  • Status changed from POST to MODIFIED

#5 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#6 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF