本地部署时出现问题,显示没有hexoweb_settingmodel数据表
BlueBrightWind opened this issue · 2 comments
Qexo 版本
v2.6.2
平台
MariaDB 本地部署
问题描述
本地部署时,运行python3 manage.py makemigrations出现以下信息:
获取本地配置文件成功, 使用本地数据库配置
[26/Mar/2023 01:04:51] ERROR: Provider获取失败, 跳过(functions.py.[line:63])
_ _
/\ | | | |
/ \ | |__ _ _ | | _
/ /\ \ | | | | | |/ | | | | |
/ ____ | |) | || | (| | || |
// __/ _|_|_|
当前环境: 本地
[26/Mar/2023 01:04:51] INFO: 开始运行自动更新迁移程序...来自(functions.py.[line:972])
[26/Mar/2023 01:04:51] ERROR: 自动更新迁移程序出错: '<' not supported between instances of 'NoneType' and 'tuple'(functions.py.[line:976])
Traceback (most recent call last):
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 73, in execute
return self.cursor.execute(query, args)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/home/why/.local/lib/python3.7/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'Qexo.hexoweb_settingmodel' doesn't exist")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/why/.local/lib/python3.7/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/home/why/.local/lib/python3.7/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/why/.local/lib/python3.7/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/why/.local/lib/python3.7/site-packages/django/core/management/base.py", line 393, in execute
self.check()
File "/home/why/.local/lib/python3.7/site-packages/django/core/management/base.py", line 423, in check
databases=databases,
File "/home/why/.local/lib/python3.7/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/why/.local/lib/python3.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/home/why/.local/lib/python3.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/home/why/.local/lib/python3.7/site-packages/django/urls/resolvers.py", line 416, in check
for pattern in self.url_patterns:
File "/home/why/.local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/why/.local/lib/python3.7/site-packages/django/urls/resolvers.py", line 602, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/why/.local/lib/python3.7/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/why/.local/lib/python3.7/site-packages/django/urls/resolvers.py", line 595, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/why/Qexo-2.6.2/core/urls.py", line 1, in
from hexoweb.views import *
File "/home/why/Qexo-2.6.2/hexoweb/views.py", line 7, in
from .api import *
File "/home/why/Qexo-2.6.2/hexoweb/api.py", line 9, in
from .functions import *
File "/home/why/Qexo-2.6.2/hexoweb/functions.py", line 977, in
save_setting("UPDATE_FROM", QEXO_VERSION)
File "/home/why/Qexo-2.6.2/hexoweb/functions.py", line 242, in save_setting
if obj.count() == 1:
File "/home/why/.local/lib/python3.7/site-packages/django/db/models/query.py", line 412, in count
return self.query.get_count(using=self.db)
File "/home/why/.local/lib/python3.7/site-packages/django/db/models/sql/query.py", line 528, in get_count
number = obj.get_aggregation(using, ['__count'])['__count']
File "/home/why/.local/lib/python3.7/site-packages/django/db/models/sql/query.py", line 513, in get_aggregation
result = compiler.execute_sql(SINGLE)
File "/home/why/.local/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
cursor.execute(sql, params)
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/why/.local/lib/python3.7/site-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/home/why/.local/lib/python3.7/site-packages/django/db/backends/mysql/base.py", line 73, in execute
return self.cursor.execute(query, args)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/cursors.py", line 148, in execute
result = self._query(query)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/cursors.py", line 310, in _query
conn.query(q)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 775, in _read_query_result
result.read()
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 1156, in read
first_packet = self.connection._read_packet()
File "/home/why/.local/lib/python3.7/site-packages/pymysql/connections.py", line 725, in _read_packet
packet.raise_for_error()
File "/home/why/.local/lib/python3.7/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/home/why/.local/lib/python3.7/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
django.db.utils.ProgrammingError: (1146, "Table 'Qexo.hexoweb_settingmodel' doesn't exist")
我感觉问题好像出在没有正常创建数据表,我想尝试手动创建,但是不清楚表的键类型和名称。而且好像在开始的时候自动更新迁移程序的过程中也有点问题,但是这个问题好像并无大碍,主要是不能自动创建数据表的问题如何解决呢?
复现链接
No response
截图
请告诉我你是执行python3 manage.py makemigrations
之后报错吗?我推送了一个更新到Devv分支,你可以尝试一下
你好,使用dev分支的仓库已经成功部署,谢谢