Problem with bench update

hi
I ahve bench updated my server recently and it run very ok but there was a warning informing me to updated my yarn to 1.6.0 and upgraded as instructed but trying to run bench update am seeing the problems…

the comman is as below;-

success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is “1.6.0”, while you’re on “1.5.1”.
info To upgrade, run the following command:
$ curl -o- -L https://yarnpkg.com/install.sh | bash
Done in 15.49s.
Backing up sites…
Patching sites…
Migrating site1.local
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Syncing help database…

> frappe@ production /home/frappe/frappe-bench/apps/frappe
> FRAPPE_ENV=production node rollup/build.js

Production mode
:heavy_check_mark: Built js/libs.min.js

Building frappe assets…

:heavy_check_mark: Built js/print_format_v3.min.js
:heavy_check_mark: Built css/module.min.css
:heavy_check_mark: Built frappe/css/email.css
:heavy_check_mark: Built css/form.min.css
:heavy_check_mark: Built js/web_form.min.js
:heavy_check_mark: Built js/dialog.min.js
:heavy_check_mark: Built css/frappe-rtl.css
:heavy_check_mark: Built css/web_form.css
:heavy_check_mark: Built css/report.min.css
:heavy_check_mark: Built js/frappe-web.min.js
:heavy_check_mark: Built css/list.min.css
:heavy_check_mark: Built css/frappe-web.css
:heavy_check_mark: Built js/report.min.js
:heavy_check_mark: Built js/form.min.js
:heavy_check_mark: Built js/list.min.js
:heavy_check_mark: Built js/control.min.js
:heavy_check_mark: Built js/desk.min.js
:heavy_check_mark: Built css/desk.min.css
:sparkles: Done in 44.022s

Building erpnext assets…

:heavy_check_mark: Built js/erpnext-web.min.js
:heavy_check_mark: Built js/item-dashboard.min.js
:heavy_check_mark: Built css/erpnext.css
:heavy_check_mark: Built js/erpnext.min.js
:sparkles: Done in 1.991s
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started


Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()
root@vultr:/home/frappe/frappe-bench# ^C
root@vultr:/home/frappe/frappe-bench# curl -o- -L https://yarnpkg.com/install.sh | bash
_ % Total % Received % Xferd Average Speed Time Time Time Current_
_ Dload Upload Total Spent Left Speed_
100 7041 0 7041 0 0 32825 0 --:–:-- --:–:-- --:–:-- 32748
Installing Yarn!
> Downloading tarball…

[1/2]: https://yarnpkg.com/latest.tar.gz → /tmp/yarn.tar.gz.s4LFyKiXzm
_ % Total % Received % Xferd Average Speed Time Time Time Current_
_ Dload Upload Total Spent Left Speed_
100 91 100 91 0 0 452 0 --:–:-- --:–:-- --:–:-- 455
100 608 0 608 0 0 392 0 --:–:-- 0:00:01 --:–:-- 2040
100 919k 100 919k 0 0 50145 0 0:00:18 0:00:18 --:–:-- 79272

