Open jerrybox opened 5 years ago
Ginkgo Vagrant version
class LearnerDetailsViewSet(CommonAuthMixin, viewsets.ReadOnlyModelViewSet):
queryset = get_user_model().objects.all()
pagination_class = FiguresLimitOffsetPagination
serializer_class = LearnerDetailsSerializer
filter_backends = (DjangoFilterBackend, )
filter_class = UserFilterSet
def get_queryset(self):
'''
<QueryDict: {u'foo': [u'bar'], u'ids': [u'1,2,3']}>
http://localhost:8000/figures/api/learners/detail/?ids=1,2,3&foo=bar&grue=11&grue=2&grue=3&zub=[5,10,20]
self.request.query_params
<QueryDict: {u'zub': [u'[5,10,20]'], u'grue': [u'11', u'2', u'3'],
u'foo': [u'bar'], u'ids': [u'1,2,3']}>
'''
queryset = super(LearnerDetailsViewSet, self).get_queryset()
return queryset
@jerrybox Thanks for submitting this bug!
In order to help understand this better, I have some questions:
A) Which are you running Ginkgo for your Vagrant environment? devstack or fullstack?
B) How are you installing Figures? using the production installation instructions or the devstack installation instructions?
C) As the edxapp user, when you type pip list | grep -i figures
what do you see?
I've commented on what I think are the errors you are describing below to make sure I'm not missing something:
It seems you are reporting two errors and a documentation issue.
1) 404 on the /figures/api/users/
endpoint, but a 200 on /figures/api/learners/
The front end should be making calls to figures/api/users/
and shouldn't be making calls to /figures/api/learners/
. These are the endpoints that the frontend goes to: https://github.com/appsembler/figures/blob/0.1.3/frontend/src/apiConfig.js
And these are the endpoints for the Figures Django reusable app: https://github.com/appsembler/figures/blob/0.1.3/figures/urls.py
2) InvalidKeyError
InvalidKeyError: <class 'opaque_keys.edx.locator.CourseLocator'>: detail/course-v1:edX+DemoX+Demo_Course
The error itself is showing detail/
as part of the course key string, which is clearly wrong, but I don't see where it traces back to a figures API call in the /edx/var/log/lms/edx.log
fragment you pasted above. You say you are getting this when your browser is at the http://192.168.56.10/figures/course/course-v1:edX+DemoX+Demo_Course
url?
3) Invalid url in Docstring
I've fixed (locally, still need to push to GH) the docstring in the LearnerDetailsViewSet.get_queryset
method. Should be /figures/api/users/detail/?<query params>
.
But of course, that isn't causing the errors you are seeing.
Thanks very much.
A)edx: fullstack with vagrant-images_ginkgo-fullstack-2017-08-14.box B)production installation instructions C)result of 'pip list | grep -i figures' as follow: Figures (0.1.3, /edx/app/edxapp/venvs/edxapp/src/figures)
Yes, /figures/api/learners/ request is manual by me because of the docstring of the LarnerDetailsViewSet
edxapp@vagrant:~/edx-platform$ git log -1 commit 37052afe316f14c61ab5c799434e4610b9d2d912 (HEAD -> nedbat/test/ginkgo.1.1, origin/open-release/ginkgo.master, origin/nedbat/test/ginkgo.1.1) Merge: 83ebc23198 ea5ac4988a Author: Ned Batchelder ned@nedbatchelder.com Date: Thu Aug 10 10:36:20 2017 -0400
Merge pull request #15781 from edx/nedbat/learner-2172-ginkgo
Host poisoning vulnerability fix
@jerrybox Thanks! The extra info helps me understand your environment better. I can't tell yet why you are getting a 404 on the <host>/figures/api/learners/detail/?enrolled_in_course_id=course-v1:edX+DemoX+Demo_Course
Some more questions to try to trace this down:
A) What do you get for results when you go to the <host>/figures/api/
path? This checks that you are getting the API root.
B) What do you get for <host>/figures/api/users/detail/
(This checks that you can get the users detail endpoint and the issue would be with the query parameter)
C) What do you see when you go to the <host>/courses/course-v1:edX+DemoX+Demo_Course
URL? Do you see the course page?
D) Are you able to see the Figures UI page at <host>/figures/
?
Thanks!
I am sorry for having kept you waiting for such a long time
A) log as follow:
B) log as follow:
C) I can see the course page.
D) I can see the figures homepage as follow:
@jerrybox
At this point, I'm just trying to narrow down what the issue could be by ruling out what the issue cannot be. What I'm thinking right now is one of two things:
A) Figures has a bug in unicode support for the users part of the API
B) There's some bad data the users API is trying to get causing the failure
I'm inclined to think it is "A" and that I need to add in unicode testing.
Just one thing that is interesting is that I should have put the paths in quotes instead of backticks because the call to "/figures/api/path/?" just drops to a catch all url. But that's ok, What I was checking was that the Figures app was found in lms/urls.py
Meanwhile, if you just want to test drive the UI with mock data, check out the "devsite-demo" branch: https://github.com/appsembler/figures/tree/devsite-demo
There is a (minimal) readme: https://github.com/appsembler/figures/blob/devsite-demo/devsite-demo-setup.txt
But it walks through the steps to setup, seed mock data and run the UI in a Figures standalone server. Right now this is JUST for exploring Figures, doing Figures development, etc not for production use
@jerrybox Are you still running into the same issues?
I am too busy to work it out.
URL: http://192.168.56.10/figures/course/course-v1:edX+DemoX+Demo_Course