ERPNext not working at all

I cant revive it…I tried git fetch origin…

frappe@erpnext:~/bench-repo$ git fetch origin
error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
fatal: loose object a694c9403a8a1dcdb2459145bf94ac0d07b39eea (stored in .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea) is corrupt
fatal: The remote end hung up unexpectedly

git pull…

frappe@erpnext:~/bench-repo$ git pull
error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
fatal: loose object a694c9403a8a1dcdb2459145bf94ac0d07b39eea (stored in .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea) is corrupt
fatal: The remote end hung up unexpectedly
frappe@erpnext:~/bench-repo$

bench update…

frappe@erpnext:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
fatal: loose object a694c9403a8a1dcdb2459145bf94ac0d07b39eea (stored in .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea) is corrupt
fatal: The remote end hung up unexpectedly
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==2.1.0’, ‘console_scripts’, ‘bench’)()
File “/home/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 “/home/frappe/bench-repo/bench/commands/update.py”, line 34, in update
update_bench()
File “/home/frappe/bench-repo/bench/utils.py”, line 230, in update_bench
exec_cmd(“git pull”, cwd=cwd)
File “/home/frappe/bench-repo/bench/utils.py”, line 130, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git pull
frappe@erpnext:~/frappe-bench$

and bench update --patch

