Bench update raises error - git pull error no local changes

Running bench update raises error:

INFO:bench.utils:updating bench
INFO:bench.utils:git pull
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 34 (delta 25), reused 24 (delta 17), pack-reused 0
Unpacking objects: 100% (34/34), done.
From https://github.com/frappe/bench
   76aff28..9322cfd  master     -> origin/master
Updating 76aff28..9322cfd
error: Your local changes to the following files would be overwritten by merge:
        .travis.yml
        playbooks/prerequisites/roles/mariadb/defaults/main.yml
        playbooks/prerequisites/roles/mariadb/tasks/debian.yml
        playbooks/prerequisites/roles/mariadb/tasks/ubuntu.yml
        playbooks/prerequisites/roles/mariadb/templates/mariadb_centos.repo.j2
        playbooks/prerequisites/roles/mariadb/templates/mariadb_ubuntu.list.j2
Please, commit your changes or stash them before you can merge.
Aborting
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __ca                                                                                                                                                             ll__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in inv                                                                                                                                                             oke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invo                                                                                                                                                             ke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invo                                                                                                                                                             ke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 34, in update
    update_bench()
  File "/home/frappe/.bench/bench/utils.py", line 256, in update_bench
    exec_cmd("git pull", cwd=cwd)
  File "/home/frappe/.bench/bench/utils.py", line 140, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

ENV:
OS: Debian GNU/Linux 8.10 (jessie)
Inst. instruction: sudo python install.py --production
ERPNext: v10.0.6 (master)
Frappe Framework: v10.0.7 (master)
Using LDAP login.

