Hello,
this is the output of bench mariadb
frappe@vps [~/frappe-bench]# bench mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 963
Server version: 10.3.13-MariaDB-log MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [1bd3e0294da19198]>
I can even execute SQL commands.
I have just run bench restart
but the problem persists. I have even restarted the server.
I have many other sites hosted by Apache in this server, all connecting to their own database. All work but ERPNext site which is hosted by NGINX. I can be almost sure NGINX is not the problem.
The only fact that occured today was that the VPS was down. Before going down, I could use ERPNext without problems. VPS crashed and when hosting company technical support made it operational again, ERPNext does not load again cause of “Internal Server Error”. By looking at the log files, I saw there is some sort of problem with connection.
I have also tried bench update --path
and bench update
and both failed with the same error. I have used bench build
and it finished correctly, but the problem still persists.
With some of those attempts, this error snapshot was recorded in ~/frappe-bench/sites/my.site/error-snapshots
:
{
"etype": "ImportError",
"evalue": "ImportError('cannot import name Database',)",
"exception": {
"args": "('cannot import name Database',)",
"message": "'cannot import name Database'"
},
"frames": [
{
"call": "(request=<Request 'http://my.site/favicon.ico' [GET]>)",
"dump": {
"global init_request": "<function init_request>",
"request": "<Request 'http://my.site/favicon.ico' [GET]>"
},
"file": "/home/frappe/frappe-bench/apps/frappe/frappe/app.py",
"func": "application",
"lines": {
"56": "\t\trollback = True",
"57": "",
"58": "\t\tinit_request(request)",
"59": "",
"60": "\t\tif frappe.local.form_dict.cmd:"
},
"lnum": 58
},
{
"call": "(request=<Request 'http://my.site/favicon.ico' [GET]>)",
"dump": {
"frappe. auth": "<module 'frappe.auth' from '/home/frappe/frappe-bench/apps/frappe/frappe/auth.pyc'>",
"frappe. local": "<werkzeug.local.Local object>",
"frappe.auth. HTTPRequest": "<class frappe.auth.HTTPRequest>",
"frappe.local.http_request": "undefined",
"global frappe": "<module 'frappe' from '/home/frappe/frappe-bench/apps/frappe/frappe/__init__.pyc'>"
},
"file": "/home/frappe/frappe-bench/apps/frappe/frappe/app.py",
"func": "init_request",
"lines": {
"118": "\tmake_form_dict(request)",
"119": "",
"120": "\tfrappe.local.http_request = frappe.auth.HTTPRequest()",
"121": "",
"122": "def make_form_dict(request):"
},
"lnum": 120
},
after that content, some other content in the file, and at the end, this was recorded:
{
"call": "(site=None, db_name=None)",
"dump": {
"Database": "undefined",
"frappe": "undefined"
},
"file": "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py",
"func": "connect",
"lines": {
"181": "\t:param site: If site is given, calls `frappe.init`.",
"182": "\t:param db_name: Optional. Will use from `site_config.json`.\"\"\"",
"183": "\tfrom frappe.database import Database",
"184": "\tif site:",
"185": "\t\tinit(site)"
},
"lnum": 183
}
],
"locals": {
"db_name": "None",
"site": "None"
},
"pyver": "Python 2.7.5: /home/frappe/frappe-bench/env/bin/python (prefix: /home/frappe/frappe-bench/env)",
"timestamp": "2020-07-21 10:31:43.043987",
"traceback": "Traceback (most recent call last):\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/app.py\", line 58, in application\n init_request(request)\n File \"/home/frappe/frappe-bench/apps/fra$
}
Finally, this was recorded in frappe.log file:
[ERROR] 2020-07-21 14:31:57,915 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py:
Site: my.site
Exception in Enqueue Events for Site my.site
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/scheduler.py", line 86, in enqueue_events_for_site
frappe.connect()
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 183, in connect
from frappe.database import Database
ImportError: cannot import name Database
I am really lost with this.
Any further help will be greatly appreciated.
Regards
Jaime