frappe@erpnext:~/frappe-bench$ bench update --patch
remote: Counting objects: 115, done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 115 (delta 61), reused 31 (delta 31), pack-reused 4
Receiving objects: 100% (115/115), 92.12 KiB | 114.00 KiB/s, done.
Resolving deltas: 100% (61/61), completed with 31 local objects.
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
515d952…aaf6106 develop → upstream/develop
74bc80d…1b71e34 hotfix → upstream/hotfix
Migrating erpnext.vm
Executing erpnext.patches.v7_1.update_portal_roles in erpnext.vm (d56cb677ea)
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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/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/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/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 206, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
frappe.modules.patch_handler.run_all()
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 26, in run_all
if not run_single(patchmodule = patch):
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 60, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 80, in execute_patch
frappe.get_attr(patchmodule.split()[0] + “.execute”)()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v7_1/update_portal_roles.py”, line 7, in execute
frappe.db.set_value(‘Role’, role_name, ‘desk_access’, 0)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 608, in set_value
{2}“”".format(dt, field, conditions), values, debug=debug)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 137, in sql
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
self.errorhandler(self, exc, value)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, “Unknown column ‘desk_access’ in ‘field list’”)
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==2.1.0’, ‘console_scripts’, ‘bench’)()
File “/home/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 “/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 90, in _update
patch_sites(bench_path=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 164, in patch_sites
run_frappe_cmd(‘–site’, ‘all’, ‘migrate’, bench_path=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 501, in run_frappe_cmd
raise CommandFailedError(args)
bench.utils.CommandFailedError: (‘–site’, ‘all’, ‘migrate’)
frappe@erpnext:~/frappe-bench$

I tried all the solutions that I could find on the forum I am still getting a
Updating. We will be back in a few moments... message

try this:

cd frappe-bench/apps/frappe
rm .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea
git remote remove upstream
git remote add upstream https://github.com/frappe/frappe.git
git fetch --all

if fetching works, then cd back into frappe-bench and try:

bench update

Something must have borked your local git repo

ok…I tried your method and this is what I got…

frappe@erpnext:~/frappe-bench$ cd apps/frappe
frappe@erpnext:~/frappe-bench/apps/frappe$ ls
attributions.md frappe license.txt requirements.txt test_sites
ci frappe.egg-info MANIFEST.in setup.py
CONTRIBUTING.md hooks.md README.md socketio.js
frappe@erpnext:~/frappe-bench/apps/frappe$ rm .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea
rm: cannot remove ‘.git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea’: No such file or directory
frappe@erpnext:~/frappe-bench/apps/frappe$ git remote remove upstream
frappe@erpnext:~/frappe-bench/apps/frappe$ git remote add upstream GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
frappe@erpnext:~/frappe-bench/apps/frappe$ git fetch --all
Fetching upstream
From GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

  • [new branch] bot → upstream/bot
  • [new branch] develop → upstream/develop
  • [new branch] gantt → upstream/gantt
  • [new branch] gh-pages → upstream/gh-pages
  • [new branch] hotfix → upstream/hotfix
  • [new branch] master → upstream/master
  • [new branch] revert-1943-patch-40 → upstream/revert-1943-patch-40
  • [new branch] v4.x.x → upstream/v4.x.x
  • [new branch] v5.x.x → upstream/v5.x.x
  • [new branch] v6.x.x → upstream/v6.x.x
    frappe@erpnext:~/frappe-bench/apps/frappe$ cd …
    frappe@erpnext:~/frappe-bench/apps$ cd …
    frappe@erpnext:~/frappe-bench$ bench update
    INFO:bench.utils:updating bench
    error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
    error: object file .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea is empty
    fatal: loose object a694c9403a8a1dcdb2459145bf94ac0d07b39eea (stored in .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea) is corrupt
    fatal: The remote end hung up unexpectedly
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==2.1.0’, ‘console_scripts’, ‘bench’)()
    File “/home/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 “/home/frappe/bench-repo/bench/commands/update.py”, line 34, in update
    update_bench()
    File “/home/frappe/bench-repo/bench/utils.py”, line 230, in update_bench
    exec_cmd(“git pull”, cwd=cwd)
    File “/home/frappe/bench-repo/bench/utils.py”, line 130, in exec_cmd
    raise CommandFailedError(cmd)
    bench.utils.CommandFailedError: git pull
    frappe@erpnext:~/frappe-bench$ bench update --patch
    Migrating erpnext.vm
    Executing erpnext.patches.v7_1.update_portal_roles in erpnext.vm (d56cb677ea)
    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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
    main()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
    click.Group(commands=commands)(prog_name=‘bench’)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
    return self.main(*args, **kwargs)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
    rv = self.invoke(ctx)
    File “/home/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/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/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
    return callback(*args, **kwargs)
    File “/home/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/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 24, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 206, in migrate
    migrate(context.verbose, rebuild_website=rebuild_website)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
    frappe.modules.patch_handler.run_all()
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 26, in run_all
    if not run_single(patchmodule = patch):
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 60, in run_single
    return execute_patch(patchmodule, method, methodargs)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 80, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + “.execute”)()
    File “/home/frappe/frappe-bench/apps/erpnext/erpnext/patches/v7_1/update_portal_roles.py”, line 7, in execute
    frappe.db.set_value(‘Role’, role_name, ‘desk_access’, 0)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 608, in set_value
    {2}“”".format(dt, field, conditions), values, debug=debug)
    File “/home/frappe/frappe-bench/apps/frappe/frappe/database.py”, line 137, in sql
    self._cursor.execute(query, values)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py”, line 205, in execute
    self.errorhandler(self, exc, value)
    File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1054, “Unknown column ‘desk_access’ in ‘field list’”)
    Traceback (most recent call last):
    File “/usr/local/bin/bench”, line 9, in
    load_entry_point(‘bench==2.1.0’, ‘console_scripts’, ‘bench’)()
    File “/home/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 “/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 90, in _update
    patch_sites(bench_path=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 164, in patch_sites
    run_frappe_cmd(‘–site’, ‘all’, ‘migrate’, bench_path=bench_path)
    File “/home/frappe/bench-repo/bench/utils.py”, line 501, in run_frappe_cmd
    raise CommandFailedError(args)
    bench.utils.CommandFailedError: (‘–site’, ‘all’, ‘migrate’)
    frappe@erpnext:~/frappe-bench$

do you want to use develop or production version?

develop
i am on it anyway

So, that file wasn’t under the frappe repo…

frappe@erpnext:~/frappe-bench/apps/frappe$ rm .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea
rm: cannot remove .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea: No such file or directory

And since you get the same git error, it must live somewhere else in the tree of repos it is trying to update.

fatal: loose object a694c9403a8a1dcdb2459145bf94ac0d07b39eea (stored in .git/objects/a6/94c9403a8a1dcdb2459145bf94ac0d07b39eea) is corrupt

It’s hard to tell where that git repo is from, look for that file in apps/frappe/.git/…, apps/erpnext/.git/…, or ~/bench-repo/.git/… folders

When you find it delete it, it’s an empty file anyways. Once it is gone do another fetch pull --all to regenerate the git object tree

I found the files, the .git folder was hidden. I deleted the a6 folder under the objects folder.
ran bench update again. still same error. even though i deleted the objects/a6 folder.

since i am running from a vm i was considering taking my data and importing it to a fresh vm but i am struggling with the restoration there. here i need to fix this error.