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

Hi there,
For a few days I’m facing with this issue:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I’m in production, and trying to move an entire website using export fixtures.
I created an app, exported everything I need from the website module.
So far, so good, everything is fine.

…but when I’m trying to install the app on the other site, or when running bench migrate, I’m getting this error:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0).

The json files look fine, as validation and structure, but still can’t get that working.
Any idea why this is not working even if everything seems to be fine?

this is how it ends every time:

bad json: /home/frappe/frappe-bench/apps/new_website_app/new_website_app/fixtures/portal_settings.json

Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 104, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 19, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 306, in migrate
migrate(
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 75, in migrate
sync_fixtures()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/fixtures.py”, line 24, in sync_fixtures
import_doc(frappe.get_app_path(app, “fixtures”, fname))
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/data_import/data_import.py”, line 186, in import_doc
import_file_by_path(
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 96, in import_file_by_path
docs = read_doc_from_file(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 169, in read_doc_from_file
doc = json.loads(f.read())
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)

Thank you for your time
any idea would be great

hi @DenisaElena, did you get a solution for this?

I solved mine by going into the “common_site_config.json”, and on the line stated in the error,I removed an i wanted comma there.

will it work for this

Traceback (most recent call last):
  File "apps/frappe/frappe/utils/background_jobs.py", line 134, in execute_job
    method(**kwargs)
  File "apps/frappe/frappe/integrations/doctype/webhook/webhook.py", line 105, in enqueue_webhook
    log_request(webhook.request_url, headers, data, r)
  File "apps/frappe/frappe/integrations/doctype/webhook/webhook.py", line 121, in log_request
    "response": json.dumps(res.json(), indent=4) if res else None,
  File "env/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  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)

@kid Can you please send the first 3 to 4 lines of your common_site_config.json, I would like to see if i can relate with how i solved my error.

@TinasheErasmus i have created a webhook from erpnext to google sheets, the data flows without a issue however its throws up the above error. The below is the common_site_config.json

{
 "auto_update": false,
 "background_workers": 1,
 "dns_multitenant": true,
 "file_watcher_port": 6787,
 "frappe_user": "username",
 "gunicorn_workers": 5,
 "live_reload": true,
 "maintenance_mode": 0,
 "pause_scheduler": 0,
 "rebase_on_pull": false,
 "redis_cache": "redis://localhost:13000",
 "redis_queue": "redis://localhost:11000",
 "redis_socketio": "redis://localhost:12000",
 "restart_supervisor_on_update": true,
 "restart_systemd_on_update": false,
 "root_password": "rootpassword",
 "serve_default_site": true,
 "shallow_clone": true,
 "socketio_port": 9000,
 "use_redis_auth": false,
 "webserver_port": 8000,
 "workers": {
  "default": {
   "timeout": 900
  },
  "short": {
   "timeout": 900
  }
 }
}