源码安装报错,无法运行 1.3.48-beta

* 描述问题

源码安装报错,无法运行
2024-11-12 09:13:11 [error] token-blacklist: create bloom filter failed Table ‘nocobase.tokenBlacklist’ doesn’t exist stack=Error
at Query.run (E:\nocobase\node_modules\sequelize\src\dialects\mysql\query.js:46:25)
at (E:\nocobase\node_modules\sequelize\src\sequelize.js:650:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at MySQLQueryInterface.select (E:\nocobase\node_modules\sequelize\src\dialects\abstract\query-interface.js:1001:12)
at Function.findAll (E:\nocobase\node_modules\sequelize\src\model.js:1824:21)
at _Repository.find (e:\nocobase\packages\core\database\src\repository.ts:468:14)
at AsyncEmitter. (e:\nocobase\packages\plugins@nocobase\plugin-auth\src\server\token-blacklist.ts:33:22)
at AsyncEmitter.emitAsync (e:\nocobase\packages\core\utils\src\mixin\AsyncEmitter.ts:50:7)
at AsyncEmitter.start (e:\nocobase\packages\core\server\src\application.ts:790:5)
at AppCommand. (e:\nocobase\packages\core\server\src\commands\start.ts:53:7) meta={“name”:“SequelizeDatabaseError”,“parent”:{“code”:“ER_NO_SUC
H_TABLE”,“errno”:1146,“sqlState”:“42S02”,“sqlMessage”:“Table ‘nocobase.tokenBlacklist’ doesn’t exist”,“sql”:"SELECT token FROM tokenBlacklist AS tokenBlacklist ORDER BY ISNULL(tokenBlacklist.id), tokenBlacklist.id ASC;
"},“original”:{“code”:“ER_NO_SUCH_TABLE”,“errno”:1146,“sqlState”:“42S02”,“sqlMessage”:“Table ‘nocobase.tokenBlacklist’ doesn’t exist”,“sql”:“SELECT token FROM tokenBlacklist AS tokenBlacklist ORDER BY ISNULL(tokenBlacklist. id), tokenBlacklist.id ASC;”},“sql”:“SELECT token FROM tokenBlacklist AS tokenBlacklist ORDER BY ISNULL(tokenBlacklist.id), tokenBlacklist.id ASC;”,“parameters”:{}} module=application app=main reqId=f9dbabe2-800b-
4d3a-9e7b-128b93b75a43 dataSourceKey=main
2024-11-12 09:13:11 [error] Unknown column ‘createdAt’ in ‘field list’ stack=Error
at Query.run (E:\nocobase\node_modules\sequelize\src\dialects\mysql\query.js:46:25)
at (E:\nocobase\node_modules\sequelize\src\sequelize.js:650:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at MySQLQueryInterface.select (E:\nocobase\node_modules\sequelize\src\dialects\abstract\query-interface.js:1001:12)
at Function.findAll (E:\nocobase\node_modules\sequelize\src\model.js:1824:21)
at _Repository.find (e:\nocobase\packages\core\database\src\repository.ts:468:14)
at PluginFileManagerServer.loadStorages (e:\nocobase\packages\plu
2024-11-12 09:13:11 [error] Unknown column ‘createdAt’ in ‘field list’
stack=Error
at Query.run (E:\nocobase\node_modules\sequelize
src\dialects\mysql\query.js:46:25)
at (E:\nocobase\node_modules\sequeliz
e\src\sequelize.js:650:28)
at process.processTicksAndRejections (node:internal/process/task_que
ues:95:5)
at MySQLQueryInterface.select (E:\nocobase\node_m
odules\sequelize\src\dialects\abstract\query-interface.js:1001:12)
at Function.findAll (E:\nocobase\node_modules\seq
uelize\src\model.js:1824:21)
at _Repository.find (e:\nocobase\packages\core\database\src\repos
itory.ts:468:14)
at PluginFileManagerServer.loadStorages (e:\nocobase\packages\plugins@nocobase\plugin-file-manager\src\server\server.ts:121:22)
at AsyncEmitter. (e:\nocobase\packages\plugins@nocobase\plugin-file-manager\src\server\server.ts:178:7)
at AsyncEmitter.emitAsync (e:\nocobase\packages\core\utils\src\mixin\AsyncEmitter.ts:50:7) at AsyncEmitter.start (e:\nocobase\packages\core\server\src\application.ts:793:5) module=application app=main reqId=f9dbabe2-800b-4d3a-9e7b-128b93b75a43
dataSourceKey=main
event - [Webpack] Compiled in 413881 ms (19213 modules)
2024-11-12 09:20:33 [warn] app is not running meta={“status”:“error”} module=gateway method=requestHandler app=main reqId=3d609a71-03bd-4bb0-9a09-2bd2ad4c3ce4 dataSourceKey=main
2024-11-12 09:20:33 [error] Unknown column ‘createdAt’ in ‘field list’ meta={“error”:{“status”:503,“message”:“Unknown column ‘createdAt’ in ‘field list’”,“code”:“APP_ERROR”,“command”:{“name”:“start”},“maintaining”:true}} module=ga
teway method=responseErrorWithCode app=main reqId=46d3e79e-dc4a-4495-966a-780ad87694cd dataSourceKey=main

* 运行环境

E:\nocobase>node -v
v18.20.4

E:\nocobase>yarn -v
1.22.22

  • NocoBase 版本:1.3.48-beta
  • 数据库种类与版本: MySQL 8.0.36
  • 操作系统:Windows 11
    -浏览器及版本 Edge
  • 部署方式:源码
  • Docker 镜像版本:
  • NodeJS 版本:v18.20.4

如何重现

根据源码安装步骤操作:
Git 源码安装 - NocoBase
执行到 yarn dev 时错误出现

预期行为

能够正常安装并运行

截图

日志

这里包括了两个错误:

  1. Table ‘nocobase.tokenBlacklist’ doesn’t exist
  2. Unknown column ‘createdAt’ in ‘field list’

请问安装前后是否修改了 DB_UNDERSCORED 环境变量,看一下数据库是否有相应的表,表名是否为下划线形式,是的话添加 DB_UNDERSCORED=true 环境变量。

没有修改过 DB_UNDERSCORED ,我查看了.env 文件,相关行为:# DB_UNDERSCORED=false,是注释的,库里面表名为 token_blacklist
修改DB_UNDERSCORED=true ,重启服务后错误消失,非常感谢!