Internal Server Error after restoring database

Hi Everyone,

Please note, I just restore a backup of my live instance running on AWS to my local server and after restoring the database my ERP stopped working.

When I tried:
localhost/ or localhost:8000 or localhost:80 or localhost:8080

It is giving me the following error message:

Internal Server Error

Any help in this context will be appreciated.

Regards
Ruchin Sharma

Hi @ruchin78,
try bench migrate
and restrart the service supervisor and nginx

Thanks
Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

1 Like

@sagar
After doing

bench migrate

I got the below error:

vishnu@vishnu-VirtualBox:~/frappe-bench$ bench migrate
Migrating site1.local
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/vishnu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/vishnu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/vishnu/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/vishnu/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/vishnu/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/vishnu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/vishnu/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/vishnu/frappe-bench/apps/frappe/frappe/commands.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/commands.py”, line 205, in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/migrate.py”, line 27, in migrate
frappe.modules.patch_handler.run_all()
File “/home/vishnu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 23, in run_all
for patch in get_all_patches():
File “/home/vishnu/frappe-bench/apps/frappe/frappe/modules/patch_handler.py”, line 37, in get_all_patches
patches.extend(frappe.get_file_items(frappe.get_pymodule_path(app, “patches.txt”)))
File “/home/vishnu/frappe-bench/apps/frappe/frappe/init.py”, line 637, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/vishnu/frappe-bench/apps/frappe/frappe/init.py”, line 599, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named library

Regards
Ruchin Sharma

hi @ruchin78,
please check library app is installed or not in new site

Thanks,
Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

@sagar
Hi Sagar,

Actually in my live instance (from where I have taken the backup) there are 2 sites
site1.local and
library

and there are 2 apps
erpnext &
library

Whereas in the local server (where I am restoring the backup) I have only one default site i.e. site1.local and one default app i.e., erpnext.

Does it required to install the same site and app in the local server as well?
I am asking this question because, I don’t have any idea about it and I am restoring the backup very first time.

If it is required to install the library site as well as library app then I think, I need to re-install the ERPNext and then restore the backup.

Please correct me, if I am wrong.

Regards
Ruchin Sharma