fossunited/mon_school

Server ERROR: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Closed this issue · 4 comments

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Screenshot 2021-08-19 at 17-43-03 Build

The following request is failing:

POST https://mon.school/api/method/frappe.desk.desktop.get_desktop_page

with this trackback:

Traceback (most recent call last):
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/app.py", line 66, in application
    response = frappe.api.handle()
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/handler.py", line 31, in handle
    data = execute_cmd(cmd)
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/handler.py", line 67, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/__init__.py", line 1204, in call
    return fn(*args, **newargs)
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/__init__.py", line 620, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "/home/fossunited/frappe-bench/apps/frappe/frappe/desk/desktop.py", line 377, in get_desktop_page
    wspace = Workspace(loads(page))
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/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)

@pateljannat do you know what is happening? How to resolve this?

Upgraded to latest version of frappe, community and mon_school. The issue is still there.

On inspection I found this on the console

Screenshot 2021-10-21 at 7 43 05 PM

It points to function get_page_to_show() and line 70 from workspace.js. On checking the source from console below is the function we see.

Screenshot 2021-10-21 at 7 43 20 PM

But this is the code from 3 months ago. Frappe had a workspace refactor 3 months ago and this is how the function looks now.
Screenshot 2021-10-21 at 7 44 57 PM

Also, there was no request that was failing, just this js thats throwing an error in the console.

So for some reason the workspace code on the website is not up to date.

Since workspace.js is in public folder it gets compiled under desk.js when we build assets. Can you please check if the assets for frappe on mon school are getting compiled properly?

Thanks @pateljannat. I ran build again and that seems to have resolved the issue.