Update fails on missing attribute

Hi

I’m trying to update my erpnext system - development branch. I had a fail on the erpnext.patches.v7_1.update_portal_roles phase. I commented the line out in the patches.txt file and it ran through fine. When I uncomment the line, it still complains about a missing attribute (below). I tried starting up the system to see if I could add the attribute myself but I get a screen saying it’s still busy updating. Any solutions?

`kevinm@mincopy-home:~/business/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • branch develop → FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP)
  • branch develop → FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Migrating site1.local
    Executing erpnext.patches.v7_1.update_portal_roles in site1.local (1bd3e0294d)
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 174, 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/kevinm/business/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/kevinm/business/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/kevinm/business/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/kevinm/business/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/kevinm/business/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/kevinm/business/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/kevinm/business/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/kevinm/business/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/kevinm/business/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/kevinm/business/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/kevinm/business/frappe-bench/apps/frappe/frappe/commands/site.py”, line 209, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/kevinm/business/frappe-bench/apps/frappe/frappe/migrate.py”, line 30, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/kevinm/business/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 29, in run_all
    if not run_single(patchmodule = patch):
    File “/home/kevinm/business/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 63, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/kevinm/business/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 83, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/kevinm/business/frappe-bench/apps/erpnext/erpnext/patches/v7_1/update_portal_roles.py”, line 16, in execute
    user.set_default_roles()
    AttributeError: ‘User’ object has no attribute ‘set_default_roles’

`

I resolved this problem by switching to master branch, attempting a “branch update --patch” (which fails with another missing attribute), switching back to development branch, and running a “branch update --patch” (which now works). That worked, I can log in, and I get a latest features message for version 7.2.11.