[2/2]: https://yarnpkg.com/latest.tar.gz.asc → /tmp/yarn.tar.gz.s4LFyKiXzm.asc
100 95 100 95 0 0 7949 0 --:–:-- --:–:-- --:–:-- 7949
100 612 0 612 0 0 1968 0 --:–:-- --:–:-- --:–:-- 597k
100 832 100 832 0 0 1516 0 --:–:-- --:–:-- --:–:-- 1516
> Verifying integrity…
gpg: keyring `/root/.gnupg/secring.gpg’ created
gpg: key 86E50310: public key “Yarn Packaging yarn@dan.cx” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
gpg: Signature made Wed 11 Apr 2018 05:30:18 PM UTC using RSA key ID B6FF4DE3
gpg: Good signature from “Yarn Packaging yarn@dan.cx
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
_ Subkey fingerprint: E219 30C4 D0A4 AA46 1858 1F7A E074 D16E B6FF 4DE3_
> GPG signature looks good
> Extracting to ~/.yarn…
> Adding to $PATH…
> We’ve added the following to your /root/.bashrc
> If this isn’t the profile of your current shell then please add the following to your correct profile:

export PATH=“$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH”

> Successfully installed Yarn 1.6.0! Please open another terminal where the yarn command will now be available.
root@vultr:/home/frappe/frappe-bench# bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

Cannot proceed with update: You have local changes in app “frappe” that are not committed.

Here are your choices:

1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
1. Temporarily remove your changes with “git stash” or discard them completely
_ with “bench update --reset” or for individual repositries “git reset --hard”_
2. If your changes are helpful for others, send in a pull request via GitHub and
_ wait for them to be merged in the core._
root@vultr:/home/frappe/frappe-bench# git pull
fatal: Not a git repository (or any of the parent directories): .git
root@vultr:/home/frappe/frappe-bench# git pull
fatal: Not a git repository (or any of the parent directories): .git
root@vultr:/home/frappe/frappe-bench# git pull
fatal: Not a git repository (or any of the parent directories): .git
root@vultr:/home/frappe/frappe-bench# bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up-to-date.
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

Cannot proceed with update: You have local changes in app “frappe” that are not committed.

Here are your choices:

1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
1. Temporarily remove your changes with “git stash” or discard them completely
_ with “bench update --reset” or for individual repositries “git reset --hard”_
2. If your changes are helpful for others, send in a pull request via GitHub and
_ wait for them to be merged in the core._
root@vultr:/home/frappe/frappe-bench#

Try these commands:

sudo chown -R ubuntu /home/frappe/.bench
sudo chown -R ubuntu /home/frappe/frappe-bench
cd /home/frappe/.bench
git reset --hard
git pull
cd /home/frappe/frappe-bench
bench update

thank you,
it tried this but the first line response was as bellow

root@vultr:/home/frappe/frappe-bench# sudo chown -R ubuntu /home/frappe/.bench
chown: invalid user: ‘ubuntu’
root@vultr:/home/frappe/frappe-bench#

Oh sorry.

sudo chown means change ownership to Ubuntu which is a user. You don’t have the user.

and you are trying from root user.

i did as you guided as below…

root@vultr:/home/frappe/frappe-bench# sudo chown -R root /home/frappe/.bench
root@vultr:/home/frappe/frappe-bench# sudo chown -R root /home/frappe/frappe-bench
root@vultr:/home/frappe/frappe-bench# cd /home/frappe/.bench
root@vultr:/home/frappe/.bench# git reset --hard
HEAD is now at dd7d24b Merge pull request #648 from tundebabzy/no-procfile
root@vultr:/home/frappe/.bench# git pull
Already up-to-date.
root@vultr:/home/frappe/.bench# cd /home/frappe/frappe-bench
root@vultr:/home/frappe/frappe-bench# bench update
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
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 1063, in invoke
Command.invoke(self, 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/init.py”, line 31, in bench_command
setup_logging(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 293, in setup_logging
hdlr = logging.FileHandler(log_file)
File “/usr/lib/python2.7/logging/init.py”, line 913, in init
StreamHandler.init(self, self._open())
File “/usr/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/logs/bench.log’

and run into an error…

kindly help

IOError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/logs/bench.log

Can you try changing ownership for this file also?

i did it as below and still leading into an error.

root@vultr:/home/frappe/frappe-bench# yarn --version
1.6.0
root@vultr:/home/frappe/frappe-bench# sudo chown -R root /home/frappe/.bench
root@vultr:/home/frappe/frappe-bench# sudo chown -R root /home/frappe/frappe-bench
root@vultr:/home/frappe/frappe-bench# sudo chown -R root /home/frappe/frappe-bench/logs/bench.log
root@vultr:/home/frappe/frappe-bench# cd /home/frappe/.bench
root@vultr:/home/frappe/.bench# git reset --hard
HEAD is now at dd7d24b Merge pull request #648 from tundebabzy/no-procfile
root@vultr:/home/frappe/.bench# git pull
Already up-to-date.
root@vultr:/home/frappe/.bench# cd /home/frappe/frappe-bench
root@vultr:/home/frappe/frappe-bench# bench update
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
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 1063, in invoke
Command.invoke(self, 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/init.py”, line 31, in bench_command
setup_logging(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 293, in setup_logging
hdlr = logging.FileHandler(log_file)
File “/usr/lib/python2.7/logging/init.py”, line 913, in init
StreamHandler.init(self, self._open())
File “/usr/lib/python2.7/logging/init.py”, line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/home/frappe/frappe-bench/logs/bench.log’
root@vultr:/home/frappe/frappe-bench#

Sorry, I don’t think I should give you anymore advice. I face this type of issues and those commands helped me; but I am not any expert.

I hope someone who knows what’s the actual issue here will help you out.

Sorry again.

thank you for your assistance but am thinking maybe i should vultr instead of root as the user/ubuntu or am i doing it right?

Well, using root user is not really encouraged. I think you should use another user with sudo privileges.But I don’t think the issue is with user here.

maybe you can try “bench update --reset”?

i did that but as I learnt that bench update–reset will not totally solve the issue…

I tried it and it worked but as I try bench update again I run into the same error

Once again, an expert should comment here. :slight_smile:

1 Like

I managed to solve this by using the below.

$ cd /home/frappe/frappe-bench
$ sudo chown -R frappe:frappe *

then

bench update --reset