Bench update error 08 March 2016

hi there just wanted to update
and had the following error

frappe@erp:~$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
Von 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
    Von 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 deploy.local
    Executing erpnext.patches.v7_0.update_party_status in deploy.local (19a8bfb343)
    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 716, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/frappe/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/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 218, 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/v7_0/update_party_status.py”, line 7, in execute
    doc.update_status()
    AttributeError: ‘Customer’ object has no attribute ‘update_status’
    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 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/frappe/bench-repo/bench/commands/update.py”, line 60, 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 90, in _update
    patch_sites(bench=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 131, in patch_sites
    run_frappe_cmd(‘–site’, ‘all’, ‘migrate’, bench=bench)
    File “/home/frappe/bench-repo/bench/utils.py”, line 454, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (‘–site’, ‘all’, ‘migrate’)

what to do

@spa Follow this thread for solution: [Important] Bench version 2 - see this before you run bench update

hi @yashodhan

thanks so far … now it throws …

frappe@erp:~$ sudo pip uninstall bench
Can’t uninstall ‘bench’. No files were found to uninstall.
You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

so I went…

frappe@erp:~$ pip install --upgrade pip
Collecting pip
Using cached pip-8.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Exception:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/pip/basecommand.py”, line 211, in main
status = self.run(options, args)
File “/usr/local/lib/python2.7/dist-packages/pip/commands/install.py”, line 311, in run
root=options.root_path,
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py”, line 640, in install
requirement.uninstall(auto_confirm=True)
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py”, line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_uninstall.py”, line 125, in remove
renames(path, new_path)
File “/usr/local/lib/python2.7/dist-packages/pip/utils/init.py”, line 315, in renames
shutil.move(old, new)
File “/usr/lib/python2.7/shutil.py”, line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: ‘/usr/bin/pip’
You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

I thought I do pip later and continue

rebooted tried to log in and…

Traceback (innermost last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 25, in render
data = render_page_by_language(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 91, in render_page_by_language
return render_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 107, in render_page
return build(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 114, in build
return build_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 127, in build_page
context = get_context(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 16, in get_context
context = build_context(context)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/context.py”, line 58, in build_context
ret = module.get_context(context)
File “/home/frappe/frappe-bench/apps/frappe/frappe/templates/pages/desk.py”, line 21, in get_context
boot = frappe.sessions.get()
File “/home/frappe/frappe-bench/apps/frappe/frappe/sessions.py”, line 107, in get
bootinfo[“notification_info”] = get_notification_info_for_boot()
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 132, in get_notification_info_for_boot
out = get_notifications()
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 25, in get_notifications
“open_count_doctype”: get_notifications_for_doctypes(config, notification_count),
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/notifications.py”, line 91, in get_notifications_for_doctypes
filters=condition, limit_page_length = 21, as_list=True))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 958, in get_list
return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 66, in execute
result = self.build_and_run()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/db_query.py”, line 83, in build_and_run
return frappe.db.sql(query, as_dict=not self.as_list, debug=self.debug)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 147, in sql
self._cursor.execute(query)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (1054, “Unknown column ‘tabSupplier.status’ in ‘where clause’”)

forgot to say bench is 2.0 now as stated by installer

You are following some wrong or outdated installation instructions.

when you are doing pip install --upgrade pip it should be done inside the virtual environment.

$ cd /home/frappe/frappe-bench/
$ source ./env/bin/activate
$ pip install --upgrade pip

Why you tried to delete your bench? tough it won’t work like that.
are you running ERPNext in production mode?

thanks for putting up with me … but

frappe@erp:~$ cd /home/frappe/frappe-bench/
frappe@erp:~/frappe-bench$ source ./home/frappe/frappe-bench/env/bin/activate
-bash: ./home/frappe/frappe-bench/env/bin/activate: Datei oder Verzeichnis nicht gefunden
frappe@erp:~/frappe-bench$ pip install --upgrade pip
Collecting pip
Using cached pip-8.1.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Exception:
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/pip/basecommand.py”, line 211, in main
status = self.run(options, args)
File “/usr/local/lib/python2.7/dist-packages/pip/commands/install.py”, line 311, in run
root=options.root_path,
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py”, line 640, in install
requirement.uninstall(auto_confirm=True)
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py”, line 716, in uninstall
paths_to_remove.remove(auto_confirm)
File “/usr/local/lib/python2.7/dist-packages/pip/req/req_uninstall.py”, line 125, in remove
renames(path, new_path)
File “/usr/local/lib/python2.7/dist-packages/pip/utils/init.py”, line 315, in renames
shutil.move(old, new)
File “/usr/lib/python2.7/shutil.py”, line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: ‘/usr/bin/pip’
You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

got…

sudoed the pip install comand

thanks

but still cant get to Desk and bench update still throws the error

cd /home/frappe/frappe-bench/
./env/bin/pip install --upgrade pip

It seems you have messed up permissions.
chmod 755 to frappe directory under /home and check if you frappe user does have sudo permission.

no permission issues… bench got stuck in Update
displayed according message after restart… bench update
and the suggestion of @anand fixed it…

cheers

P.S. this can be closed now, thanks