Latest update error

Hello,

Got this error on latest update. What caused this? Seemed that it can’t connect to database. what happened? TKs

Migrating site1.local
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py", line 213, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 21, in run_all
    executed = [p[0] for p in frappe.db.sql("""select patch from `tabPatch Log`""")]
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py", line 105, in sql
    self.connect()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py", line 51, in connect
    use_unicode=True, charset='utf8')
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 81, in Connect
    return Connection(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 193, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, 'Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysqld.sock\' (111 "Connection refused")')
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/ubuntu/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/bench-repo/bench/cli.py", line 240, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/ubuntu/bench-repo/bench/cli.py", line 273, in update
    patch_sites(bench=bench_path)
  File "/home/ubuntu/bench-repo/bench/utils.py", line 158, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench=bench)
  File "/home/ubuntu/bench-repo/bench/utils.py", line 489, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

Seems your mysql is not running. Ref. http://stackoverflow.com/questions/20646230/mysql-error-2002

@saurabh6790 I got mysql running…now I’m getting this error when running bench update again

Migrating site1.local
Executing execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2015-10-16 in site1.local (1bd3e0294d)
Success
Executing execute:frappe.reload_doc('custom', 'doctype', 'custom_field') #2015-10-19 in site1.local (1bd3e0294d)
Success
Executing execute:frappe.reload_doc('core', 'doctype', 'patch_log') #2016-10-31 in site1.local (1bd3e0294d)
Success
Executing execute:frappe.reload_doctype("File") # 2015-10-19 in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_4.reduce_varchar_length in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_4.rename_bengali_language in site1.local (1bd3e0294d)
Success
Executing execute:frappe.db.sql("""update `tabCommunication` set parenttype=null, parent=null, parentfield=null""") #2015-10-22 in site1.local (1bd3e0294d)
Success
Executing execute:frappe.permissions.reset_perms("Web Page") in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_6.user_last_active in site1.local (1bd3e0294d)
bad json: /home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/user/user.json
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py", line 213, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/patches/v6_6/user_last_active.py", line 5, in execute
    frappe.reload_doctype("User")
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 562, in reload_doctype
    reload_doc(scrub(db.get_value("DocType", doctype, "module")), "doctype", scrub(doctype), force=force)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 574, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/__init__.py", line 37, in reload_doc
    return import_files(module, dt, dn, force=force)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 17, in import_files
    return import_file(module, dt, dn, force=force, pre_process=pre_process)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 22, in import_file
    ret = import_file_by_path(path, force, pre_process=pre_process)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 36, in import_file_by_path
    docs = read_doc_from_file(path)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 74, in read_doc_from_file
    doc = json.loads(f.read())
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, 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
    obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 427 column 1 (char 9046)
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/ubuntu/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/bench-repo/bench/cli.py", line 240, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/ubuntu/bench-repo/bench/cli.py", line 273, in update
    patch_sites(bench=bench_path)
  File "/home/ubuntu/bench-repo/bench/utils.py", line 158, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench=bench)
  File "/home/ubuntu/bench-repo/bench/utils.py", line 489, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')

I modified user doctype before. Now it’s working. Tks