ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

ValueError: No JSON object could be decoded

installation_problem

#1

Error encountered while bench migrate.

Migrating project
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Updating DocTypes for projecterp : [========================================]
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/user/workspace/projecterp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/user/workspace/projecterp/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/user/workspace/projecterp/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/user/workspace/projecterp/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/user/workspace/projecterp/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/user/workspace/projecterp/frappe-bench/apps/frappe/frappe/migrate.py”, line 36, in migrate
sync_customizations()
File “/home/user/workspace/projecterp/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 90, in sync_customizations
data = json.loads(f.read())
File “/usr/lib/python2.7/json/init.py”, line 339, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python2.7/json/decoder.py”, line 382, in raw_decode
raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decoded


#2

Apparently you have a ‘bad’ json file?

This notes a way to identify the problem file https://github.com/marionebl/jsonlint-cli/issues/9

once you install this tool https://www.npmjs.com/package/jsonlint-cli

As a test you can remove a comma in a json file then do this:

frappe@ubuntu:~/frappe-bench/sites$ jsonlint-cli “**/*.json”
/home/frappe/frappe-bench/sites/site1.local/site_config.json parse:
Parse error on line 2:
…1bd3e0294da19198" “db_password”: "JIYB
----------------------^
Expecting ‘EOF’, ‘}’, ‘:’, ‘,’, ‘]’, got ‘STRING’


#3

Hii
I am facing same problem on bench migrate.
Have you found any solution?


#4

To define your problem first you must post your error traceback…


#5

while bench migrate i got below error.

Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/indictrans/babefakhri/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/indictrans/babefakhri/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/indictrans/babefakhri/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/indictrans/babefakhri/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/indictrans/babefakhri/frappe-bench/apps/frappe/frappe/commands/site.py”, line 217, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/indictrans/babefakhri/frappe-bench/apps/frappe/frappe/migrate.py”, line 36, in migrate
sync_customizations()
File “/home/indictrans/babefakhri/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 89, in sync_customizations
data = json.loads(f.read())
File “/usr/lib/python2.7/json/init.py”, line 340, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/decoder.py”, line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python2.7/json/decoder.py”, line 382, in raw_decode
raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decoded


#6

Right thanks same traceback!

A search like this may give clues to the problem or fix https://discuss.erpnext.com/search?expanded=true&q=ValueError%3A%20No%20JSON%20object%20could%20be%20decoded%20after%3A2018-01-01

Maybe identify whether the problem is limited to a customization?


#8

Yes. This problem arise only after customizing doctypes.


#9

A search like this may give clues to the problem or fix https://discuss.erpnext.com/search?expanded=true&q=ValueError%3A%20No%20JSON%20object%20could%20be%20decoded%20after%3A2018-01-01

Thanks, i have already search for this but haven’t found any solution.


#10

Maybe find out the module that is the source of the problem?

To debug, set a breakpoint in the code with import pdb; pdb.set_trace()


#12

@clarkej Hii
The problem is solved.
I didn’t understand the cause of the problem but after changing my ‘custom’ folder name to ‘custom_script’ it worked.