leochen-g / wechat-assistant-pro

智能微秘书,一个全能的微信机器人管理平台,最简单的方式接入 ChatGPT,FastGPT,Dify,Coze知识库,支持绘图,联网查询,语音识别,各种定时任务,支持企微、公众号、5G 消息、WhatsApp
https://wechat.aibotk.com
MIT License
1.75k stars 281 forks source link

运行出错 #15

Closed dotama closed 2 years ago

dotama commented 2 years ago

请求出错 Error: Internal Server Error at Request.callback (/bot/node_modules/superagent/lib/node/index.js:883:15) at /bot/node_modules/superagent/lib/node/index.js:1126:20 at IncomingMessage. (/bot/node_modules/superagent/lib/node/parsers/json.js:22:7) at IncomingMessage.emit (node:events:402:35) at IncomingMessage.emit (node:domain:475:12) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { status: 500, response: <ref *1> Response { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, res: IncomingMessage { _readableState: [ReadableState], _events: [Object: null prototype], _eventsCount: 4, _maxListeners: undefined, socket: [Socket], httpVersionMajor: 1, httpVersionMinor: 1, httpVersion: '1.1', complete: true, rawHeaders: [Array], rawTrailers: [], aborted: false, upgrade: false, url: '', method: null, statusCode: 500, statusMessage: 'Internal Server Error', client: [Socket], _consuming: false, _dumped: false, req: [ClientRequest], text: '',

}, request: Request { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, _enableHttp2: false, _agent: false, _formData: null, method: 'GET', url: 'http://api.tianapi.com/txapi/robot/?key=xxx&question=%E4%BB%8A%E5%A4%A9%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B0%E9%97%BB&userid=xxx', _header: [Object], header: [Object], writable: true, _redirects: 0, _maxRedirects: 5, cookies: '', qs: {}, _query: [], qsRaw: [], _redirectList: [], _streamRequest: false, req: [ClientRequest], protocol: 'http:', host: 'api.tianapi.com', _endCalled: true, _callback: [Function (anonymous)], res: [IncomingMessage], _resBuffered: true, response: [Circular *1], called: true,

}, req: ClientRequest { _events: [Object: null prototype], _eventsCount: 3, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, maxRequestsOnConnectionReached: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, _closed: false, socket: [Socket], _header: 'GET /txapi/robot/?key=xxx&question=%E4%BB%8A%E5%A4%A9%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B0%E9%97%BB&userid=xxxHTTP/1.1\r\n' + 'Host: api.tianapi.com\r\n' + 'Accept-Encoding: gzip, deflate\r\n' + 'Content-Type: application/x-www-form-urlencoded\r\n' + 'Authorization: \r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: nop], agent: [Agent], socketPath: undefined, method: 'GET', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/txapi/robot/?key=xxx&question=%E4%BB%8A%E5%A4%A9%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B0%E9%97%BB&userid=xxx', _ended: true, res: [IncomingMessage], aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'api.tianapi.com', protocol: 'http:',

[Symbol(kOutHeaders)]: [Object: null prototype] }, text: '', body: '', files: undefined, buffered: true, headers: { date: 'Thu, 14 Oct 2021 07:15:53 GMT', 'content-type': 'application/json;charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'access-control-allow-origin': '', 'access-control-allow-methods': 'POST,GET,OPTIONS', 'access-control-allow-headers': 'Content-Type,Access-Control-Allow-Headers,X-Requested-with,Origin' }, header: { date: 'Thu, 14 Oct 2021 07:15:53 GMT', 'content-type': 'application/json;charset=utf-8', 'transfer-encoding': 'chunked', connection: 'close', 'access-control-allow-origin': '', 'access-control-allow-methods': 'POST,GET,OPTIONS', 'access-control-allow-headers': 'Content-Type,Access-Control-Allow-Headers,X-Requested-with,Origin' }, statusCode: 500, status: 500, statusType: 5, info: false, ok: false, redirect: false, clientError: false, serverError: true, error: Error: cannot GET /txapi/robot/?key=xxx&question=%E4%BB%8A%E5%A4%A9%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B0%E9%97%BB&userid=xxx(500) at Response.toError (/bot/node_modules/superagent/lib/node/response.js:98:13) at ResponseBase._setStatusProperties (/bot/node_modules/superagent/lib/response-base.js:119:48) at new Response (/bot/node_modules/superagent/lib/node/response.js:44:8) at Request._emitResponse (/bot/node_modules/superagent/lib/node/index.js:930:18) at /bot/node_modules/superagent/lib/node/index.js:1126:42 at IncomingMessage. (/bot/node_modules/superagent/lib/node/parsers/json.js:22:7) at IncomingMessage.emit (node:events:402:35) at IncomingMessage.emit (node:domain:475:12) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) { status: 500, text: '', method: 'GET', path: '/txapi/robot/?key=xxx&question=%E4%BB%8A%E5%A4%A9%E6%9C%89%E4%BB%80%E4%B9%88%E6%96%B0%E9%97%BB&userid=xxx' }, created: false, accepted: false, noContent: false, badRequest: false, unauthorized: false, notAcceptable: false, forbidden: false, notFound: false, unprocessableEntity: false, type: 'application/json', charset: 'utf-8', links: {}, setEncoding: [Function: bound ], redirects: [], pipe: [Function (anonymous)],

} } SyntaxError: Unexpected end of JSON input at JSON.parse () at /bot/node_modules/wechaty-web-panel/src/proxy/superagent.js:28:22 at Request.callback (/bot/node_modules/superagent/lib/node/index.js:905:3) at /bot/node_modules/superagent/lib/node/index.js:1126:20 at IncomingMessage. (/bot/node_modules/superagent/lib/node/parsers/json.js:22:7) at IncomingMessage.emit (node:events:402:35) at IncomingMessage.emit (node:domain:475:12) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)


查了下是天行机器人在查询新闻时返回500, 而docker在处理该类错误时直接退出.

dotama commented 2 years ago

已联系天行客服修复. 但获取的新闻结果无法解析

虽然我不太懂你说的是什么,但是感觉很高级的样子,因此我也查找了类似的文章去学习,你觉得有用吗
《undefined》undefined

查为wechatBot/superagent/index.js解析的结果

leochen-g commented 2 years ago

已联系天行客服修复. 但获取的新闻结果无法解析

虽然我不太懂你说的是什么,但是感觉很高级的样子,因此我也查找了类似的文章去学习,你觉得有用吗 《undefined》undefined

查为wechatBot/superagent/index.js解析的结果

你需要申请的是https://www.tianapi.com/apiview/51这个新闻接口权限,对照看一下。 你用的是wechaBot 项目,还是wechat-assistant-pro 这两个项目的问题不要混着提

dotama commented 2 years ago

已联系天行客服修复. 但获取的新闻结果无法解析

虽然我不太懂你说的是什么,但是感觉很高级的样子,因此我也查找了类似的文章去学习,你觉得有用吗 《undefined》undefined

查为wechatBot/superagent/index.js解析的结果

你需要申请的是https://www.tianapi.com/apiview/51这个新闻接口权限,对照看一下。 你用的是wechaBot 项目,还是wechat-assistant-pro 这两个项目的问题不要混着提

是wechat-assistant项目, 主要是因为你wechat-assistant-pro的Readme还是 wechat-assistant的说明文档

step1: 拉取镜像 docker pull aibotk/wechat-assistant step2: 启动docker 以下两个命令自己选择一个执行就行,执行的时候会下载puppet,可能会比较慢,耐心等待一下即可

1、请在项目根目录执行,这个命令是前台执行可以直接看到log日志的,但是没法关闭,只能销毁终端实例

docker run -e AIBOTK_KEY="微秘书apikey" -e AIBOTK_SECRET="微秘书apiSecret" --name=wechatBot aibotk/wechat-assistant 2、这个命令可以在后台运行,多了一个-d

docker run -d -e AIBOTK_KEY="微秘书apikey" -e AIBOTK_SECRET="微秘书apiSecret" --name=wechatBot aibotk/wechat-assistant

leochen-g commented 2 years ago

已联系天行客服修复. 但获取的新闻结果无法解析

虽然我不太懂你说的是什么,但是感觉很高级的样子,因此我也查找了类似的文章去学习,你觉得有用吗 《undefined》undefined

查为wechatBot/superagent/index.js解析的结果

你需要申请的是https://www.tianapi.com/apiview/51这个新闻接口权限,对照看一下。 你用的是wechaBot 项目,还是wechat-assistant-pro 这两个项目的问题不要混着提

是wechat-assistant项目, 主要是因为你wechat-assistant-pro的Readme还是 wechat-assistant的说明文档

step1: 拉取镜像 docker pull aibotk/wechat-assistant step2: 启动docker 以下两个命令自己选择一个执行就行,执行的时候会下载puppet,可能会比较慢,耐心等待一下即可

1、请在项目根目录执行,这个命令是前台执行可以直接看到log日志的,但是没法关闭,只能销毁终端实例

docker run -e AIBOTK_KEY="微秘书apikey" -e AIBOTK_SECRET="微秘书apiSecret" --name=wechatBot aibotk/wechat-assistant 2、这个命令可以在后台运行,多了一个-d

docker run -d -e AIBOTK_KEY="微秘书apikey" -e AIBOTK_SECRET="微秘书apiSecret" --name=wechatBot aibotk/wechat-assistant

😂 这个只是docker名为wechat-assistant,和 wechat-assistant这个项目无关的,插件源码是这个 https://github.com/leochen-g/wechaty-web-panel