-
Notifications
You must be signed in to change notification settings - Fork 5
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
The "all registrations" reports are returning Nginx 404s #115
Comments
I just checked the nginx configuration, helpfully stored here - https://github.com/knowledgecommonsdc/kcdc3/blob/master/misc/nginx-sites-enabled-kcdc.conf - and I don't see any timeouts explicitly set, which tells me that it should be 60 seconds. http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout That being said, I: a) measured it with a wall clock and it times out in 30 seconds Which class/link does this refer to? I need to send you my new SSH keys, right now I can't log into the server. |
Is it possible that class (or "slug" in the Django parlance) doesn't actually exist? I found this curious artifact in # display a list of registrations for a given session
class SessionAdminListView(ListView):
template_name = "classes/staff_session_list.html"
context_object_name = "session_list"
model = Session
def get_context_data(self, **kwargs):
context = super(SessionAdminListView, self).get_context_data(**kwargs)
context['session_list'] = Session.objects.all()
# is the user staff?
if self.request.user.is_staff:
return context
else:
# TODO this should really return a 403
return HttpResponse()
@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(SessionAdminListView, self).dispatch(*args, **kwargs) It's that "should return a 403" comment that leaves me puzzled. But the melatonin is kicking in so I can't diagnose further tonight. |
It's possible that the slug doesn't exist. The "should return a 403" - right now, non-admin users see a blank page. We should instead tell them that they are trespassing. This issue might not be relevant anymore - see issue #119. |
Poking at this since I'm bored and cold. So very cold.
The SQL statement ultimately being run is
Which, if I run it manually, returns 8033 rows. In 0.02 seconds. So...not too bad, but clearly more than django can handle, and more than we want. I'm guessing we want a better filter? |
I'm thinking now that:
is what's wrong. Specifically |
I take it back, after going through all of |
Well, 'slug' in the context of Maybe that should be |
No dice for There is a
but to no avail.
|
Finally got a VM/vagrant instance running. It does eventually return, it just takes a /really/ long time and I guess our low tier instance is slower than my Mac. |
Are you sure I also spent time going through Django docs; an alternate 'solution' I came up with is to add a session foreign key to the Registration model and just work from that. Of course, then we have to manually populate it. The pull request works on my VM, but there's something "not quite right" with the state of the code - it's pretty difficult to go from a clone to a test environment, even after I manually copied over all the static files. |
Pretty sure Will look at this more. Thanks, Matt Lesko wrote:
|
We have some pages that return a list of every registration in a session, with information about the registrants. These are slow to render, perhaps because they're database-expensive or because we're doing something dumb.
Anyway, the URLs for these return 404s from Nginx. I think that Django is busily trying to produce the data but Nginx gets tired of waiting and sends the user a 404.
See:
http://knowledgecommonsdc.org/classes/staff/registrations/session/1209/
The text was updated successfully, but these errors were encountered: