louking / contracts

1 stars 2 forks source link

JSONDecodeError exception in /admin/calendar #479

Open louking opened 2 months ago

louking commented 2 months ago
Message type:       ERROR
        Location:           /var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py:838](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py:838)
        Module:             app
        Function:           log_exception
        Time:               2024-08-26 14:47:38,000

        Message:

        Exception on /admin/calendar [GET]

Traceback (most recent call last):
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/requests/models.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/requests/models.py)", line 971, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/app.py)", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask_security/decorators.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask_security/decorators.py)", line 544, in decorated_view
    return current_app.ensure_sync(fn)(*args, **kwargs)
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py)", line 110, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)  # type: ignore[no-any-return]
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/flask/views.py)", line 191, in dispatch_request
    return current_app.ensure_sync(meth)(**kwargs)  # type: ignore[no-any-return]
  File "/var/www/[www.contracts.loutilities.com/contracts/contracts/contracts/views/admin/admin_eventscalendar.py](http://www.contracts.loutilities.com/contracts/contracts/contracts/views/admin/admin_eventscalendar.py)", line 233, in get
    edoptions = dumps(dt.json()['edoptions'])
  File "/var/www/[www.contracts.loutilities.com/venv/lib/python3.9/site-packages/requests/models.py](http://www.contracts.loutilities.com/venv/lib/python3.9/site-packages/requests/models.py)", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
louking commented 2 months ago

this was introduced with the fix for #466

louking commented 1 month ago

While this isn't occuring in the development environment, it is occuring in production