Bench Update AttributeError: 'Meta' object has no attribute 'timeline_field'

I get this error when running bench update

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/test/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/test/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/test/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/test/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/test/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/test/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/test/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/test/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/test/frappe-bench/apps/frappe/frappe/commands.py", line 213, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/test/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/test/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/test/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 58, in execute_patch
    block_user(True)
  File "/home/test/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 100, in block_user
    frappe.db.set_global('__session_status', block and 'stop' or None)
  File "/home/test/frappe-bench/apps/frappe/frappe/database.py", line 637, in set_global
    self.set_default(key, val, user)
  File "/home/test/frappe-bench/apps/frappe/frappe/database.py", line 645, in set_default
    frappe.defaults.set_default(key, val, parent, parenttype)
  File "/home/test/frappe-bench/apps/frappe/frappe/defaults.py", line 110, in set_default
    add_default(key, value, parent)
  File "/home/test/frappe-bench/apps/frappe/frappe/defaults.py", line 121, in add_default
    d.insert(ignore_permissions=True)
  File "/home/test/frappe-bench/apps/frappe/frappe/model/document.py", line 211, in insert
    self.run_post_save_methods()
  File "/home/test/frappe-bench/apps/frappe/frappe/model/document.py", line 627, in run_post_save_methods
    self.update_timeline_doc()
  File "/home/test/frappe-bench/apps/frappe/frappe/model/document.py", line 809, in update_timeline_doc
    if frappe.flags.in_install or not self.meta.timeline_field:
AttributeError: 'Meta' object has no attribute 'timeline_field'
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/test/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/test/bench-repo/bench/cli.py", line 241, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/home/test/bench-repo/bench/cli.py", line 270, in update
    patch_sites(bench=bench_path)
  File "/home/test/bench-repo/bench/utils.py", line 163, in patch_sites
    run_frappe_cmd('--site', 'all', 'migrate', bench=bench)
  File "/home/test/bench-repo/bench/utils.py", line 498, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'all', 'migrate')
1 Like

Having the same problem Here. I updated from 6.16 to 6.22 today.

Sorry! Just released a fix. Please update and this error won’t come again.

This fixed it for me, now it is working fine

Still getting the error.

frappe-bench$ bench update 
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
From https://github.com/frappe/shopping_cart
 * branch            master     -> FETCH_HEAD
From https://github.com/frappe/erpnext
 * branch            master     -> FETCH_HEAD
Success
Executing frappe.patches.v6_1.rename_file_data in site1.local (1bd3e0294d)
Success
Executing execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2015-10-16 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('custom', 'doctype', 'custom_field') #2015-10-19 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 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 execute:frappe.reload_doc('core', 'doctype', 'error_snapshot') in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_4.reduce_varchar_length in site1.local (1bd3e0294d)
setting length of 'subject' in 'Feed' as 159
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/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 213, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v6_4/reduce_varchar_length.py", line 30, in execute
    "property_type": "Int"
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 822, in make_property_setter
    ps.insert()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 211, in insert
    self.run_post_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 613, in run_post_save_methods
    self.run_method("on_update")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 557, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 713, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 696, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 551, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 55, in on_update
    validate_fields_for_doctype(self.doc_type)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 234, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype, cached=False))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 426, in validate_fields
    check_timeline_field(meta)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 395, in check_timeline_field
    if not meta.timeline_field:
AttributeError: 'Meta' object has no attribute 'timeline_field'

Just updated and it works for me.

@keshav, perhaps you can try again? Maybe it didnt pull the new updates.

thanks @anand

Just tried again , still getting the same error.

frappe-bench$ bench update
Already up-to-date.
From https://github.com/frappe/frappe
 * branch            master     -> FETCH_HEAD
Already up-to-date.
From https://github.com/frappe/shopping_cart
 * branch            master     -> FETCH_HEAD
Already up-to-date.
From https://github.com/frappe/erpnext
 * branch            master     -> FETCH_HEAD
Already up-to-date.
Migrating site1.local
Executing frappe.patches.v6_4.reduce_varchar_length in site1.local (1bd3e0294d)
setting length of 'subject' in 'Feed' as 159
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/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 213, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v6_4/reduce_varchar_length.py", line 30, in execute
    "property_type": "Int"
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 822, in make_property_setter
    ps.insert()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 211, in insert
    self.run_post_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 613, in run_post_save_methods
    self.run_method("on_update")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 557, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 713, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 696, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 551, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 55, in on_update
    validate_fields_for_doctype(self.doc_type)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 234, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype, cached=False))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 426, in validate_fields
    check_timeline_field(meta)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 395, in check_timeline_field
    if not meta.timeline_field:
