Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 API mostly returns HTTP 500s #357

Open
daenney opened this issue May 15, 2021 · 2 comments
Open

v2 API mostly returns HTTP 500s #357

daenney opened this issue May 15, 2021 · 2 comments

Comments

@daenney
Copy link

daenney commented May 15, 2021

Looking at the endpoints for v2, I get the following patterns:

tracker/ api/v2/ ^events/$ [name='event-list']
tracker/ api/v2/ ^events\.(?P<format>[a-z0-9]+)/?$ [name='event-list']
tracker/ api/v2/ ^events/(?P<pk>[^/.]+)/$ [name='event-detail']
tracker/ api/v2/ ^events/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='event-detail']
tracker/ api/v2/ ^runners/$ [name='runner-list']
tracker/ api/v2/ ^runners\.(?P<format>[a-z0-9]+)/?$ [name='runner-list']
tracker/ api/v2/ ^runners/(?P<pk>[^/.]+)/$ [name='runner-detail']
tracker/ api/v2/ ^runners/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='runner-detail']
tracker/ api/v2/ ^runs/$ [name='speedrun-list']
tracker/ api/v2/ ^runs\.(?P<format>[a-z0-9]+)/?$ [name='speedrun-list']
tracker/ api/v2/ ^runs/(?P<pk>[^/.]+)/$ [name='speedrun-detail']
tracker/ api/v2/ ^runs/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='speedrun-detail']
tracker/ api/v2/ ^$ [name='api-root']
tracker/ api/v2/ ^\.(?P<format>[a-z0-9]+)/?$ [name='api-root']
tracker/ api/v2/ api-auth/ login/ [name='login']
tracker/ api/v2/ api-auth/ logout/ [name='logout'] 

However, trying to request /events/ seems to always return an HTTP 500:

$ curl https://gamesdonequick.com/tracker/api/v2/events/ -H "Accept: application/json" -vv

< HTTP/2 500 
< date: Sat, 15 May 2021 12:03:19 GMT
< content-type: text/html; charset=utf-8
< vary: Accept-Language, Cookie
< content-language: en

Server done blowed up

Varying the "Accept" header doesn't seem to matter either.

I get the same for just about any /events endpoint, /runs/ times out and some of the /run/ endpoints seem to also just 500 across the board.

I tried it with a local copy of donation-tracker, and in that case doing a request like curl http://localhost:8000/tracker/api/v2/events/ -vv doesn't blow up:

*   Trying ::1:8000...
* connect to ::1 port 8000 failed: Connection refused
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET /tracker/api/v2/events/ HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.76.1
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Type: application/json
< Vary: Accept, Cookie
< Allow: GET, HEAD, OPTIONS
< X-Frame-Options: SAMEORIGIN
< Content-Length: 2
< 
* Connection #0 to host localhost left intact
[]

Once I add an event to the database, things start to blow up locally too:

  • /events/ returns:
    Exception Type: TemplateDoesNotExist
    Exception Value: rest_framework/api.html
  • /events.json or /events.json/ returns:
    Exception Type: TypeError at /tracker/api/v2/events.json
    Exception Value: list() got an unexpected keyword argument 'format'

Based on what I'm seeing, is the v2 API in a state where it's expected to work and be used?

@uraniumanchor
Copy link
Collaborator

Hi, sorry I didn't respond to this earlier. v2 is still not in a generally-usable state at this time. What I'm probably going to do is add a setting so that you have to explicitly turn it on until it can be made more production ready. Sorry for the confusion!

@daenney
Copy link
Author

daenney commented Oct 20, 2021

Gotcha! Thanks for circling back on this, that's still very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants