lcjqyml / wechatbot

A chatbot for wechat.
GNU Affero General Public License v3.0
250 stars 40 forks source link

无法连接 ChatGPTBot forQQ #41

Closed LTtt456c closed 5 months ago

LTtt456c commented 11 months ago

描述:chatgpt-mirai-qq-bot和 WeChatBot 在同一个docker下启动 WeChatBot 无法连接chatgpt-mirai-qq-bot 1, WeChatBot 配置信息 chatbotProxy: "http://127.0.0.1:8234" autoAcceptFriendShip: "true" autoAcceptRoomInvite: "true" privateChatTrigger: "" groupChatTrigger: "" responseQuote: "true"

2,chatgpt-mirai-qq-bot -> docker-compose.yaml 配置信息 version: '3.4' services: mirai: image: lss233/mirai-http:latest restart: always environment: LANG: 'C.UTF-8' volumes:

3,报错内容 [12/28/2023, 5:35:26 AM] AxiosError: connect ECONNREFUSED 127.0.0.1:8234 2023-12-28 13:35:26 at Function.AxiosError.from (file:///app/node_modules/axios/lib/core/AxiosError.js:89:14) 2023-12-28 13:35:26 at RedirectableRequest.handleRequestError (file:///app/node_modules/axios/lib/adapters/http.js:577:25) 2023-12-28 13:35:26 at RedirectableRequest.emit (node:events:513:28) 2023-12-28 13:35:26 at RedirectableRequest.emit (node:domain:489:12) 2023-12-28 13:35:26 at ClientRequest.eventHandlers. (/app/node_modules/follow-redirects/index.js:14:24) 2023-12-28 13:35:26 at ClientRequest.emit (node:events:513:28) 2023-12-28 13:35:26 at ClientRequest.emit (node:domain:489:12) 2023-12-28 13:35:26 at Socket.socketErrorListener (node:_http_client:494:9) 2023-12-28 13:35:26 at Socket.emit (node:events:513:28) 2023-12-28 13:35:26 at Socket.emit (node:domain:489:12) { 2023-12-28 13:35:26 port: 8234, 2023-12-28 13:35:26 address: '127.0.0.1', 2023-12-28 13:35:26 syscall: 'connect', 2023-12-28 13:35:26 code: 'ECONNREFUSED', 2023-12-28 13:35:26 errno: -111, 2023-12-28 13:35:26 config: { 2023-12-28 13:35:26 transitional: { 2023-12-28 13:35:26 silentJSONParsing: true, 2023-12-28 13:35:26 forcedJSONParsing: true, 2023-12-28 13:35:26 clarifyTimeoutError: false 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 adapter: [ 'xhr', 'http' ], 2023-12-28 13:35:26 transformRequest: [ [Function: transformRequest] ], 2023-12-28 13:35:26 transformResponse: [ [Function: transformResponse] ], 2023-12-28 13:35:26 timeout: 0, 2023-12-28 13:35:26 xsrfCookieName: 'XSRF-TOKEN', 2023-12-28 13:35:26 xsrfHeaderName: 'X-XSRF-TOKEN', 2023-12-28 13:35:26 maxContentLength: -1, 2023-12-28 13:35:26 maxBodyLength: -1, 2023-12-28 13:35:26 env: { FormData: [Function], Blob: null }, 2023-12-28 13:35:26 validateStatus: [Function: validateStatus], 2023-12-28 13:35:26 headers: AxiosHeaders { 2023-12-28 13:35:26 Accept: 'application/json, text/plain, /', 2023-12-28 13:35:26 'Content-Type': 'application/json', 2023-12-28 13:35:26 'User-Agent': 'axios/1.3.6', 2023-12-28 13:35:26 'Content-Length': '62', 2023-12-28 13:35:26 'Accept-Encoding': 'gzip, compress, deflate, br' 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 method: 'post', 2023-12-28 13:35:26 url: 'http://127.0.0.1:8234/v2/chat', 2023-12-28 13:35:26 data: '{"message":"1","session_id":"friend-LiuTC","username":"LiuTC"}' 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 request: <ref 1> Writable { 2023-12-28 13:35:26 _writableState: WritableState { 2023-12-28 13:35:26 objectMode: false, 2023-12-28 13:35:26 highWaterMark: 16384, 2023-12-28 13:35:26 finalCalled: false, 2023-12-28 13:35:26 needDrain: false, 2023-12-28 13:35:26 ending: false, 2023-12-28 13:35:26 ended: false, 2023-12-28 13:35:26 finished: false, 2023-12-28 13:35:26 destroyed: false, 2023-12-28 13:35:26 decodeStrings: true, 2023-12-28 13:35:26 defaultEncoding: 'utf8', 2023-12-28 13:35:26 length: 0, 2023-12-28 13:35:26 writing: false, 2023-12-28 13:35:26 corked: 0, 2023-12-28 13:35:26 sync: true, 2023-12-28 13:35:26 bufferProcessing: false, 2023-12-28 13:35:26 onwrite: [Function: bound onwrite], 2023-12-28 13:35:26 writecb: null, 2023-12-28 13:35:26 writelen: 0, 2023-12-28 13:35:26 afterWriteTickInfo: null, 2023-12-28 13:35:26 buffered: [], 2023-12-28 13:35:26 bufferedIndex: 0, 2023-12-28 13:35:26 allBuffers: true, 2023-12-28 13:35:26 allNoop: true, 2023-12-28 13:35:26 pendingcb: 0, 2023-12-28 13:35:26 constructed: true, 2023-12-28 13:35:26 prefinished: false, 2023-12-28 13:35:26 errorEmitted: false, 2023-12-28 13:35:26 emitClose: true, 2023-12-28 13:35:26 autoDestroy: true, 2023-12-28 13:35:26 errored: null, 2023-12-28 13:35:26 closed: false, 2023-12-28 13:35:26 closeEmitted: false, 2023-12-28 13:35:26 [Symbol(kOnFinished)]: [] 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 _events: [Object: null prototype] { 2023-12-28 13:35:26 response: [Function: handleResponse], 2023-12-28 13:35:26 error: [Function: handleRequestError], 2023-12-28 13:35:26 socket: [Function: handleRequestSocket] 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 _eventsCount: 3, 2023-12-28 13:35:26 _maxListeners: undefined, 2023-12-28 13:35:26 _options: { 2023-12-28 13:35:26 maxRedirects: 21, 2023-12-28 13:35:26 maxBodyLength: Infinity, 2023-12-28 13:35:26 protocol: 'http:', 2023-12-28 13:35:26 path: '/v2/chat', 2023-12-28 13:35:26 method: 'POST', 2023-12-28 13:35:26 headers: [Object: null prototype], 2023-12-28 13:35:26 agents: [Object], 2023-12-28 13:35:26 auth: undefined, 2023-12-28 13:35:26 beforeRedirect: [Function: dispatchBeforeRedirect], 2023-12-28 13:35:26 beforeRedirects: [Object], 2023-12-28 13:35:26 hostname: '127.0.0.1', 2023-12-28 13:35:26 port: '8234', 2023-12-28 13:35:26 agent: undefined, 2023-12-28 13:35:26 nativeProtocols: [Object], 2023-12-28 13:35:26 pathname: '/v2/chat' 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 _ended: false, 2023-12-28 13:35:26 _ending: true, 2023-12-28 13:35:26 _redirectCount: 0, 2023-12-28 13:35:26 _redirects: [], 2023-12-28 13:35:26 _requestBodyLength: 62, 2023-12-28 13:35:26 _requestBodyBuffers: [ [Object] ], 2023-12-28 13:35:26 _onNativeResponse: [Function (anonymous)], 2023-12-28 13:35:26 _currentRequest: ClientRequest { 2023-12-28 13:35:26 _events: [Object: null prototype], 2023-12-28 13:35:26 _eventsCount: 7, 2023-12-28 13:35:26 _maxListeners: undefined, 2023-12-28 13:35:26 outputData: [], 2023-12-28 13:35:26 outputSize: 0, 2023-12-28 13:35:26 writable: true, 2023-12-28 13:35:26 destroyed: false, 2023-12-28 13:35:26 _last: true, 2023-12-28 13:35:26 chunkedEncoding: false, 2023-12-28 13:35:26 shouldKeepAlive: false, 2023-12-28 13:35:26 maxRequestsOnConnectionReached: false, 2023-12-28 13:35:26 _defaultKeepAlive: true, 2023-12-28 13:35:26 useChunkedEncodingByDefault: true, 2023-12-28 13:35:26 sendDate: false, 2023-12-28 13:35:26 _removedConnection: false, 2023-12-28 13:35:26 _removedContLen: false, 2023-12-28 13:35:26 _removedTE: false, 2023-12-28 13:35:26 strictContentLength: false, 2023-12-28 13:35:26 _contentLength: '62', 2023-12-28 13:35:26 _hasBody: true, 2023-12-28 13:35:26 _trailer: '', 2023-12-28 13:35:26 finished: false, 2023-12-28 13:35:26 _headerSent: true, 2023-12-28 13:35:26 _closed: false, 2023-12-28 13:35:26 socket: [Socket], 2023-12-28 13:35:26 _header: 'POST /v2/chat HTTP/1.1\r\n' + 2023-12-28 13:35:26 'Accept: application/json, text/plain, /\r\n' + 2023-12-28 13:35:26 'Content-Type: application/json\r\n' + 2023-12-28 13:35:26 'User-Agent: axios/1.3.6\r\n' + 2023-12-28 13:35:26 'Content-Length: 62\r\n' + 2023-12-28 13:35:26 'Accept-Encoding: gzip, compress, deflate, br\r\n' + 2023-12-28 13:35:26 'Host: 127.0.0.1:8234\r\n' + 2023-12-28 13:35:26 'Connection: close\r\n' + 2023-12-28 13:35:26 '\r\n', 2023-12-28 13:35:26 _keepAliveTimeout: 0, 2023-12-28 13:35:26 _onPendingData: [Function: nop], 2023-12-28 13:35:26 agent: [Agent], 2023-12-28 13:35:26 socketPath: undefined, 2023-12-28 13:35:26 method: 'POST', 2023-12-28 13:35:26 maxHeaderSize: undefined, 2023-12-28 13:35:26 insecureHTTPParser: undefined, 2023-12-28 13:35:26 path: '/v2/chat', 2023-12-28 13:35:26 _ended: false, 2023-12-28 13:35:26 res: null, 2023-12-28 13:35:26 aborted: false, 2023-12-28 13:35:26 timeoutCb: null, 2023-12-28 13:35:26 upgradeOrConnect: false, 2023-12-28 13:35:26 parser: null, 2023-12-28 13:35:26 maxHeadersCount: null, 2023-12-28 13:35:26 reusedSocket: false, 2023-12-28 13:35:26 host: '127.0.0.1', 2023-12-28 13:35:26 protocol: 'http:', 2023-12-28 13:35:26 _redirectable: [Circular 1], 2023-12-28 13:35:26 [Symbol(kCapture)]: false, 2023-12-28 13:35:26 [Symbol(kBytesWritten)]: 0, 2023-12-28 13:35:26 [Symbol(kEndCalled)]: false, 2023-12-28 13:35:26 [Symbol(kNeedDrain)]: false, 2023-12-28 13:35:26 [Symbol(corked)]: 0, 2023-12-28 13:35:26 [Symbol(kOutHeaders)]: [Object: null prototype], 2023-12-28 13:35:26 [Symbol(kUniqueHeaders)]: null 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 _currentUrl: 'http://127.0.0.1:8234/v2/chat', 2023-12-28 13:35:26 [Symbol(kCapture)]: false 2023-12-28 13:35:26 }, 2023-12-28 13:35:26 cause: Error: connect ECONNREFUSED 127.0.0.1:8234 2023-12-28 13:35:26 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) { 2023-12-28 13:35:26 errno: -111, 2023-12-28 13:35:26 code: 'ECONNREFUSED', 2023-12-28 13:35:26 syscall: 'connect', 2023-12-28 13:35:26 address: '127.0.0.1', 2023-12-28 13:35:26 port: 8234 2023-12-28 13:35:26 } 2023-12-28 13:35:26 }

lcjqyml commented 5 months ago

不是bug,同docker下,需要打通两个容器之间的网络才行,而不是简单的访问127.0.0.1。