Update error from V7 to V10

Hi All,

Today I tried to update from V7 to V10, now got an error, appreciate if anyone can help me.

Executing execute:frappe.reload_doc('core', 'doctype', 'module_def') #2017-09-22 in site1.local (1bd3e0294da19198)

Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 94, in
main()
File “/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/john/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/john/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/john/frappe-bench/apps/frappe/frappe/migrate.py”, line 31, in migrate
frappe.modules.patch_handler.run_all()
File “/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 81, in execute_patch
exec(patchmodule.split(“execute:”)[1],globals())
File “”, line 1, in
File “/home/john/frappe-bench/apps/frappe/frappe/init.py”, line 695, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 155, in reload_doc
return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 19, in import_files
reset_permissions=reset_permissions)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 24, in import_file
ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 58, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 132, in import_doc
doc.insert()
File “/home/john/frappe-bench/apps/frappe/frappe/model/document.py”, line 237, in insert
d.db_insert()
File “/home/john/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 303, in db_insert
), list(d.values()))
File “/home/john/frappe-bench/apps/frappe/frappe/database.py”, line 166, in sql
self._cursor.execute(query, values)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py”, line 165, in execute
result = self._query(query)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py”, line 321, in _query
conn.query(q)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 1061, in _read_query_result
result.read()
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 1349, in read
first_packet = self.connection._read_packet()
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 1018, in _read_packet
packet.check_error()
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 384, in check_error
err.raise_mysql_exception(self._data)
File “/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py”, line 107, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1048, u"Column ‘is_custom’ cannot be null")

Best Regards,
John

Hi,
please check

thanks @NMyshuk,

I tried dropped the 2 colums, seems it is the same. or did I miss anything else?

Hi All,

Today I still got the error, does it mean my current data is_custom in module_def are null, so the error occurred? Should I make them false to proceed?

[john@centos-CEFERP2-1vcpu-2gb-sgp1-01 frappe-bench]$ bench migrate
Migrating site1.local
Executing execute:frappe.reload_doc('core', 'doctype', 'module_def') #2017-09-22 in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/john/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 81, in execute_patch
    exec(patchmodule.split("execute:")[1],globals())
  File "<string>", line 1, in <module>
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 695, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/utils.py", line 155, in reload_doc
    return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 19, in import_files
    reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 24, in import_file
    ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 132, in import_doc
    doc.insert()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 237, in insert
    d.db_insert()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/base_document.py", line 303, in db_insert
    ), list(d.values()))
  File "/home/john/frappe-bench/apps/frappe/frappe/database.py", line 166, in sql
    self._cursor.execute(query, values)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
    result = self._query(query)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
    conn.query(q)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
    result.read()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read
    first_packet = self.connection._read_packet()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
    packet.check_error()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1048, u"Column 'is_custom' cannot be null")

Hi, sorry which columns have you dropped?
you should run something like ALTER TABLE tabDocType DROP COLUMN is_custom;

Hi Thanks,

I dropped the 2 columns mentioned in the post…

Thanks, I will try again now.

Hi @NMyshuk,

I have checked, both table tabDocType and tabModule Def Don’t have column is_custom, so there is nothing for me to drop.

As I saw the error is saying that u"Column ‘is_custom’ cannot be null"

So I’m wondering if it is due to the two tables don’t have this column and that’s why value is null, so I created the column named ‘is_custom’ in both tables and updated all the values to false, so the values is definitely not null.

MariaDB [1bd3e0294da19198]> UPDATE  `tabModule Def` SET is_custom=0;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 27  Changed: 0  Warnings: 0

`MariaDB [1bd3e0294da19198]> SHOW COLUMNS FROM `tabModule Def`;`
    +-------------+--------------+------+-----+---------+-------+
    | Field       | Type         | Null | Key | Default | Extra |
    +-------------+--------------+------+-----+---------+-------+
    | name        | varchar(140) | NO   | PRI | NULL    |       |
    | creation    | datetime(6)  | YES  |     | NULL    |       |
    | modified    | datetime(6)  | YES  |     | NULL    |       |
    | modified_by | varchar(140) | YES  |     | NULL    |       |
    | owner       | varchar(140) | YES  |     | NULL    |       |
    | docstatus   | int(1)       | NO   |     | 0       |       |
    | parent      | varchar(140) | YES  | MUL | NULL    |       |
    | parentfield | varchar(140) | YES  |     | NULL    |       |
    | parenttype  | varchar(140) | YES  |     | NULL    |       |
    | idx         | int(8)       | NO   |     | 0       |       |
    | _liked_by   | text         | YES  |     | NULL    |       |
    | app_name    | varchar(140) | YES  |     | NULL    |       |
    | _comments   | text         | YES  |     | NULL    |       |
    | _assign     | text         | YES  |     | NULL    |       |
    | module_name | varchar(140) | YES  |     | NULL    |       |
    | _user_tags  | text         | YES  |     | NULL    |       |
    | is_custom   | tinyint(1)   | NO   |     | 0

But when I run bench migrate, the same error occurred…

Sorry the last one, please try this one
ALTER TABLE tabDocPerm DROP COLUMN is_custom;
also I suppose you should remove your own column

Thanks @NMyshuk,

It works but another error occurred, do I need to add another docType Gender

Executing frappe.patches.v8_0.setup_email_inbox #2017-03-29 in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/john/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/john/frappe-bench/apps/frappe/frappe/patches/v8_0/setup_email_inbox.py", line 25, in execute
    setup_inbox_from_email_account()
  File "/home/john/frappe-bench/apps/frappe/frappe/patches/v8_0/setup_email_inbox.py", line 38, in setup_inbox_from_email_account
    email_account.get("email_id"), email_account.get("enabled_outgoing"))
  File "/home/john/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 656, in setup_user_email_inbox
    add_user_email(user_name)
  File "/home/john/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 636, in add_user_email
    user.save(ignore_permissions=True)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 289, in _save
    self._validate_links()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 714, in _validate_links
    invalid_links, cancelled_links = self.get_invalid_links()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/base_document.py", line 462, in get_invalid_links
    if frappe.get_meta(doctype).issingle:
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 655, in get_meta
    return frappe.model.meta.get_meta(doctype, cached=cached)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/meta.py", line 33, in get_meta
    lambda: Meta(doctype))
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py", line 173, in hget
    value = generator()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/meta.py", line 33, in <lambda>
    lambda: Meta(doctype))
  File "/home/john/frappe-bench/apps/frappe/frappe/model/meta.py", line 72, in __init__
    super(Meta, self).__init__("DocType", doctype)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 103, in __init__
    self.load_from_db()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/meta.py", line 77, in load_from_db
    super(Meta, self).load_from_db()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 140, in load_from_db
    frappe.throw(_("{0} {1} not found").format(_(self.doctype), self.name), frappe.DoesNotExistError)
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 323, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in msgprint
    _raise_exception()
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 282, in _raise_exception
    raise raise_exception(encode(msg))
frappe.exceptions.DoesNotExistError: DocType Gender not found

Hi All,

Just now I tried to reload the docType Gender, and it got another error:

Executing frappe.patches.v8_0.setup_email_inbox #2017-03-29 in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/john/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/john/frappe-bench/apps/frappe/frappe/patches/v8_0/setup_email_inbox.py", line 25, in execute
    setup_inbox_from_email_account()
  File "/home/john/frappe-bench/apps/frappe/frappe/patches/v8_0/setup_email_inbox.py", line 38, in setup_inbox_from_email_account
    email_account.get("email_id"), email_account.get("enabled_outgoing"))
  File "/home/john/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 656, in setup_user_email_inbox
    add_user_email(user_name)
  File "/home/john/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 636, in add_user_email
    user.save(ignore_permissions=True)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 256, in save
    return self._save(*args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 289, in _save
    self._validate_links()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 724, in _validate_links
    frappe.LinkValidationError)
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 323, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in msgprint
    _raise_exception()
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 282, in _raise_exception
    raise raise_exception(encode(msg))
frappe.exceptions.LinkValidationError: Could not find Gender: Female

Hi, you need to insert Female value to the Gender table.

bench mysql
INSERT INTO tabGender VALUES ("Male", "Female")

Pushed a fix in hotfix branch
https://github.com/frappe/frappe/commit/53e66e8d0b2af0b3dde944999724a35644c75672

It will be released soon, for now you can do the changes manually.

Thanks @nabinhait ,

The problem fixed, but another error occurred:

Executing erpnext.patches.v10_0.fix_reserved_qty_for_sub_contract in site1.local (1bd3e0294da19198)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/john/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/john/frappe-bench/apps/erpnext/erpnext/patches/v10_0/fix_reserved_qty_for_sub_contract.py", line 12, in execute
    where docstatus=1 and reserve_warehouse is not null and reserve_warehouse != ''"""):
  File "/home/john/frappe-bench/apps/frappe/frappe/database.py", line 176, in sql
    self._cursor.execute(query)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
    result = self._query(query)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
    conn.query(q)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
    result.read()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read
    first_packet = self.connection._read_packet()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
    packet.check_error()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, u"Unknown column 'reserve_warehouse' in 'field list'")

This is also fixed in the latest release. Are you using bench update command?

Thanks @nabinhait,

I just using bench migrate. Just now I tried bench update --reset

The old error come back again. Maybe you can fix this also:

Executing execute:frappe.reload_doc('core', 'doctype', 'docperm') #2017-03-03 in vue.tech (dafc63c758d33388)
Success
Executing execute:frappe.reload_doc('core', 'doctype', 'module_def') #2017-09-22 in vue.tech (dafc63c758d33388)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
    main()
  File "/home/john/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/commands/site.py", line 222, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
  File "/home/john/frappe-bench/apps/frappe/frappe/migrate.py", line 31, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 29, in run_all
    if not run_single(patchmodule = patch):
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 81, in execute_patch
    exec(patchmodule.split("execute:")[1],globals())
  File "<string>", line 1, in <module>
  File "/home/john/frappe-bench/apps/frappe/frappe/__init__.py", line 695, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/utils.py", line 155, in reload_doc
    return import_files(module, dt, dn, force=force, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 19, in import_files
    reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 24, in import_file
    ret = import_file_by_path(path, force, pre_process=pre_process, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 58, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/import_file.py", line 132, in import_doc
    doc.insert()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/document.py", line 237, in insert
    d.db_insert()
  File "/home/john/frappe-bench/apps/frappe/frappe/model/base_document.py", line 303, in db_insert
    ), list(d.values()))
  File "/home/john/frappe-bench/apps/frappe/frappe/database.py", line 166, in sql
    self._cursor.execute(query, values)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 165, in execute
    result = self._query(query)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 321, in _query
    conn.query(q)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 860, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1061, in _read_query_result
    result.read()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1349, in read
    first_packet = self.connection._read_packet()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1018, in _read_packet
    packet.check_error()
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 384, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/john/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1048, u"Column 'is_custom' cannot be null")

Can you try executing bench --force reload-doc core doctype docperm once? And after that try bench update.

Hi @nabinhait,

Just now I successfully migrated my site1.local, but the login page is not able to enter:

And when I enter contact page, it got error:

Traceback (most recent call last):
  File "/home/john/frappe-bench/apps/frappe/frappe/website/render.py", line 32, in render
    if can_cache() and frappe.cache().hget('website_404', frappe.request.url):
  File "/home/john/frappe-bench/apps/frappe/frappe/website/render.py", line 101, in render_page_by_language
    response.mimetype = mimetypes.guess_type(frappe.flags.file_path)[0] or b'application/octet-stream'
  File "/home/john/frappe-bench/apps/frappe/frappe/website/render.py", line 117, in render_page
  File "/home/john/frappe-bench/apps/frappe/frappe/website/render.py", line 124, in build
    lang_path = '{0}/{1}'.format(user_lang, path)
  File "/home/john/frappe-bench/apps/frappe/frappe/website/render.py", line 137, in build_page
    out = None
  File "/home/john/frappe-bench/apps/frappe/frappe/website/context.py", line 14, in get_context
    else:
  File "/home/john/frappe-bench/apps/frappe/frappe/website/router.py", line 35, in get_page_context
    page_context = make_page_context(path)
  File "/home/john/frappe-bench/apps/frappe/frappe/website/router.py", line 44, in make_page_context
    if not context:
  File "/home/john/frappe-bench/apps/frappe/frappe/website/router.py", line 23, in resolve_route
    context = get_page_context_from_doctype(path)
  File "/home/john/frappe-bench/apps/frappe/frappe/website/router.py", line 75, in get_page_context_from_doctype
    page_info = get_page_info_from_doctypes(path)
  File "/home/john/frappe-bench/apps/frappe/frappe/website/router.py", line 97, in get_page_info_from_doctypes
    controller = get_controller(doctype)
  File "/home/john/frappe-bench/apps/frappe/frappe/model/base_document.py", line 34, in get_controller
    _class = Document
  File "/home/john/frappe-bench/apps/frappe/frappe/modules/utils.py", line 173, in load_doctype_module
    """Returns the module object for given doctype."""
ImportError: Module import failed for Web Page (frappe.website.doctype.web_page.web_page)