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

Problem with wb_get_topic_latest_works #2531

Open
fnielsen opened this issue Sep 7, 2024 · 4 comments
Open

Problem with wb_get_topic_latest_works #2531

fnielsen opened this issue Sep 7, 2024 · 4 comments
Assignees
Labels
bug something wrong on our end

Comments

@fnielsen
Copy link
Collaborator

fnielsen commented Sep 7, 2024

Problem with the topic aspect and perhaps author aspect.

ERROR in app: Exception on /topic/Q189849/latest-works/rss [GET]
Traceback (most recent call last):
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/requests/models.py", line 974, in json
    return complexjson.loads(self.text, **kwargs)
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/flask/app.py", line 1455, in wsgi_app
    response = self.full_dispatch_request()
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/flask/app.py", line 869, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/flask/app.py", line 867, in full_dispatch_request
    rv = self.dispatch_request()
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/flask/app.py", line 852, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "./scholia/app/views.py", line 2017, in show_topic_rss
    response_body = wb_get_topic_latest_works(q)
  File "./scholia/rss.py", line 410, in wb_get_topic_latest_works
    data = response.json()
  File "/data/project/scholia/www/python/venv/lib/python3.9/site-packages/requests/models.py", line 978, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@fnielsen fnielsen added the bug something wrong on our end label Sep 7, 2024
@egonw egonw self-assigned this Oct 12, 2024
@egonw
Copy link
Collaborator

egonw commented Oct 12, 2024

It seems to time out for me. If it does, I can imagine the returned content is not JSON, causing the simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ?

@egonw
Copy link
Collaborator

egonw commented Oct 12, 2024

Actually, not sure... this is the SPARQL it is running and that works fine: https://w.wiki/BWbk

@egonw
Copy link
Collaborator

egonw commented Oct 12, 2024

Running it from the command line works too: python3 -m scholia.rss topic-latest-works Q189849

@egonw
Copy link
Collaborator

egonw commented Oct 12, 2024

Actually, works in the browser too. @fnielsen, how can I reproduce the error?

@egonw egonw assigned fnielsen and unassigned egonw Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something wrong on our end
Projects
None yet
Development

No branches or pull requests

2 participants