Error while trying to create backup


I’m getting the following error while trying to create a backup. Please assist

`ubuntu@ip-172-31-1-158:~/erpnext$ bench backup-all-sites
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/erpnext/bench-repo/bench/", line 40, in cli
  File "/usr/local/lib/python2.7/dist-packages/click/", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 1024, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/erpnext/bench-repo/bench/commands/", line 13, in bench_command
  File "/home/erpnext/bench-repo/bench/", line 208, in setup_logging
    hdlr = logging.FileHandler(log_file)
  File "/usr/lib/python2.7/logging/", line 903, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/", line 928, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/home/erpnext/frappe-bench/logs/bench.log'

seems like problem with permissions. did you install or update as root? check folders ownership and fix them

‎Hi @ganas

Could you help with exact steps to accomplish that please?

Kind Regards,

to see the owners of frappe and bench folder ownership in your home folder where frappe and bench folders are use
ls -l
if the ownership is for frappe user then u can just delete the bench.log file, and it should work.

if frappe user is not the owner, then you can change ownership using
chown -R frappe:frappe frappe-bench

1 Like

The ownership is for ubuntu user which is what was also used for installation. Output from the home folder is below:

ubuntu@ip-172-31-1-158:~$ ls -l
total 16
drwxrwxr-x 6 ubuntu ubuntu 4096 Nov  3  2015 erpnext

Output from erpnext folder is below:

ubuntu@ip-172-31-1-158:~/erpnext$ ls -l
total 16
drwxrwxr-x 5 ubuntu ubuntu 4096 Nov  3  2015 bench-repo
drwxrwxr-x 2 ubuntu ubuntu 4096 Nov  3  2015 bin
drwxrwxr-x 3 ubuntu ubuntu 4096 Nov  3  2015 lib
drwxrwxr-x 2 ubuntu ubuntu 4096 Nov  3  2015 local

Does user still need to be changed?

Also, the frappe-bench folder doesn’t seem to be visible. Not sure why that is

@vjFaLk @ganas any ideas please?

Many thanks