OSError: [Errno 2] No such file or directory: './erpnext/private/backups'

i get this error on bench update --patch (an don bench update as well). This is after pulling a new setup from github. Any ideas?

kirthi@erpnext-test:~/frappe/frappe-bench$ bench update --patch
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/kirthi/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 897, in backup
    odb = scheduled_backup(ignore_files=not with_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, backup_path_private_files=backup_path_private_files, force=True)
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py", line 164, in scheduled_backup
    odb = new_backup(older_than, ignore_files, backup_path_db=backup_path_db, backup_path_files=backup_path_files, force=force)
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py", line 168, in new_backup
    delete_temp_backups(older_than = frappe.conf.keep_backups_for_hours or 48)
  File "/home/kirthi/frappe/frappe-bench/apps/frappe/frappe/utils/backups.py", line 181, in delete_temp_backups
    file_list = os.listdir(get_backup_path())
OSError: [Errno 2] No such file or directory: './erpnext/private/backups'
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==2.0.0', 'console_scripts', 'bench')()
  File "/usr/local/frappe/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 "/usr/local/frappe/bench-repo/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
  File "/usr/local/frappe/bench-repo/bench/commands/update.py", line 89, in _update
    backup_all_sites(bench=bench_path)
  File "/usr/local/frappe/bench-repo/bench/utils.py", line 333, in backup_all_sites
    backup_site(site, bench=bench)
  File "/usr/local/frappe/bench-repo/bench/utils.py", line 329, in backup_site
    run_frappe_cmd('--site', site, 'backup', bench=bench)
  File "/usr/local/frappe/bench-repo/bench/utils.py", line 442, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('--site', 'erpnext', 'backup')

hi @kirthi, can you check if this folder exists “./erpnext/private/backups”

@bohlian where should I look for? within frappe-bench/apps/erpnext folder? will it be at frappe-bench/apps/erpnext/erpnext/private/backups?

@kirthi, normally it would be in frappe-bench/sites/“the folder i mentioned”

what folders do you have in your sites folder?

Thanks @bohlian . I created the folder, and it worked.

I am still getting this on

bench uninstall-app base_vat

OSError: [Errno 2] No such file or directory: './private/backups'

Where is that backups file supposed to reside? I already tried several places.

Have you tried like this -

frappe@ubuntu:~/frappe-bench$ find . -name ‘backups’
./apps/frappe/frappe/desk/page/backups
./sites/xxx.com/private/backups

Thank you @clarkej for listing your backup folders. I can confirm that those match with our installation. In addition I added

./apps/erpnext/erpnext/private/backups
and I also tried adding simply
./private/backups

Still, bench seems to expect the backup folder somewhere else.

Hey @rasos

bench --version
bench version

output in fresh thread with error log.
This thread is too old and closing for now. Thanks