Try ERPNext Buy Support Partners Foundation Foundation Members

How to fix: Sorry! We will be back soon

Hello Community ,
I had a problem weeks after working with the ERP , it gave me this message : Sorry!
We will be back soon.
I tried to update the system but it doesn’t solve the problem

bench migrate

There are many possible causes, but the most frequent is when you have altered the site_config.json file (either manually or automated by use of other function scripts).

Even after a “bench migrate” you will not always have success.

So, it is always best to “additionally” run the following commands:

bench setup nginx
sudo service nginx restart
bench --site site1.local enable-scheduler

(Of course replace site1.local with your site name)

If you make these additional commands a habit before you logout of your server maintenance, then you should always have a successful restart.

Hope this helps… (I had to make it mandatory for all of my techs when they work on sites)

BKM

thank you for your reply , when I try to get my site name with " from frappe.utils import get_site_name " and then “site_name = get_site_name(frappe.local.request.host)” it gives me " -bash: from: command not found " ,

To get your site name simply cd into your bench folder then check what is in sites:

ls sites

I tried this , but it gave me those errors :
Traceback (most recent call last):
File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib64/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 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/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 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/scheduler.py”, line 43, in enable_scheduler
frappe.utils.scheduler.enable_scheduler()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 239, in enable_scheduler
toggle_scheduler(True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py”, line 236, in toggle_scheduler
frappe.db.set_value(“System Settings”, None, “enable_scheduler”, 1 if enable else 0)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 623, in set_value
modified = now()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 159, in now
return now_datetime().strftime(DATETIME_FORMAT)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 126, in now_datetime
dt = convert_utc_to_user_timezone(datetime.datetime.utcnow())
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 149, in convert_utc_to_user_timezone
return utcnow.astimezone(timezone(get_time_zone()))
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 143, in get_time_zone
return frappe.cache().get_value(“time_zone”, _get_time_zone)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 79, in get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/data.py”, line 137, in _get_time_zone
return frappe.db.get_system_setting(‘time_zone’) or ‘Asia/Kolkata’ # Default to India ?!
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 880, in get_system_setting
return frappe.cache().get_value(“system_settings”, _load_system_settings).get(key)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/redis_wrapper.py”, line 79, in get_value
val = generator()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 879, in _load_system_settings
return self.get_singles_dict(“System Settings”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 518, in get_singles_dict
“”", doctype)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 122, in sql
self.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 75, in connect
self._conn = self.get_connection()
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/database.py”, line 96, in get_connection
conn.select_db(self.user)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 446, in select_db
self._read_ok_packet()
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 394, in _read_ok_packet
pkt = self._read_packet()
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1049, u"Unknown database ‘_87a197e4ad4f350d’")

Is your environment setup in production or only on development ?
You could verify your site_config.json to get database_name and if it’s in you mariadb database

I suppose here that your environment is not started.