git status in /home/frappe/.bench (with no manual/direct file intervention/editing):

    modified:   .gitignore
    modified:   .travis.yml
    modified:   LICENSE.md
    modified:   MANIFEST.in
    modified:   bench/__init__.py
    modified:   bench/commands/config.py
    modified:   bench/commands/git.py
    modified:   bench/commands/install.py
    modified:   bench/commands/utils.py
    modified:   bench/config/__init__.py
    modified:   bench/config/common_site_config.py
    modified:   bench/config/nginx.py
    modified:   bench/config/redis.py
    modified:   bench/config/site_config.py
    modified:   bench/config/supervisor.py
    modified:   bench/config/templates/502.html
    modified:   bench/config/templates/Procfile
    modified:   bench/config/templates/frappe_sudoers
    modified:   bench/config/templates/nginx.conf
    modified:   bench/config/templates/nginx_default.conf
    modified:   bench/config/templates/redis_cache.conf
    modified:   bench/config/templates/redis_queue.conf
    modified:   bench/config/templates/redis_socketio.conf
    modified:   bench/config/templates/supervisor.conf
    modified:   bench/package.json
    modified:   bench/patches/__init__.py
    modified:   bench/patches/patches.txt
    modified:   bench/patches/v3/__init__.py
    modified:   bench/patches/v3/celery_to_rq.py
    modified:   bench/patches/v3/deprecate_old_config.py
    modified:   bench/patches/v3/redis_bind_ip.py
    modified:   bench/patches/v4/__init__.py
    modified:   bench/patches/v4/update_node.py
    modified:   bench/patches/v4/update_socketio.py
    modified:   bench/tests/__init__.py
    modified:   bench/tests/test_setup_production.py
    modified:   completion.sh
    modified:   docs/branch_details.md
    modified:   docs/contribution_guidelines.md
    modified:   docs/release_policy.md
    modified:   docs/releasing_frappe_erpext.md
    modified:   install_scripts/contrib-apps.json
    modified:   install_scripts/erpnext-apps-master.json
    modified:   install_scripts/erpnext-apps.json
    modified:   playbooks/__init__.py
    modified:   playbooks/develop/includes/setup_bench.yml
    modified:   playbooks/develop/includes/setup_dev_env.yml
    modified:   playbooks/develop/includes/setup_erpnext.yml
    modified:   playbooks/develop/includes/setup_selinux_policy.yml
    modified:   playbooks/develop/install.yml
    modified:   playbooks/develop/macosx.yml
    modified:   playbooks/develop/templates/mariadb_centos.repo
    modified:   playbooks/prerequisites/debian.yml
    modified:   playbooks/prerequisites/files/debian_mariadb_config.cnf
    modified:   playbooks/prerequisites/files/mariadb_config.cnf
    modified:   playbooks/prerequisites/files/nginx.conf
    modified:   playbooks/prerequisites/install_prerequisites.yml
    modified:   playbooks/prerequisites/install_roles.yml
    modified:   playbooks/prerequisites/roles/bash_screen_wall/files/screen_wall.sh
    modified:   playbooks/prerequisites/roles/bash_screen_wall/tasks/main.yml
    modified:   playbooks/prerequisites/roles/dns_caching/handlers/main.yml
    modified:   playbooks/prerequisites/roles/dns_caching/tasks/main.yml
    modified:   playbooks/prerequisites/roles/fail2ban/defaults/main.yml
    modified:   playbooks/prerequisites/roles/fail2ban/handlers/main.yml
    modified:   playbooks/prerequisites/roles/fail2ban/tasks/configure_nginx_jail.yml
    modified:   playbooks/prerequisites/roles/fail2ban/tasks/main.yml
    modified:   playbooks/prerequisites/roles/fail2ban/templates/nginx-proxy-filter.conf.j2
    modified:   playbooks/prerequisites/roles/fail2ban/templates/nginx-proxy-jail.conf.j2
    modified:   playbooks/prerequisites/roles/frappe_selinux/files/frappe_selinux.te
    modified:   playbooks/prerequisites/roles/frappe_selinux/tasks/main.yml
    modified:   playbooks/prerequisites/roles/locale/defaults/main.yml
    modified:   playbooks/prerequisites/roles/locale/tasks/main.yml
    modified:   playbooks/prerequisites/roles/logwatch/defaults/main.yml
    modified:   playbooks/prerequisites/roles/logwatch/tasks/main.yml
    modified:   playbooks/prerequisites/roles/logwatch/templates/logwatch.conf.j2
    modified:   playbooks/prerequisites/roles/mariadb/README.md
    modified:   playbooks/prerequisites/roles/mariadb/defaults/main.yml
    modified:   playbooks/prerequisites/roles/mariadb/handlers/main.yml
    modified:   playbooks/prerequisites/roles/mariadb/meta/main.yml
    modified:   playbooks/prerequisites/roles/mariadb/tasks/centos.yml
    modified:   playbooks/prerequisites/roles/mariadb/tasks/debian.yml
    modified:   playbooks/prerequisites/roles/mariadb/tasks/main.yml
    modified:   playbooks/prerequisites/roles/mariadb/tasks/mysql_secure_installation.yml
    modified:   playbooks/prerequisites/roles/mariadb/tasks/ubuntu.yml
    modified:   playbooks/prerequisites/roles/mariadb/templates/mariadb_centos.repo.j2
    modified:   playbooks/prerequisites/roles/mariadb/templates/mariadb_ubuntu.list.j2
    modified:   playbooks/prerequisites/roles/mariadb/templates/my.cnf.j2
    modified:   playbooks/prerequisites/roles/mariadb/vars/main.yml
    modified:   playbooks/prerequisites/roles/nginx/.travis.yml
    modified:   playbooks/prerequisites/roles/nginx/README.md
    modified:   playbooks/prerequisites/roles/nginx/defaults/main.yml
    modified:   playbooks/prerequisites/roles/nginx/handlers/main.yml
    modified:   playbooks/prerequisites/roles/nginx/meta/main.yml
    modified:   playbooks/prerequisites/roles/nginx/tasks/main.yml
    modified:   playbooks/prerequisites/roles/nginx/tasks/setup-Debian.yml
    modified:   playbooks/prerequisites/roles/nginx/tasks/setup-RedHat.yml
    modified:   playbooks/prerequisites/roles/nginx/tasks/vhosts.yml
    modified:   playbooks/prerequisites/roles/nginx/templates/nginx.conf.j2
    modified:   playbooks/prerequisites/roles/nginx/templates/nginx.repo.j2
    modified:   playbooks/prerequisites/roles/nginx/templates/vhosts.j2
    modified:   playbooks/prerequisites/roles/nginx/tests/inventory
    modified:   playbooks/prerequisites/roles/nginx/tests/test.yml
    modified:   playbooks/prerequisites/roles/nginx/vars/Debian.yml
    modified:   playbooks/prerequisites/roles/nginx/vars/RedHat.yml
    modified:   playbooks/prerequisites/roles/nodejs/tasks/main.yml
    modified:   playbooks/prerequisites/roles/ntpd/tasks/main.yml
    modified:   playbooks/prerequisites/roles/psutil/tasks/main.yml
    modified:   playbooks/prerequisites/roles/supervisor/tasks/main.yml
    modified:   playbooks/prerequisites/roles/swap/defaults/main.yml
    modified:   playbooks/prerequisites/roles/swap/tasks/main.yml
    modified:   playbooks/prerequisites/roles/wkhtmltopdf/tasks/main.yml
    modified:   playbooks/prerequisites/setup_essentials.yml
    modified:   playbooks/prerequisites/setup_nginx_proxy_jail.yml
    modified:   playbooks/prerequisites/ubuntu.yml
    modified:   playbooks/production/includes/setup_bench_production.yml
    modified:   playbooks/production/includes/setup_inputrc.yml
    modified:   playbooks/production/install.yml
    modified:   requirements.txt
    modified:   setup.py
    modified:   vm/Readme.md
    modified:   vm/ansible/base.yml
    modified:   vm/ansible/library/bench.py
    modified:   vm/ansible/roles/mariadb/README.md
    modified:   vm/ansible/roles/mariadb/defaults/main.yml
    modified:   vm/ansible/roles/mariadb/handlers/main.yml
    modified:   vm/ansible/roles/mariadb/meta/main.yml
    modified:   vm/ansible/roles/mariadb/tasks/centos.yml
    modified:   vm/ansible/roles/mariadb/tasks/main.yml
    modified:   vm/ansible/roles/mariadb/tasks/mysql_secure_installation.yml
    modified:   vm/ansible/roles/mariadb/tasks/ubuntu.yml
    modified:   vm/ansible/roles/mariadb/templates/mariadb_centos.repo.j2
    modified:   vm/ansible/roles/mariadb/templates/mariadb_ubuntu.list.j2
    modified:   vm/ansible/roles/mariadb/templates/my.cnf.j2
    modified:   vm/ansible/roles/mariadb/vars/main.yml
    modified:   vm/ansible/roles/nginx/.travis.yml
    modified:   vm/ansible/roles/nginx/README.md
    modified:   vm/ansible/roles/nginx/defaults/main.yml
    modified:   vm/ansible/roles/nginx/handlers/main.yml
    modified:   vm/ansible/roles/nginx/meta/main.yml
    modified:   vm/ansible/roles/nginx/tasks/main.yml
    modified:   vm/ansible/roles/nginx/tasks/setup-Debian.yml
    modified:   vm/ansible/roles/nginx/tasks/setup-RedHat.yml
    modified:   vm/ansible/roles/nginx/tasks/vhosts.yml
    modified:   vm/ansible/roles/nginx/templates/nginx.conf.j2
    modified:   vm/ansible/roles/nginx/templates/nginx.repo.j2
    modified:   vm/ansible/roles/nginx/templates/vhosts.j2
    modified:   vm/ansible/roles/nginx/tests/inventory
    modified:   vm/ansible/roles/nginx/tests/test.yml
    modified:   vm/ansible/roles/nginx/vars/Debian.yml
    modified:   vm/ansible/roles/nginx/vars/RedHat.yml
    modified:   vm/ansible/roles/swap/defaults/main.yml
    modified:   vm/ansible/roles/swap/tasks/main.yml
    modified:   vm/ansible/roles/wkhtmltopdf/defaults/main.yml
    modified:   vm/ansible/roles/wkhtmltopdf/tasks/main.yml
    modified:   vm/ansible/templates/mariadb_config.cnf
    modified:   vm/ansible/templates/nginx.conf
    modified:   vm/ansible/vars.yml
    modified:   vm/ansible/vm.yml
    modified:   vm/ansible/vm_vars/all.yml
    modified:   vm/build.py
    modified:   vm/scripts/install_ansible.sh
    modified:   vm/scripts/set_message.sh
    modified:   vm/scripts/zerofree.sh
    modified:   vm/vm.json

Seems your local repository is not clean, you have done some changes to these files.

if changes are required then commit the changes or stash them and then run bench update

From user perspective this is very odd as I haven’t edited any file. I don’t see any way changes to these files were made by other than frappe/erpnext. I’d expect bench update to handle changes made by erpnext/frappe (except maybe if custom/exotic apps/plugins were used, which is not the case).

After committing changes in /home/frappe/.bench and running bench update getting an error:

root@erp:/home/frappe/frappe-bench# git config --global user.email "john@company.com"
root@erp:/home/frappe/frappe-bench# git config --global user.name "John Doe"

root@erp:/home/frappe/frappe-bench# bench update

INFO:bench.utils:updating bench
INFO:bench.utils:git pull

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <frappe@erp.nt>) not allowed
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 34, in update
    update_bench()
  File "/home/frappe/.bench/bench/utils.py", line 256, in update_bench
    exec_cmd("git pull", cwd=cwd)
  File "/home/frappe/.bench/bench/utils.py", line 140, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull

Somehow git doesn’t see git config commands executed as root or frappe.

Restarted server.
Ran bench update --reset.
Issue solved.

Current v.:
ERPNext: v10.0.8 (master)
Frappe Framework: v10.0.9 (master)