Error in updating ERPNext to 7.1

Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 79, in
main()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 664, in call
return self.main(*args, **kwargs)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 644, in main
rv = self.invoke(ctx)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 991, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 837, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/co re.py”, line 464, in invoke
return callback(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe.dict(ctx.obj), *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209 , in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in mi grate
frappe.modules.patch_handler.run_all()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
if not run_single(patchmodule = patch):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File "/home/ubuntu/frappe-bench/apps/frappe/frappe/patches/v7_1/sync_language
doctype.py", line 5, in execute
frappe.reload_doc(‘core’, ‘doctype’, ‘language’)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 645, in reload_doc
return frappe.modules.reload_doc(module, dt, dn, force=force)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 141 , in reload_doc
return import_files(module, dt, dn, force=force)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 17, in import_files
return import_file(module, dt, dn, force=force, pre_process=pre_process)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 22, in import_file
ret = import_file_by_path(path, force, pre_process=pre_process)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 54, in import_file_by_path
import_doc(doc, force=force, data_import=data_import, pre_process=pre_proces s)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 122, in import_doc
doc.insert()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 22 2, in insert
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 77 1, in run_post_save_methods
self.run_method(“on_update”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 65 4, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 88 2, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 86 5, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 64 8, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctyp e.py”, line 142, in on_update
updatedb(self.name, self)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 6 9, in updatedb
tab.sync()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 1 46, in sync
self.create()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 1 81, in create
engine=self.meta.engine or ‘InnoDB’) % (self.name, add_text))
AttributeError: ‘DocType’ object has no attribute ‘engine’

Anyway just to add on, i’ve seen many other posts saying that the error works after rebooting or by running bench update again. Yes, I’ve tried those and it does work but we host nearly 100 sites!! I can’t be running bench update for a 100 times right? :smiley:

Hi

I have got the same error and below commands worked for me

bench migrate
bench update --patch
bench update

+1

I have to admin being culpable of not knowing exactly whether my error was the same as the one this topic started with. Also I had to run the final bench update twice though

o, yes and all that work only from inside /home/frappe/frappe-bench (or wherever the frappe-bench folder might be on your system)

Try updating Ubuntu and then rebooting before trying to update frappe.
@Justin_Lu…100 instances of ERPNext ??? Noah thats a few :slight_smile: Are you running them in production mode? This way the will auto restart. HTH

Yes the above commands do fix it but the problem is I have to keep running bench update (around 2 times per site) to let the update go through. It shouldn’t be that way at all! There should be a fix to this right? How can the fix be to run the bench update twice and miraculously fix it.

@System19 yes, all are running in production mode but still everytime i run bench update it has problem, and i have to keep restarting the bench update to update each site manually.

@Justin_Lu so how would you normally update your 100 sites?
Sorry can you describe in more detail as to how you have these sites set up… Are they under one domain? etc etc

even though it’s true what you say (that it probably shouldn’t be that way) …

being practical: can’t you just write a script that does it for you?

Some kind of bash script would speed up this process… Thats why I was wondering how @Justin_Lu currently updates that many installs.