AttributeError: 'Meta' object has no attribute 'timeline_field'

@anand @bohlian Tried with a clean install of V4 and went ahead to upgrade it to V6, got the error again.

erpnext@tgrnew:~/frappe-bench$ bench switch-to-master --upgrade
Branch master set up to track remote branch master from upstream.
Switched to a new branch 'master'
Already up-to-date.
Checking out files: 100% (3175/3175), done.
Branch master set up to track remote branch master from upstream.
Switched to a new branch 'master'
Already up-to-date.
Branch master set up to track remote branch master from upstream.
Switched to a new branch 'master'
Already up-to-date.
/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Migrating site1.local
Executing frappe.patches.v5_0.convert_to_barracuda_and_utf8mb4 in site1.local (1bd3e0294d)

Success
Executing frappe.patches.v6_1.rename_file_data in site1.local (1bd3e0294d)
Success
Executing execute:frappe.reload_doc('core', 'doctype', 'docfield', force=True) #2015-10-16 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('custom', 'doctype', 'custom_field') #2015-10-19 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 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 execute:frappe.reload_doc('core', 'doctype', 'error_snapshot') in site1.local (1bd3e0294d)
Success
Executing frappe.patches.v6_4.reduce_varchar_length in site1.local (1bd3e0294d)
setting length of 'subject' in 'Feed' as 159
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/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/commands.py", line 213, in migrate
    frappe.modules.patch_handler.run_all()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 25, in run_all
    if not run_single(patchmodule = patch):
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/patches/v6_4/reduce_varchar_length.py", line 30, in execute
    "property_type": "Int"
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/__init__.py", line 822, in make_property_setter
    ps.insert()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 211, in insert
    self.run_post_save_methods()
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 613, in run_post_save_methods
    self.run_method("on_update")
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 557, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 713, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 696, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/model/document.py", line 551, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py", line 55, in on_update
    validate_fields_for_doctype(self.doc_type)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 234, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype, cached=False))
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 426, in validate_fields
    check_timeline_field(meta)
  File "/home/erpnext/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py", line 395, in check_timeline_field
    if not meta.timeline_field:
AttributeError: 'Meta' object has no attribute 'timeline_field'
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/erpnext/bench-repo/bench/cli.py", line 56, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/cli.py", line 297, in _switch_to_master
    switch_to_master(upgrade=upgrade)
  File "/home/erpnext/bench-repo/bench/app.py", line 171, in switch_to_master
    switch_branch('master', apps=apps, bench=bench, upgrade=upgrade)
  File "/home/erpnext/bench-repo/bench/app.py", line 166, in switch_branch
    patch_sites()
  File "/home/erpnext/bench-repo/bench/utils.py", line 129, in patch_sites
    raise PatchError
bench.utils.PatchError

Just tried to upgrade V5 to V6 today and got the same error with @keshav

Any update for this issue, please?

@anand

This is the log. Appreciate your help.

