Bench update after fresh installation error

I did a fresh install using

Linux: 
wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh

sudo bash setup_frappe.sh --setup-production

after install I tried to bench update. I got this error.

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==3.0.0', 'console_scripts', 'bench')()
  File "/home/deploy/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/deploy/bench-repo/bench/commands/update.py", line 31, in update
    version_upgrade = is_version_upgrade()
  File "/home/deploy/bench-repo/bench/app.py", line 102, in is_version_upgrade
    upstream_version = get_upstream_version('frappe', bench=bench, branch=branch)
  File "/home/deploy/bench-repo/bench/app.py", line 144, in get_upstream_version
    contents = subprocess.check_output(['git', 'show', 'upstream/{branch}:{app}/__init__.py'.format(branch=branch)], cwd=repo_dir, stderr=subprocess.STDOUT, app=app)
KeyError: 'app'

Any idea?

1 Like

Fixed. Can you update again?

If it still doesn’t work, go to /home/deploy/bench-repo and do a git pull first before running bench update again.

1 Like

@anand its now working. thanks!