V10.x.x custom app error on bench update --patch

Dear Community,

I have a standard Erpnext Server with frappe v10.x.x and erpnext v10.x.x
We have a custom application that worked before.

When bench update --patch I get an error message with a JSON problem.

The console looks like the following:

frappe@erp:~/frappe-bench$ bench update --patch

remote: Enumerating objects: 105, done.
remote: Counting objects: 100% (105/105), done.
remote: Total 133 (delta 104), reused 104 (delta 104), pack-reused 28
Receiving objects: 100% (133/133), 13.06 KiB | 0 bytes/s, done.
Resolving deltas: 100% (104/104), completed with 32 local objects.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
66bddda…5297838 mergify/bp/version-13-beta-pre-release/pr-11139 → upstream/mergify/bp/version-13-beta-pre-release/pr-11139
33b3a5b…586d502 rebrand-ui → upstream/rebrand-ui
388bcf3…7dd0322 version-11-hotfix → upstream/version-11-hotfix
ef6d289…0428943 version-12-hotfix → upstream/version-12-hotfix
Backing up sites…
Patching sites…
Migrating erp.topservicegroup.hu
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Migrating erpmaster.garybsimon.hu
Executing erpnext.patches.v8_1.setup_gst_india #2019-04-04 in erpmaster.garybsimon.hu (3f658ac1278af00f)
Success
Executing erpnext.patches.v10_0.repost_requested_qty_for_non_stock_uom_items in erpmaster.garybsimon.hu (3f658ac1278af00f)
Success
Executing erpnext.patches.v10_0.gst_hsn_fixes in erpmaster.garybsimon.hu (3f658ac1278af00f)
Success
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Updating DocTypes for topservice_modul: [========================================]
Updating customizations for Contact
Updating customizations for BOM Operation
Updating customizations for Company
Updating customizations for Topservice Custom BOM
Updating customizations for Quotation
Updating customizations for Timesheet
Updating customizations for Warranty Claim
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 44, in migrate
sync_customizations()
File “/home/frappe/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 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 14 column 1 (char 280)

Please let me know what can be the problem.
I have checked the log files but still no luck.

I have tested the JSON code with validator and it looks good.

If you have any idea how to fix that I’ll be very happy.

Regards Gary

Does bench update --reset do the same?

Hi smino,

Yea sadly it’s the same problem.

Patching sites...

Migrating erp.topservicegroup.hu
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Migrating erpmaster.garybsimon.hu
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Updating DocTypes for topservice_modul: [========================================]
Updating customizations for Contact
Updating customizations for BOM Operation
Updating customizations for Company
Updating customizations for Topservice Custom BOM
Updating customizations for Quotation
Updating customizations for Timesheet
Updating customizations for Warranty Claim
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 44, in migrate
sync_customizations()
File “/home/frappe/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 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 14 column 1 (char 280)

Remove the custom app, do the update, reinstall the custom app

Hi,

The patch has been done, but I think there is a problem with the custom App.

Can you please advice where to check the error in the app when the same error happened on migrate command?

frappe@erp:~/frappe-bench$ bench update --patch
Backing up sites...
Patching sites...
Migrating erp.topservicegroup.hu
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
Migrating erpmaster.garybsimon.hu
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
$ sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and Frappe Applications (https://frappe.io/bench).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
frappe@erp:~/frappe-bench$ bench --site erp.topservicegroup.hu install-app topservice_modul

Installing topservice_modul...
Updating DocTypes for topservice_modul: [========================================]
Updating customizations for Contact
Updating customizations for BOM Operation
Updating customizations for Company
Updating customizations for Topservice Custom BOM
Updating customizations for Quotation
Updating customizations for Timesheet
Updating customizations for Warranty Claim
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
  File "/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
  File "/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 165, in install_app
_install_app(app, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 156, in install_app
sync_customizations(name)
  File "/home/frappe/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 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 14 column 1 (char 280)

Your idea to fix this thing is partly done. But, the custom app has some customization and it’s not working with the migrate command. I have no idea what’s the cause, but it looks like the problem is with the JSON files in the app Custom folder. JSON validation still good, no sign of errors. But I thing there is a character count problem or something like this.

If you have any other idea where to start the debug then I’ll be thankfull.

Regards.
:slight_smile:

Maybe a

bench update --patch