Executing frappe.patches.v6_4.reduce_varchar_length in site1.local (1bd3e0294d)
setting length of ‘subject’ in ‘Feed’ as 170
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 213, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/frappe/frappe/patches/v6_4/reduce_varchar_length.py”, line 30, in execute
“property_type”: “Int”
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 822, in make_property_setter
ps.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 211, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 620, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 564, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 720, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 703, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 558, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py”, line 55, in on_update
validate_fields_for_doctype(self.doc_type)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 245, in validate_fields_for_doctype
validate_fields(frappe.get_meta(doctype, cached=False))
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 437, in validate_fields
check_timeline_field(meta)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 406, in check_timeline_field
if not meta.timeline_field:
AttributeError: ‘Meta’ object has no attribute ‘timeline_field’
Traceback (most recent call last):
File “/usr/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 60, in cli
bench()
File “/usr/lib/python2.7/site-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/cli.py”, line 241, in _update
update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File “/home/frappe/bench-repo/bench/cli.py”, line 270, in update
patch_sites(bench=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 163, in patch_sites
run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
File “/home/frappe/bench-repo/bench/utils.py”, line 496, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

This was fixed. Can you run the update again.

Hi @anand

Thank you for your reply. I was able to update from d2ca264 to a070e21 and the issue seems to be resolved.

However, I got another issue. The error message was ‘frappe.exceptions.ValidationError: ‘In List View’ not allowed for type Image in row 12’

I found this post Update Error v5
and run ‘bench --force reload-doc stock doctype item’ which executed successfully.

Then I run ‘bench update --upgrade’ again, a new error message pops up and says following (I will post separately.)

I was unable to find any post relating to this error, so I would like to kindly ask your support again.

INFO:bench.utils:setting up sudoers
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe

  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From https://github.com/frappe/erpnext
  • branch master -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling shopping_cart
    From https://github.com/frappe/shopping-cart
  • branch master -> FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Migrating site1.local
    Executing frappe.patches.v6_4.reduce_varchar_length in site1.local (1bd3e0294d)
    setting length of ‘manufacturer_part_no’ in ‘Item’ as 161
    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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
    ret = f(frappe.dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 213, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/patches/v6_4/reduce_varchar_length.py”, line 30, in execute
    “property_type”: “Int”
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 822, in make_property_setter
    ps.insert()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 211, in insert
    self.run_post_save_methods()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 622, in run_post_save_methods
    self.run_method(“on_update”)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 566, in run_method
    return Document.hook(fn)(self, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 722, in composer
    return composed(self, method, *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 705, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 560, in
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/custom/doctype/property_setter/property_setter.py”, line 55, in on_update
    validate_fields_for_doctype(self.doc_type)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 245, in validate_fields_for_doctype
    validate_fields(frappe.get_meta(doctype, cached=False))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 427, in validate_fields
    check_link_table_options(d)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 287, in check_link_table_options
    frappe.throw(
    (“Options must be a valid DocType for field {0} in row {1}”).format(d.label, d.idx))
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 265, in throw
    msgprint(msg, raise_exception=exc)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 258, in msgprint
    _raise_exception()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 243, in _raise_exception
    raise raise_exception, encode(msg)
    frappe.exceptions.ValidationError: Options must be a valid DocType for field Attributes in row 34
    Traceback (most recent call last):
    File “/usr/bin/bench”, line 9, in
    load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 60, in cli
    bench()
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 610, in call
    return self.main(*args, **kwargs)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 590, in main
    rv = self.invoke(ctx)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 936, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 782, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 416, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/bench-repo/bench/cli.py”, line 241, in _update
    update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
    File “/home/frappe/bench-repo/bench/cli.py”, line 270, in update
    patch_sites(bench=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 163, in patch_sites
    run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/frappe/bench-repo/bench/utils.py”, line 496, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)

Updating the Python environment by the following command seemed to do a trick.

(Go to frappe-bench folder and run) ./env/bin/pip install --upgrade celery

Thank you, anand.

Executing erpnext.patches.v5_1.fix_credit_days_based_on in massimohair-erp.nextaction.co (aabeb9611f)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 700, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 680, in main
rv = self.invoke(ctx)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 508, in invoke
return callback(*args, **kwargs)
File “/home/frappe/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/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands.py”, line 205, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 25, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 52, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 68, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v5_1/fix_credit_days_based_on.py”, line 7, in execute
frappe.reload_doctype(dt, force=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 578, in reload_doctype
reload_doc(scrub(db.get_value(“DocType”, doctype, “module”)), “doctype”, scrub(doctype), force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 590, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/init.py”, line 37, in reload_doc
return import_files(module, dt, dn, force=force)
File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, line 122, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 211, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 635, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 579, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 735, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 718, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 573, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 126, in on_update
make_module_and_roles(self)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 570, in make_module_and_roles
r.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 193, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 617, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 579, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 735, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 718, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 573, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/role/role.py”, line 22, in validate
if self.disabled:
AttributeError: ‘Role’ object has no attribute ‘disabled’
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.92’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
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/frappe/bench-repo/bench/commands/update.py”, line 61, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 91, in _update
patch_sites(bench=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 132, in patch_sites
run_frappe_cmd(’–site’, ‘all’, ‘migrate’, bench=bench)
File “/home/frappe/bench-repo/bench/utils.py”, line 491, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (’–site’, ‘all’, ‘migrate’)