Error on migrating

Hi there,
I am getting an error while migrating dont know what it means,

user@User-ThinkPad-T400:~/frappe-bench$ bench --site migrate
Updating frappe : [========================================]
Updating erpnext : [=================================== ]bad json: /home/user/frappe-bench/apps/erpnext/erpnext/schools/doctype/student/student.json
Traceback (most recent call last):
File “/usr/lib/python2.7/”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/”, line 72, in _run_code
exec code in run_globals
File “/home/user/frappe-bench/apps/frappe/frappe/utils/”, line 79, in
File “/home/user/frappe-bench/apps/frappe/frappe/utils/”, line 16, in main
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/user/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/user/frappe-bench/apps/frappe/frappe/commands/”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/user/frappe-bench/apps/frappe/frappe/commands/”, line 209, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/user/frappe-bench/apps/frappe/frappe/”, line 32, in migrate
File “/home/user/frappe-bench/apps/frappe/frappe/model/”, line 19, in sync_all
sync_for(app, force, verbose=verbose)
File “/home/user/frappe-bench/apps/frappe/frappe/model/”, line 44, in sync_for
import_file_by_path(doc_path, force=force)
File “/home/user/frappe-bench/apps/frappe/frappe/modules/”, line 36, in import_file_by_path
docs = read_doc_from_file(path)
File “/home/user/frappe-bench/apps/frappe/frappe/modules/”, line 74, in read_doc_from_file
doc = json.loads(
File “/usr/lib/python2.7/json/”, line 338, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/”, line 366, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “/usr/lib/python2.7/json/”, line 382, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 766 column 1 (char 16248)

Hi @Ujjawal

Explain in detail what you are trying to do and someone here can help you .


i was trying to update bench.
but got the error some files are left to commit so i did git add -A and git commit -a -m’Message’
and got message to merge or something. in the same there was a suggestion to try git pull so did that. later again did bench update and got the same error as above.
Later restoring from a database and then migrating it getting that same error.

It seems , you have done few changes to the core modules of erpnext , which prevents you from migrating .


cd /home/ommi/frappe-bench/apps/erpnext/

git status

You can view the changes you have made ,

if you need those changes run git add . or git stash

then git commit to commit those changes and try migrating .


it states that you have no changes to commit.

Could you paste the output of the terminal when you run bench migrate ?


The first post is the error

Seems there’s something wrong with the json, did you mean to make some changes?. Just run git reset --hard upstream/master inside eprnext folder to remove any accidental changes and then try updating again.

message is Head is now at branch
after that?

Run update again

It seems you have done something to this ,

I have a similar instance on my server so downloaded the apps folder from it and replaced with the apps folder on the local machine and then restored the system from the database.
This solved it.

1 Like

Hi there, @ragav
The thing i am facing now is when i tried to login into the system it raised an error frappe ldap auth missing so i tried to update the bench so got the following error during erpnext pulling. erpnext
remote: Counting objects: 2081, done.
remote: Total 2081 (delta 1344), reused 1344 (delta 1344), pack-reused 737
Receiving objects: 100% (2081/2081), 3.41 MiB | 321.00 KiB/s, done.
Resolving deltas: 100% (1678/1678), completed with 470 local objects.
From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)

  • branch develop → FETCH_HEAD
    25e62fc…38c1732 develop → upstream/develop
    CONFLICT (modify/delete): patches.txt deleted in 38c173230486bc085058b79f70e42f7394a15dd3 and modified in HEAD. Version HEAD of patches.txt left in tree.
    Auto-merging erpnext/setup/doctype/company/company.json
    CONFLICT (content): Merge conflict in erpnext/setup/doctype/company/company.json
    Auto-merging erpnext/hr/report/monthly_salary_register/
    CONFLICT (content): Merge conflict in erpnext/hr/report/monthly_salary_register/
    Auto-merging erpnext/hr/doctype/salary_structure/
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/salary_structure/
    Auto-merging erpnext/hr/doctype/salary_structure/salary_structure.json
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/salary_structure/salary_structure.json
    Auto-merging erpnext/hr/doctype/salary_structure/salary_structure.js
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/salary_structure/salary_structure.js
    Auto-merging erpnext/hr/doctype/salary_slip/
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/salary_slip/
    Auto-merging erpnext/hr/doctype/salary_slip/salary_slip.json
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/salary_slip/salary_slip.json
    Auto-merging erpnext/hr/doctype/process_payroll/
    Auto-merging erpnext/hr/doctype/process_payroll/process_payroll.json
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/process_payroll/process_payroll.json
    Auto-merging erpnext/hr/doctype/hr_settings/hr_settings.json
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/hr_settings/hr_settings.json
    Auto-merging erpnext/hr/doctype/employee/employee.json
    CONFLICT (content): Merge conflict in erpnext/hr/doctype/employee/employee.json
    Auto-merging erpnext/hr/doctype/employee/employee.js
    Auto-merging erpnext/accounts/doctype/journal_entry/journal_entry.json
    CONFLICT (content): Merge conflict in erpnext/accounts/doctype/journal_entry/journal_entry.json
    Automatic merge failed; fix conflicts and then commit the result.
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==4.1.0’, ‘console_scripts’, ‘bench’)()
    File “/home/user/bench-repo/bench/”, line 40, in cli
    File “/usr/local/lib/python2.7/dist-packages/click/”, line 716, in call
    return self.main(*args, **kwargs)
    File “/usr/local/lib/python2.7/dist-packages/click/”, line 696, in main
    rv = self.invoke(ctx)
    File “/usr/local/lib/python2.7/dist-packages/click/”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/local/lib/python2.7/dist-packages/click/”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/local/lib/python2.7/dist-packages/click/”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/user/bench-repo/bench/commands/”, line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/user/bench-repo/bench/commands/”, line 76, in _update
    File “/home/user/bench-repo/bench/”, line 140, in pull_all_apps
    remote=remote, branch=get_current_branch(app, bench_path=bench_path)), cwd=app_dir)
    File “/home/user/bench-repo/bench/”, line 127, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull upstream develop

Navigate to apps/erpnext/setup/doctype/company/company.json, there you will see the merge conflicts denoted with <<<<<<< in the file.

Resolve them and then git add . , git commit, and continue!

Do this wherever you get conflict .