TarsCloud / TarsWeb

TARS Projects Dashboard
BSD 3-Clause "New" or "Revised" License
141 stars 99 forks source link

fix: let host allow set more chars #196

Closed toby1991 closed 1 year ago

toby1991 commented 2 years ago

fix: https://github.com/TarsCloud/TarsWeb/issues/195

{"level":"error","message":"ConfigService.js:317|[insertConfigFile]: SequelizeDatabaseError: Data too long for column 'host' at row 1\n    at Query.formatError (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/mysql/query.js:244:16)\n    at Execute.handler [as onResult] (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/mysql/query.js:51:23)\n    at Execute.execute (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/commands/command.js:30:14)\n    at Connection.handlePacket (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/connection.js:408:32)\n    at PacketParser.onPacket (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/connection.js:70:12)\n    at PacketParser.executeStart (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/packet_parser.js:75:16)\n    at Socket.<anonymous> (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/connection.js:77:25)\n    at Socket.emit (node:events:390:28)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at Socket.Readable.push (node:internal/streams/readable:228:10)\n    at TCP.onStreamRead (node:internal/stream_base_commons:199:23) ","timestamp":"2022-10-13 07:51:56.393"}
{"level":"error","message":"10.0.42.74|admin|ConfigController.js:214|[nodeConfigFileList] TypeError: Cannot read properties of undefined (reading 'get')\n    at Object.ConfigService.getNodeConfigFile (/usr/local/tars/cpp/deploy/web/app/service/config/ConfigService.js:318:20)\n    at async Object.ConfigController.nodeConfigFileList (/usr/local/tars/cpp/deploy/web/app/controller/config/ConfigController.js:203:15)\n    at async /usr/local/tars/cpp/deploy/web/midware/index.js:79:4\n    at async module.exports (/usr/local/tars/cpp/deploy/web/midware/noCacheMidware.js:24:2)\n    at async module.exports (/usr/local/tars/cpp/deploy/web/midware/authMidware.js:23:5)\n    at async /usr/local/tars/cpp/deploy/web/midware/paramsMidware.js:86:4\n    at async /usr/local/tars/cpp/deploy/web/midware/paramsMidware.js:45:3\n    at async /usr/local/tars/cpp/deploy/web/app.js:131:5\n    at async static (/usr/local/tars/cpp/deploy/web/node_modules/koa-static-router/index.js:76:9)\n    at async pathname (/usr/local/tars/cpp/deploy/web/midware/ssoMidware.js:60:13)\n    at async /usr/local/tars/cpp/deploy/web/app.js:102:5\n    at async module.exports (/usr/local/tars/cpp/deploy/web/midware/localeMidware.js:72:2)\n    at async session (/usr/local/tars/cpp/deploy/web/node_modules/koa-session/index.js:41:7)  ","timestamp":"2022-10-13 07:51:56.394"}
{"level":"error","message":"ConfigService.js:317|[insertConfigFile]: SequelizeDatabaseError: Data too long for column 'host' at row 1\n    at Query.formatError (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/mysql/query.js:244:16)\n    at Execute.handler [as onResult] (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/mysql/query.js:51:23)\n    at Execute.execute (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/commands/command.js:30:14)\n    at Connection.handlePacket (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/connection.js:408:32)\n    at PacketParser.onPacket (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/connection.js:70:12)\n    at PacketParser.executeStart (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/packet_parser.js:75:16)\n    at Socket.<anonymous> (/usr/local/tars/cpp/deploy/web/node_modules/mysql2/lib/connection.js:77:25)\n    at Socket.emit (node:events:390:28)\n    at addChunk (node:internal/streams/readable:315:12)\n    at readableAddChunk (node:internal/streams/readable:289:9)\n    at Socket.Readable.push (node:internal/streams/readable:228:10)\n    at TCP.onStreamRead (node:internal/stream_base_commons:199:23) ","timestamp":"2022-10-13 07:51:56.939"}
{"level":"error","message":"10.0.42.74|admin|ConfigController.js:214|[nodeConfigFileList] TypeError: Cannot read properties of undefined (reading 'get')\n    at Object.ConfigService.getNodeConfigFile (/usr/local/tars/cpp/deploy/web/app/service/config/ConfigService.js:318:20)\n    at async Object.ConfigController.nodeConfigFileList (/usr/local/tars/cpp/deploy/web/app/controller/config/ConfigController.js:203:15)\n    at async /usr/local/tars/cpp/deploy/web/midware/index.js:79:4\n    at async module.exports (/usr/local/tars/cpp/deploy/web/midware/noCacheMidware.js:24:2)\n    at async module.exports (/usr/local/tars/cpp/deploy/web/midware/authMidware.js:23:5)\n    at async /usr/local/tars/cpp/deploy/web/midware/paramsMidware.js:86:4\n    at async /usr/local/tars/cpp/deploy/web/midware/paramsMidware.js:45:3\n    at async /usr/local/tars/cpp/deploy/web/app.js:131:5\n    at async static (/usr/local/tars/cpp/deploy/web/node_modules/koa-static-router/index.js:76:9)\n    at async pathname (/usr/local/tars/cpp/deploy/web/midware/ssoMidware.js:60:13)\n    at async /usr/local/tars/cpp/deploy/web/app.js:102:5\n    at async module.exports (/usr/local/tars/cpp/deploy/web/midware/localeMidware.js:72:2)\n    at async session (/usr/local/tars/cpp/deploy/web/node_modules/koa-session/index.js:41:7)  ","timestamp":"2022-10-13 07:51:56.940"}
toby1991 commented 2 years ago
ALTER TABLE `db_tars`.`t_task_item`
CHANGE `node_name` `node_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `db_tars`.`t_config_files`
CHANGE `host` `host` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';