JSONDecodeError while using oTree HR with Prolific

146 views
Skip to first unread message

Stephane

unread,
Aug 2, 2021, 4:03:45 AM8/2/21
to oTree help & discussion

Hi all!
I get the following error on oTree HR when entering the session code to use it with Prolific. I created a room and using this room's session with the right code. Can you help me?
Best regards,
Stephane


Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)

During handling of the above exception (2), another exception occurred:
  File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/app/.heroku/python/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/app/.heroku/python/lib/python3.9/site-packages/sentry_sdk/integrations/django/views.py", line 67, in sentry_wrapped_callback
    return callback(request, *args, **kwargs)
  File "/app/.heroku/python/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/app/.heroku/python/lib/python3.9/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/app/hr/views.py", line 17, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/app/.heroku/python/lib/python3.9/site-packages/django/views/generic/base.py", line 98, in dispatch
    return handler(request, *args, **kwargs)
  File "/app/prolific/views.py", line 50, in post
    session_data = site.call_api(GET, 'sessions', code, participant_labels=[])
  File "/app/hr/models.py", line 78, in call_api
    return call_api(self.url, self.rest_key, method, *path_parts, **params)
  File "/app/otree_api.py", line 46, in call_api
    return resp.json()
  File "/app/.heroku/python/lib/python3.9/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/app/.heroku/python/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/app/.heroku/python/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

Exception Type: JSONDecodeError at /sites/14/prolific
Exception Value: Expecting value: line 3 column 1 (char 2)

Chris @ oTree

unread,
Aug 2, 2021, 10:24:21 AM8/2/21
to Stephane, oTree help & discussion
What version of oTree are you using?

Sent from my phone

On Aug 2, 2021, at 2:03 AM, Stephane <step...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "oTree help & discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otree+un...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/otree/af860652-171b-416d-8b20-8c17c02b41c6n%40googlegroups.com.

Stephane

unread,
Aug 3, 2021, 2:46:03 AM8/3/21
to oTree help & discussion
Thanks a lot for the quick follow up!
I'm using oTree 3.4.0, I tried to upgrade but my projects needs django.

Chris @ oTree

unread,
Aug 3, 2021, 10:48:57 AM8/3/21
to Stephane, oTree help & discussion
The current version of oTree HR only works with oTree 5, despite my efforts to get it to work on oTree 3, sorry.

Sent from my phone

On Aug 3, 2021, at 12:46 AM, Stephane <step...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages