V5 upgrade failing

Hello all,

Trying to Upgrade from V4.x.x. to V5 throws up exception below. Can someone please let me know what could be the issue?

erpnext4@erpnext4ubu7:~/frappe-bench$ bench retry-upgrade
From https://github.com/frappe/frappe

  • branch v5.x.x -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/erpnext
  • branch v5.x.x -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/shopping_cart
  • branch v4.x.x -> FETCH_HEAD
    Already up-to-date.
    /home/erpnext4/frappe-bench/env/bin/python: No module named num2words
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext4/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(s
    ub_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/erpnext4/bench-repo/bench/cli.py”, line 286, in retry_upgrade
    patch_sites()
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 158, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

From the frappe-bench folder try:
./env/bin/pip install -r apps/frappe/requirements.txt

erpnext4@erpnext4ubu7:~/frappe-bench$ ./env/bin/pip install -r apps/frappe/requirements.txt

Got the below output on the console

Requirement already satisfied (use --upgrade to upgrade): chardet in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): cssmin in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): dropbox in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): gunicorn in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): httplib2 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): jinja2 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade): markdown2 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 7))
Requirement already satisfied (use --upgrade to upgrade): markupsafe in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 8))
Requirement already satisfied (use --upgrade to upgrade): mysql-python==1.2.5 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 9))
Requirement already satisfied (use --upgrade to upgrade): python-geoip in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 10))
Requirement already satisfied (use --upgrade to upgrade): python-geoip-geolite2 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 11))
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 12))
Requirement already satisfied (use --upgrade to upgrade): pytz in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 13))
Requirement already satisfied (use --upgrade to upgrade): six in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 14))
Requirement already satisfied (use --upgrade to upgrade): slugify in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 15))
Requirement already satisfied (use --upgrade to upgrade): termcolor in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 16))
Requirement already satisfied (use --upgrade to upgrade): werkzeug in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 17))
Requirement already satisfied (use --upgrade to upgrade): semantic-version in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 18))
Requirement already satisfied (use --upgrade to upgrade): rauth>=0.6.2 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 19))
Requirement already satisfied (use --upgrade to upgrade): requests in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 20))
Requirement already satisfied (use --upgrade to upgrade): celery in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 21))
Requirement already satisfied (use --upgrade to upgrade): redis in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 22))
Requirement already satisfied (use --upgrade to upgrade): selenium in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 23))
Requirement already satisfied (use --upgrade to upgrade): pdfkit in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 24))
Requirement already satisfied (use --upgrade to upgrade): babel in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 25))
Requirement already satisfied (use --upgrade to upgrade): ipython in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): html2text in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 27))
Requirement already satisfied (use --upgrade to upgrade): email-reply-parser in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 28))
Requirement already satisfied (use --upgrade to upgrade): click in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 29))
Requirement already satisfied (use --upgrade to upgrade): num2words in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 30))
Requirement already satisfied (use --upgrade to upgrade): watchdog==0.8.0 in ./env/lib/python2.7/site-packages (from -r apps/frappe/requirements.txt (line 31))
Requirement already satisfied (use --upgrade to upgrade): urllib3 in ./env/lib/python2.7/site-packages (from dropbox->-r apps/frappe/requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): billiard<3.4,>=3.3.0.20 in ./env/lib/python2.7/site-packages (from celery->-r apps/frappe/requirements.txt (line 21))
Requirement already satisfied (use --upgrade to upgrade): kombu<3.1,>=3.0.25 in ./env/lib/python2.7/site-packages (from celery->-r apps/frappe/requirements.txt (line 21))
Requirement already satisfied (use --upgrade to upgrade): decorator in ./env/lib/python2.7/site-packages (from ipython->-r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in ./env/lib/python2.7/site-packages (from ipython->-r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): pexpect in ./env/lib/python2.7/site-packages (from ipython->-r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): traitlets in ./env/lib/python2.7/site-packages (from ipython->-r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): pickleshare in ./env/lib/python2.7/site-packages (from ipython->-r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): argh>=0.24.1 in ./env/lib/python2.7/site-packages (from watchdog==0.8.0->-r apps/frappe/requirements.txt (line 31))
Requirement already satisfied (use --upgrade to upgrade): PyYAML>=3.10 in ./env/lib/python2.7/site-packages (from watchdog==0.8.0->-r apps/frappe/requirements.txt (line 31))
Requirement already satisfied (use --upgrade to upgrade): pathtools>=0.1.1 in ./env/lib/python2.7/site-packages (from watchdog==0.8.0->-r apps/frappe/requirements.txt (line 31))
Requirement already satisfied (use --upgrade to upgrade): amqp<2.0,>=1.4.5 in ./env/lib/python2.7/site-packages (from kombu<3.1,>=3.0.25->celery->-r apps/frappe/requirements.txt (line 21))
Requirement already satisfied (use --upgrade to upgrade): anyjson>=0.3.3 in ./env/lib/python2.7/site-packages (from kombu<3.1,>=3.0.25->celery->-r apps/frappe/requirements.txt (line 21))
Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in ./env/lib/python2.7/site-packages (from traitlets->ipython->-r apps/frappe/requirements.txt (line 26))
Requirement already satisfied (use --upgrade to upgrade): path.py in ./env/lib/python2.7/site-packages (from pickleshare->ipython->-r apps/frappe/requirements.txt (line 26))

Sorry. it seems that num2words is already installed. The error seems strange then. Can you try retry-upgrade again?

Hi Anand, tried the following, it did lot of new things but finally got the exception again

erpnext4@erpnext4ubu7:~/frappe-bench$ bench retry-upgrade

From https://github.com/frappe/frappe

  • branch develop -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/erpnext
  • branch develop -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/shopping_cart
  • branch develop -> FETCH_HEAD
    Already up-to-date.
    Migrating site1.local
    Executing frappe.patches.v5_0.convert_to_barracuda_and_utf8mb4 in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docfield’, force=True) #2015-08-20 in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docperm’) #2014-06-24 in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘email’, ‘doctype’, ‘email_alert’) #2014-07-15 in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘desk’, ‘doctype’, ‘todo’) #2014-12-31-1 in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(‘custom’, ‘doctype’, ‘property_setter’) #2014-12-31-1 in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.v4_to_v5 in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.remove_shopping_cart_app in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.permissions.reset_perms(“Module Def”) in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.permissions.reset_perms(“User”) #2015-03-24 in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.rename_table_fieldnames in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.communication_parent in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.clear_website_group_and_notifications in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.db.sql(""“update tabComment set comment = substr(comment, 6, locate(”:", comment)-6) where comment_type in (“Assigned”, “Assignment Completed”)""") in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.fix_feed in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.update_shared in site1.local (1bd3e0294d)
    Success
    Executing execute:frappe.reload_doc(“core”, “doctype”, “docshare”) #2015-07-21 in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.bookmarks_to_stars in site1.local (1bd3e0294d)
    Success
    Executing frappe.patches.v5_0.style_settings_to_website_theme in site1.local (1bd3e0294d)
    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/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/home/erpnext4/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/erpnext4/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/erpnext4/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/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext4/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/erpnext4/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py”, line 214, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/patches/v5_0/style_settings_to_website_theme.py”, line 10, in execute
    migrate_style_settings()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/patches/v5_0/style_settings_to_website_theme.py”, line 28, in migrate_style_settings
    website_theme.use_theme()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py”, line 55, in use_theme
    use_theme(self.name)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/website/doctype/website_theme/website_theme.py”, line 62, in use_theme
    website_settings.save()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/model/document.py”, line 235, in save
    self.update_single(self.get_valid_dict())
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/model/document.py”, line 292, in update_single
    frappe.db.sql(""“delete from tabSingles where doctype=%s”"", self.doctype)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/database.py”, line 135, in sql
    self._cursor.execute(query, values)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
    self.errorhandler(self, exc, value)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1213, ‘Deadlock found when trying to get lock; try restarting transaction’)
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext4/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/erpnext4/bench-repo/bench/cli.py”, line 286, in retry_upgrade
    patch_sites()
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 158, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

There appears to be a deadlock. Log into mysql and kill your processes via show processlist

Thanks Rushabh. Killed the process and tried the command again but got another exception.
Is this the cause:
_mysql_exceptions.OperationalError: (1048, “Column ‘collapsible’ cannot be null”) ?
Which column is this and belongs to which table? Terminal output pasted below.

erpnext4@erpnext4ubu7:~/frappe-bench$ bench retry-upgrade
From https://github.com/frappe/frappe

  • branch v5.x.x -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/erpnext
  • branch v5.x.x -> FETCH_HEAD
    Already up-to-date.
    From https://github.com/frappe/shopping_cart
  • branch develop -> FETCH_HEAD
    Already up-to-date.
    /home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py:65: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.command(‘get-frappe-commands’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py:69: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.command(‘get-frappe-help’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:61: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def new_site(site, mariadb_root_username=None, mariadb_root_password=None, admin_password=None, verbose=False, install_apps=None, source_sql=None, force=None, install_app=None, db_name=None):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:122: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def restore(context, sql_file_path, mariadb_root_username=None, mariadb_root_password=None, db_name=None, verbose=None, install_app=None, admin_password=None, force=None):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:132: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:154: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:170: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:185: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def migrate(context, rebuild_website=False):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:223: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:239: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:254: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def build(make_copy=False, verbose=False):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:261: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.command(‘watch’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:269: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:285: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:298: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:314: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def sync_www(context, force=False):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:327: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:342: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:357: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:374: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:392: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.argument(‘args’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:400: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:413: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:428: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:445: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:461: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:476: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:489: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:504: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def import_doc(context, path, force=False):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:517: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:534: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def get_untranslated(context, lang, untranslated_file, all=None):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:549: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:563: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:584: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:593: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:610: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def run_tests(context, app=None, module=None, doctype=None, test=(), driver=None):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:637: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def serve(context, port=None, profile=False, sites_path=’.’, site=None):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:648: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:671: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.command(‘doctor’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:678: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.command(‘purge-all-tasks’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:686: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.command(‘dump-queue-status’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:695: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @click.argument(‘app_name’)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:702: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def _use(site, sites_path=’.’):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:712: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def backup(context, with_files=False, backup_path_db=None, backup_path_files=None, quiet=False):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:730: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    @pass_context
    /home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py:766: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    def drop_site(site, root_login=‘root’, root_password=None):
    /home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py:27: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    return click.group(name=app, commands=app_commands)(app_group)
    /home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py:14: Warning: Click detected the use of the unicode_literals future import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/
    click.Group(commands=commands)(prog_name=‘bench’)
    Migrating site1.local
    Executing execute:frappe.reload_doc(‘core’, ‘doctype’, ‘docfield’, force=True) #2015-05-15 in site1.local (1bd3e0294d)
    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/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 77, in
    main()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 14, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
    return self.main(*args, **kwargs)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
    rv = self.invoke(ctx)
    File “/home/erpnext4/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/erpnext4/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/erpnext4/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/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
    return callback(*args, **kwargs)
    File “/home/erpnext4/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/erpnext4/frappe-bench/apps/frappe/frappe/commands.py”, line 27, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/commands.py”, line 202, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 66, in execute_patch
    exec patchmodule.split(“execute:”)[1] in globals()
    File “”, line 1, in
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/init.py”, line 558, in reload_doc
    return frappe.modules.reload_doc(module, dt, dn, force=force)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/init.py”, line 37, in reload_doc
    return import_files(module, dt, dn, force=force)
    File “/home/erpnext4/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/erpnext4/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/erpnext4/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 54, in import_file_by_path
    import_doc(doc, force=force, data_import=data_import, pre_process=pre_process)
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 122, in import_doc
    doc.insert()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/model/document.py”, line 192, in insert
    d.db_insert()
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 264, in db_insert
    ), d.values())
    File “/home/erpnext4/frappe-bench/apps/frappe/frappe/database.py”, line 135, in sql
    self._cursor.execute(query, values)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
    self.errorhandler(self, exc, value)
    File “/home/erpnext4/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1048, “Column ‘collapsible’ cannot be null”)
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
    File “/home/erpnext4/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/erpnext4/bench-repo/bench/cli.py”, line 286, in retry_upgrade
    patch_sites()
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 158, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/erpnext4/bench-repo/bench/utils.py”, line 489, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

Having the same exact issue. Any resolution?

Not able to figure out the solution yet @Brandon_Fox. Need help from @rmehta to resolve this.

This is the source of both our issues. Something with the database has a constraint on it and the update script can not fix that. My idea was to remove any null entries in the database, but don’t want to mess with the database till I know where I am going. Mine is a custom field in the sales order module.

Collapsible cannot be null just strikes me as interesting considering that collapsible sections in forms was only introduced this week. At a guess the script hasn’t been updated to take account of this and therefore the relevant field in the database hasn’t been set to the correct value (at a guess a 0 or 1 for not collapsed or collapsed) so deleting null values could be a bit iffy as the correct response may be to add the default value so no nulls exist.

Just one suggestion which could be very, very wide off the mark but that work “collapsible” just had me wondering :smiley:

Sorry, but not having the band-width to debug / fix this.

We have not yet encountered this in our 2000+ cloud databases.

Are you having custom apps?

No, I am not having any custom apps, but have customized some forms by adding a few fields.