Error on Bench Update - tuple has not attribute __name__

Getting the following error on bench update:

mode change 100644 => 100755 bench/commands/__init__.py
 mode change 100644 => 100755 bench/commands/make.py
 mode change 100644 => 100755 bench/commands/update.py
 create mode 100755 bench/config/lets_encrypt.py
 mode change 100644 => 100755 bench/config/procfile.py
 mode change 100644 => 100755 bench/config/production_setup.py
 create mode 100644 bench/config/site_config.py
 create mode 100644 bench/config/templates/502.html
 create mode 100755 bench/config/templates/letsencrypt.cfg
 create mode 100644 bench/patches/v4/__init__.py
 create mode 100644 bench/patches/v4/update_node.py
 mode change 100644 => 100755 bench/tests/test_init.py
 mode change 100644 => 100755 bench/utils.py
 create mode 100644 playbooks/develop/create_user.yml
 create mode 100644 playbooks/develop/includes/setup_dev_env.yml
 create mode 100644 playbooks/develop/includes/setup_selinux_policy.yml
 mode change 100644 => 100755 playbooks/install.py
 create mode 100644 playbooks/production/includes/setup_bench_production.yml
 create mode 100644 playbooks/production/includes/setup_prod_env.yml
 create mode 100644 playbooks/production/install.yml
 create mode 100644 playbooks/production/templates/default_nginx.j2
 create mode 100644 playbooks/production/templates/frappe_selinux.te
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/home/test/bench-repo/bench/cli.py", line 6, in <module>
    from bench.commands import bench_command
  File "/home/test/bench-repo/bench/commands/__init__.py", line 66, in <module>
    from bench.commands.config import config
  File "/home/test/bench-repo/bench/commands/config.py", line 67, in <module>
    @click.option('configs', '-c', '--config', multiple=True, type=(unicode, unicode))
  File "/usr/local/lib/python2.7/dist-packages/click/decorators.py", line 159, in decorator
    _param_memo(f, Option(param_decls, **attrs))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1308, in __init__
    Parameter.__init__(self, param_decls, type=type, **attrs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1132, in __init__
    self.type = convert_type(type, default)
  File "/usr/local/lib/python2.7/dist-packages/click/types.py", line 431, in convert_type
    return FuncParamType(ty)
  File "/usr/local/lib/python2.7/dist-packages/click/types.py", line 73, in __init__
    self.name = func.__name__
AttributeError: 'tuple' object has no attribute '__name__'

Did you try running it again?

@anand yeap several times, same error

Try running

sudo pip install --upgrade click

And then update

@anand now it prompts the following error:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.1', 'console_scripts', 'bench')()
  File "/home/test/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/test/bench-repo/bench/commands/update.py", line 30, in update
    patches.run(bench_path='.')
  File "/home/test/bench-repo/bench/patches/__init__.py", line 21, in run
    result = execute(bench_path)
  File "/home/test/bench-repo/bench/patches/v4/update_node.py", line 7, in execute
    result = subprocess.check_output(['node', '-v'])
  File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory 

so strange, why is it trying to execute a v4 script?

Anyone has any idea why this is happening?

Hi @bohlian,

the v4 is because it is bench version 4

solution can be found here:

I updated to nodejs 6.x

@spa thanks, that gave me a hint, had to do that then also run bench update --patch