Yet another bench update failure

Hi all,

I’ve tried updating with “bench update” but although the git fetch commands to work, installation fails.
Full log is here, can anyone help me out? (this is the log from second run, that’s why “Already up-to-date”, but installation failure is always the same)

bicli@ubuntu:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
From https://github.com/frappe/frappe

  • branch develop -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    From https://github.com/frappe/erpnext
  • branch develop -> FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    Traceback (most recent call last):
    File “/usr/lib/python2.7/runpy.py”, line 162, in runmodule_as_main
    “main”, fname, loader, pkg_name)
    File “/usr/lib/python2.7/runpy.py”, line 72, in runcode
    exec code in run_globals
    File “/home/bicli/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/bicli/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/bicli/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/bicli/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/bicli/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return processresult(sub_ctx.command.invoke(sub_ctx))
    File “/home/bicli/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return processresult(sub_ctx.command.invoke(sub_ctx))
    File “/home/bicli/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/bicli/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/bicli/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/bicli/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/bicli/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222, 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/bicli/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/bicli/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/bicli/frappe-bench/apps/frappe/frappe/utils/backups.py”, line 185, in delete_temp_backups
    os.remove(this_file_path)
    OSError: [Errno 21] Is a directory: ‘./site1.local/private/backups/site1.local’
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
    File “/home/bicli/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 processresult(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 “/home/bicli/bench-repo/bench/commands/update.py”, line 60, in update
    update(pull, patch, build, bench, auto, restartsupervisor, requirements, no_backup, upgrade, force=force)
    File “/home/bicli/bench-repo/bench/commands/update.py”, line 89, in _update
    backup_all_sites(bench_path=bench_path)
    File “/home/bicli/bench-repo/bench/utils.py”, line 390, in backup_all_sites
    backup_site(site, bench_path=bench_path)
    File “/home/bicli/bench-repo/bench/utils.py”, line 386, in backup_site
    run_frappe_cmd(’–site’, site, ‘backup’, bench_path=bench_path)
    File “/home/bicli/bench-repo/bench/utils.py”, line 499, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (’–site’, ‘site1.local’, ‘backup’)

just for anyone having similar problem, I had to manually delete the content of the backup folder. but this needs to be handled by bench update automatically, IMHO.

got a different error

INFO:bench.utils:updating bench
Already up-to-date.
Requirement already satisfied (use --upgrade to upgrade): Pillow in ./env/lib/python2.7/site-packages
INFO:bench.app:pulling frappe
Da https://github.com/frappe/frappe

  • branch develop -> FETCH_HEAD
    Already up-to-date.
    INFO:bench.app:pulling erpnext
    Da https://github.com/frappe/erpnext
  • branch develop -> FETCH_HEAD
    Already up-to-date.
    Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
    fatal: index file smaller than expected
    Command “git fetch -q” failed with error code 128 in /home/frappe/frappe-bench/env/src/pdfkit
    Traceback (most recent call last):
    File “/usr/bin/bench”, line 9, in
    load_entry_point(‘bench==4.0.0-beta’, ‘console_scripts’, ‘bench’)()
    File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
    bench_command()
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    File “/usr/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/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 “/home/frappe/bench-repo/bench/commands/update.py”, line 79, in _update
    update_requirements(bench_path=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 378, in update_requirements
    exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
    File “/home/frappe/bench-repo/bench/utils.py”, line 100, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: ./env/bin/pip install -q -r ./apps/frappe/requirements.txt

./env/bin/pip install -r ./apps/frappe/requirements.txt

Requirement already satisfied (use --upgrade to upgrade): chardet in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 1))
Requirement already satisfied (use --upgrade to upgrade): cssmin in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 2))
Requirement already satisfied (use --upgrade to upgrade): dropbox in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 3))
Requirement already satisfied (use --upgrade to upgrade): gunicorn in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 4))
Requirement already satisfied (use --upgrade to upgrade): httplib2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 5))
Requirement already satisfied (use --upgrade to upgrade): jinja2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 6))
Requirement already satisfied (use --upgrade to upgrade): markdown2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 7))
Requirement already satisfied (use --upgrade to upgrade): markupsafe in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 8))
Requirement already satisfied (use --upgrade to upgrade): mysql-python==1.2.5 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 9))
Requirement already satisfied (use --upgrade to upgrade): python-geoip in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 10))
Requirement already satisfied (use --upgrade to upgrade): python-geoip-geolite2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 11))
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 12))
Requirement already satisfied (use --upgrade to upgrade): pytz in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 13))
Requirement already satisfied (use --upgrade to upgrade): six in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 14))
Requirement already satisfied (use --upgrade to upgrade): termcolor in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 15))
Requirement already satisfied (use --upgrade to upgrade): werkzeug in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 16))
Requirement already satisfied (use --upgrade to upgrade): semantic_version in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 17))
Requirement already satisfied (use --upgrade to upgrade): rauth>=0.6.2 in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 18))
Requirement already satisfied (use --upgrade to upgrade): requests in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 19))
Requirement already satisfied (use --upgrade to upgrade): redis in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 20))
Requirement already satisfied (use --upgrade to upgrade): selenium in ./env/lib/python2.7/site-packages (from -r ./apps/frappe/requirements.txt (line 21))
Obtaining pdfkit from git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit (from -r ./apps/frappe/requirements.txt (line 22))
Updating ./env/src/pdfkit clone
fatal: index file smaller than expected
Command “git fetch -q” failed with error code 128 in /home/frappe/frappe-bench/env/src/pdfkit