Updating ERPNext - bench update as root or frappe user?


I followed the below mentioned steps and installed the ERPNext on a 16.04LTS Ubuntu OS, On a VPS with 8GB RAM KVM with 1TB Space and 100MBPS Unmetered Port.

Steps followed for installation are as follows.

Fresh Installation, Nothing Else was done apart from following the below mentioned steps not even firewalls, or SSH safety configs were performed.

1 - sudo su
2 - sudo apt-get update && sudo apt-get dist-upgrade
3 - sudo apt-get install python-minimal
4 - wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
5 - sudo python install.py --production --user frappe [Setup a password for Admin and user frappe]
6 - Logged in with the Administrator Password in the browser and completed some steps and basically started using ERPNext.

Now based on what I have read in the forums and git i need to use “bench update” and ideally It should update it, I am in the right direction?

Do I need to use bench update as root or user frappe?

Vimal Tank

Use FRAPPE user for all BENCH commands.
cd /home/frappe/frappe-bench and then next su frappe

hey Florea, Thanks for helping,

I tried what you mentioned, I faced the below mentioned error.

frappe@portal:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
remote: Counting objects: 4002, done.
remote: Compressing objects: 100% (1393/1393), done.
remote: Total 4002 (delta 2675), reused 3864 (delta 2544), pack-reused 0
Receiving objects: 100% (4002/4002), 22.18 MiB | 11.97 MiB/s, done.
Resolving deltas: 100% (2675/2675), completed with 82 local objects.
From GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
4e896b5…76aff28 master → origin/master

  • [new tag] 4.1 → 4.1
  • [new tag] v0.9 → v0.9
  • [new tag] v0.91 → v0.91
  • [new tag] v0.92 → v0.92
  • [new tag] v0.93 → v0.93
  • [new tag] v1.0 → v1.0
  • [new tag] v2.0 → v2.0
  • [new tag] v2.1 → v2.1
  • [new tag] v3.0 → v3.0
  • [new tag] v3.1 → v3.1
  • [new tag] v4.0 → v4.0
    Updating 4e896b5…76aff28
    error: Your local changes to the following files would be overwritten by merge:
    Please, commit your changes or stash them before you can merge.
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 11, in
    load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/.bench/bench/cli.py”, line 40, in cli
    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
    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

What am I possibly doing incorrectly?

Thanks again.
-Vimal Tank

Solution of @kolate_sambhaji in the link V10 Upgrade Steps for Novice - #9 by kolate_sambhaji worked for me.

Thank You,
Vimal Tank