Backup and Restore Error Programming Error: (1146, “Table ‘1db3e0294d.tabDefalultValue’ doesn’t exist”)

Hi Gurus
I’m using ERPNexT Version: 6.18.4 production on Ubuntu 14.04 LTS installed using easy installation and tried to restore a backup in a separate pc with same installation, running the below command
/frappe-bench$ bench --force restore /path to sql file
and ended up with: Programming Error: (1146, “Table ‘1db3e0294d.tabDefalultValue’ doesn’t exist”)

when i tried to login shows Internal Server Error!!!

Can anybody guide what went wrong and how to fix it. How to restore backups?


@jchakma did you give full path to SQL file?

  1. First you need to unzip the sql.gz file using gunzip filename.sql.gz
  2. Say the file is in /path/to/frappe-bench/sites/site1.local/filename.sql, then run:
    bench --site site1.local --force restore $PWD/sites/site1.local/filename.sql

I am also getting same issue while restoring database using bench restore. But when I ran db backup script from MySQL Workbench, db restore done successfully.

thanks for your reply. I reinstalled ubuntu 14.04 and erpnext with easy way installation. and followed as below and ended up same as previous:

oong@boong:~$ cd frappe-bench/sites/site1.local/public/files

boong@boong:~/frappe-bench/sites/site1.local/public/files$ gunzip 20160203_50594621_database.sql.gz

boong@boong:~/frappe-bench/sites/site1.local/public/files$ cd

boong@boong:~$ pwd


boong@boong:~$ cd frappe-bench

boong@boong:~/frappe-bench$ bench --site site1.local --force restore /sites/site1.local/public/files/20160203_50594621_database.sql

MySQL root password:

sh: 1: cannot open /sites/site1.local/public/files/20160203_50594621_database.sql: No such file

Traceback (most recent call last):

File “/usr/lib/python2.7/”, line 162, in _run_module_as_main

"__main__", fname, loader, pkg_name)

File “/usr/lib/python2.7/”, line 72, in _run_code

exec code in run_globals

File “/home/boong/frappe-bench/apps/frappe/frappe/utils/”, line 79, in


File “/home/boong/frappe-bench/apps/frappe/frappe/utils/”, line 16, in main


File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 716, in call

return self.main(*args, **kwargs)

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 696, in main

rv = self.invoke(ctx)

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 1060, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 889, in invoke

return ctx.invoke(self.callback, **ctx.params)

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 534, in invoke

return callback(*args, **kwargs)

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/click/”, line 17, in new_func

return f(get_current_context(), *args, **kwargs)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 29, in _func

ret = f(frappe._dict(ctx.obj), *args, **kwargs)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 130, in restore

_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password,

admin_password=admin_password, verbose=context.verbose,
install_apps=install_app, source_sql=sql_file_path, force=context.force)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 89, in _new_site

_install_app("frappe", verbose=verbose, set_as_patched=not source_sql)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 92, in install_app


File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 421, in clear_cache

for fn in frappe.get_hooks("clear_cache"):

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 713, in get_hooks

hooks = _dict(cache().get_value("app_hooks", load_app_hooks))

File “/home/boong/frappe-bench/apps/frappe/frappe/utils/”, line 68, in get_value

val = generator()

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 681, in load_app_hooks

for app in [app_name] if app_name else get_installed_apps(sort=True):

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 661, in get_installed_apps

installed = json.loads(db.get_global("installed_apps") or "[]")

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 641, in get_global

return self.get_default(key, user)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 653, in get_default

d = self.get_defaults(key, parent)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 659, in get_defaults

defaults = frappe.defaults.get_defaults(parent)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 72, in get_defaults

globald = get_defaults_for()

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 177, in get_defaults_for

where parent = %s order by creation""", (parent,), as_dict=1)

File “/home/boong/frappe-bench/apps/frappe/frappe/”, line 135, in sql

self._cursor.execute(query, values)

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 205, in execute

self.errorhandler(self, exc, value)

File “/home/boong/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/”, line 36, in defaulterrorhandler

raise errorclass, errorvalue

_mysql_exceptions.ProgrammingError: (1146, “Table ‘1bd3e0294d.tabDefaultValue’ doesn’t exist”)

when local host is browsed says “Internal Server Error”

how the fix this and restore the backup. Pls help…

@jchakma you need to follow instructions!

You forgot the $PWD:

bench --site site1.local --force restore $PWD/sites/site1.local/public/files/20160203_50594621_database.sql

many many thumbs up… Finally it worked. But with *** Scheduler is disabled ***.
Checked data are restored…

Run bench —site site1.local enable-scheduler to enable scheduler

Anand Doshi


Thanks a lot. Consider it’s closed.