tarscloud / tarsweb Goto Github PK
View Code? Open in Web Editor NEWTARS Projects Dashboard
License: BSD 3-Clause "New" or "Revised" License
TARS Projects Dashboard
License: BSD 3-Clause "New" or "Revised" License
通过get_tarsnode获取到的tarsnode_install.sh默认是以\n\r作为换行符,Linux上直接执行都会报错。
能否做个判断。
怎么部署在linux上啊?都没有文档。
问题现象:tarsweb在点击“运维管理”---》“模板管理”的情况下,会弹出系统错误对话框,模板管理无法显示。经定位发现是: /TarsWeb/app/dao文件件下TemplateDao.js需要修改,具体修改之后的文件见如下:
[root@VM_0_13_centos dao]# cat TemplateDao.js
/**
const {tProfileTemplate} = require('./db').db_tars;
const Sequelize = require('sequelize');
const TemplateDao = {};
TemplateDao.addTemplate = async (params) => {
return await tProfileTemplate.create({
template_name: params.templateName,
parents_name: params.parentsName,
profile: params.profile,
posttime: params.posttime,
lastuser: params.lastUser
});
};
TemplateDao.deleteTemplate = async (id) => {
return await tProfileTemplate.destroy({
where: {
id: id
}
});
};
TemplateDao.updateTemplate = async (params) => {
return await tProfileTemplate.update({
template_name: params.template_name,
parents_name: params.parents_name,
profile: params.profile,
posttime: params.posttime,
}, {
where: {
id: params.id
}
});
};
TemplateDao.getTemplateById = async (id) => {
return await tProfileTemplate.findOne({
where: {
id
}
});
};
TemplateDao.getTemplateByName = async (templateName) => {
return await tProfileTemplate.findOne({
where: {
template_name: templateName
}
});
};
TemplateDao.getTemplateList = async (templateName, parentsName) => {
const Op=Sequelize.Op;
return await tProfileTemplate.findAll({
where: {
template_name: {
// $like: '%' + templateName + '%'
[Op.like]: %${templateName}%
},
parents_name: {
// $like: '%' + parentsName + '%'
[Op.like]: %${parentsName}%
}
}
});
};
module.exports = TemplateDao;
[root@VM_0_13_centos dao]#
server/api/task 如果出现错误时能否返回更详细的错误信息或错误码?
status_info 仅仅返回 EM_I_FAILED 和 EM_I_SUCCESS 参考意义不大.
TarsWeb有个报错:
{"level":"error","message":"controller.js:392|[saveRouterProxy]: Error: WHERE parameter "id" has invalid "undefined" value\n at MySQLQueryGenerator.whereItemQuery (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2184:13)\n at /usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2173:25\n at Array.forEach ()\n at MySQLQueryGenerator.whereItemsQuery (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2171:35)\n at MySQLQueryGenerator.whereQuery (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/abstract/query-generator.js:2144:24)\n at MySQLQueryGenerator.updateQuery (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/abstract/query-generator.js:435:116)\n at QueryInterface.bulkUpdate (/usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/query-interface.js:1043:37)\n at /usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/model.js:3226:34\n at tryCatcher (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:547:31)\n at Promise._settlePromise (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:604:18)\n at Promise._settlePromise0 (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:649:10)\n at Promise._settlePromises (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:729:18)\n at _drainQueueStep (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:93:12)\n at _drainQueue (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:86:9)\n at Async._drainQueues (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:102:5)\n at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:15:14)\n at processImmediate (internal/timers.js:439:21) ","timestamp":"2020-08-25 16:47:20.505"}
Hi, 我看TarsGo目前已经从Admin发送命令的优雅重启。但是TarsWeb上,传包发布的时候,还不是优雅重启,请问是否可以支持?
相关链接:TarsCloud/TarsGo#210
mysql> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| +05:30 | +05:30 |
+--------------------+---------------------+
1 row in set (0.01 sec)
SequelizeConnectionError: Unknown or incorrect time zone: '+5.5:00'
at /usr/local/tars/cpp/deploy/web/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:133:19
at tryCatcher (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/promise.js:725:18)
at _drainQueueStep (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/tars/cpp/deploy/web/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:439:21)
struct TA
{
0 optional string extra = "{}"; // 附加参数
1 optional string create_at = "1001-01-01 00:00:00"; // 订阅时间
};
接口测试上传tars文件时,如果字段设置了默认值,会报错,去掉默认值就ok了,麻烦看下~
你好,我有两台机器,226和229
然后我开发了一个helloworld的服务,已经通过226上的web管理平台( http://172.18.12.226:3000/index.html )部署在226上了。我想把这个服务部署在229上怎么部署?是不是要在229的web管理平台上上传然后部署?我能否直接在226的web管理平台上部署成功?困扰我。
我是通过文档的docker-compose.yml
在服务器上面进行部署的,但是当我访问首页的时候,例如:
tars-web.dev.com
会重定向到登录页面:
127.0.0.1:3001
我希望重定向到:
tars-web.dev.com:3001
环境:
CentOS 7.5.1804
tarscloud/framework:v2.4.12
TarsGo v1.1.1
通过命令《上传并发布》,上传成功,发布失败(Invalid date)。但是通过web可以发布成功。
curl /api/upload_and_publish
命令返回错误:
upload and patch err:TypeError: Cannot read property 'map' of undefinedresult=0
另外说明一下
tarscloud/framework:v2.4.7
没有这个问题
我在使用 curl
调用 upload_patch_package 接口上传包时经常出现包上传不上去的问题, 这种情况下看 curl
的退出码是 52, 查了下是 Empty Response. 偶尔能上传的时候一切正常.
以下是我在脚本中使用 curl 时所用的参数:
curl -s --connect-timeout 120 -F suse=@/path/to/module.tgz -F application=app -F module_name=module -F 'comment=常规发布' -F md5=$module_file_md5 http://$tarsweb_url/pages/server/api/upload_patch_package
会是因为提供的 md5 校验值跟实际收到的包校验值不符吗?
不过即便是这样也不应该完全不响应吧.
更早之前在用 Python requests 完成上传动作时也出现过这样的问题, 当时没分析出什么原因就不了了之了, 现在切换到 curl
来还是这样.
我尝试仅创建了所需的数据库,并通过npm安装了tarsWeb管理系统,然后发布tars-go写的应用,出现报错。
[TARS][EndpointManager doEndpoints, exception ,return: -13001 ,objname: tars.tarsAdminRegistry.AdminRegObj ,setname:
tars版本1.6.0
api.md文档格式重启应用,请求数据如下:
{
"serial": "true",
"items": [{
"server_id": "upiao.configSvr_10.105.232.120",
"command": "restart",
"parameters": {}
}]
}
返回如下报错:
{
"data": {},
"ret_code": 500,
"err_msg": "系统内部错误"
}
使用docker版的tars镜像,在linux下开启挂载数据后web起不来
看web日志一直打印下面信息
Mon, 25 Mar 2019 09:09:14 GMT sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators at node_modules/sequelize/lib/sequelize.js:242:13 { Error: EINVAL: invalid argument, mkdir '/usr/local/app/patchs/tars.upload' at Object.fs.mkdirSync (fs.js:885:18) at Function.sync (/usr/local/tarsweb/node_modules/mkdirp/index.js:71:13) at new DiskStorage (/usr/local/tarsweb/node_modules/multer/storage/disk.js:21:12) at module.exports (/usr/local/tarsweb/node_modules/multer/storage/disk.js:65:10) at new Multer (/usr/local/tarsweb/node_modules/multer/index.js:15:20) at multer (/usr/local/tarsweb/node_modules/multer/index.js:95:12) at multer (/usr/local/tarsweb/node_modules/koa-multer/index.js:17:13) at Object.<anonymous> (/usr/local/tarsweb/app.js:36:16) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function._load (/root/.nvm/versions/node/v8.15.1/lib/node_modules/pm2/node_modules/@pm2/io/build/main/metrics/httpMetrics.js:172:43) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at Object.<anonymous> (/usr/local/tarsweb/bin/www:2:13) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) errno: -22, code: 'EINVAL', syscall: 'mkdir', path: '/usr/local/app/patchs/tars.upload' }
部署完web后,点击每一个node都会提示系统错误 。查看web的 err.log是这个错误。在数据库上也确实没有这个表。这是什么原因?
centos 7.4
mysql 5.6.42
单个节点部署
web项目报错:
Table 'db_tars_web.t_patch_task' doesn't exist\n at Query.formatError
SequelizeDatabaseError: Table 'db_tars_web.t_tars_files' doesn't exist
解决方案:
cd TarsWeb/sql
mysql -uroot -p${mysql_passwork} db_tars_web < db_tars_web.sql
期望增加如下特性:
服务监控切页,展示表格时,支持按耗时、超时率等维度排序
服务监控切页,展示表格时,支持点击日期显示曲线
Since tars supports protobuf, should interface debugging on the web side support protobuf debugging? I do n’t know how to make it more convenient
源码中把上传包的api 做了登录忽略,这是为什么? 文档中有地方写到用curl 上传包的时候需要在system 平台获取一个token, 这不是多此一举了吗?
下面是源码中的一段代码:
//上传文件不需要登录
if(WebConf.webConf.uploadLogin || process.env.TARS_WEB_UPLOAD == 'true') {
loginConf.ignore.push('/pages/server/api/upload_patch_package');
loginConf.ignore.push('/api/upload_patch_package');
loginConf.ignore.push('/pages/server/api/upload_and_publish');
loginConf.ignore.push('/api/upload_and_publish');
}
另外还有一个奇怪的地方就是, curl 命令上传包成功,但返回的信息包含了一个 "Method NOT Allowed" !!!
tar cvfz boxserver.tgz ...
POST /api/upload_and_publish?ticket=cde57eeb8b1e9138c38f23eaebe5aebf9ff56fe0111 HTTP/1.1
Host: 172.25.0.1:3000
User-Agent: curl/7.58.0
Accept: /
Content-Length: 11824338
Content-Type: multipart/form-data; boundary=------------------------f8e7df31d8cfb4dd
Expect: 100-continue
task no: [33fd1e8440ba4d5bb19213ab44432e2b]
172.25.0.5 EM_I_SUCCESS startServer [quwanyun.boxserver] from 172.25.0.3 :server is activating, please check:
If you find any dependent libraries in code but never display its open source license in the License file, please comment on this issue, We will update the License file ASAP.
You also can pull request to the License file and remember to describe in detail ; )
Welcome to contribute!
请教一下,前端的let-ui是否有相关文档支持?
中文乱码了,这个是不是要解在tarslog 模块中解决啊?
Obj填错了,改不了。
参考例子: https://github.com/TarsCloud/TarsDocs/blob/master/kai-fa/tarsphp/yu-laravel-jie-he-shi-yong.md
执行到:
echo "上传build包"
def packageDeploy = sh(script: "head -n 1 tmp.log", returnStdout: true).trim()
sh "curl -H 'Host:172.18.0.3:3000' -F 'suse=@./${packageDeploy}' -F 'application=${APP_NAME}' -F 'module_name=${SERVER_NAME}' -F 'comment=${env.TAG_DESC}' http://172.18.0.3:3000/pages/server/api/upload_patch_package > curl.log"
(Host:172.18.0.3:3000 我已经改为自己的 tars 服务器地址)
读取 curl.log 返回
请问如何添加登录信息?
请问这个登录模块在哪里
上传ProxyServer和RouteServer时,会在tars.upload目录下生成对应的ProxyServer和RouteServer目录,而且这两个目录名称应该是默认的,无法修改。
在发布的时候,tarspatch搜索的路径是application/server/下,这里的server是自定义的名称,如果与上传的那个名称不一致(即ProxyServer和RouteServer)就会发布失败:
2019-05-10 16:51:00|31183|DEBUG|PatchImp::preparePatchFile upfile:/usr/local/app/patchs/tars.upload/DCache/DCacheAppRouterServer/DCache.RouterServer_suse_1557459459210.tgz|dstfile:/usr/local/app/patchs/tars/TARSBatchPatching/DCache/DCacheAppRouterServer/DCache.DCacheAppRouterServer.tgz
2019-05-10 16:51:00|31183|ERROR|PatchImp::preparePatchFile isFileExist file:/usr/local/app/patchs/tars.upload/DCache/DCacheAppRouterServer/DCache.RouterServer_suse_1557459459210.tgz|not exist!
这是bug吗?
部署系统:centos7.4
web版本:2.4.13
现象如题
[TC_Mysql::connect]: mysql_real_connect: Authentication plugin 'caching_sha2_password' cannot be loaded: /opt/tafSource/TarsFramework/build/src/mysql/lib/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
2020-03-27 17:13:53 check mysql is not alive: /usr/local/tars/cpp/deploy/mysql-tool --host=localhost --user=root --pass=R36_xtyOeIdj --port=3306 --check
tars-install.sh error
删除路由后,重新建一条一样的路由会提示数据已存在
举个例子一个app:testapp
对用户进行了set划分:
hubei.wuhan.1,hubei.wuhan.2,……,hubei.wuhan.30
shanghai.minhang.1,shanghai.minhang.2,……,shanghai.minhang.30
每个set下面都有一个Server:testServer
每次发布testServer的时候,都得点入对应的set名下的Server进行发布,一共发布30+30=60次,能否提供直接在SET区域(例子中的wuhan,minhang)层级的批量发布功能?
将一个服务扩容到另一台机器上后,将这个服务下线,然后再扩容到同一台机器上就会报错,请问怎么解决
缺少db_user_system库相关表
另外测试了下 用户模块貌似还不完整 求官方回复
db_tars_web.t_tars_files表的context字段(用于保存接口测试的tars文件内容),类型为TEXT,最大只支持64K,可否改为MEDIUMTEXT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.