lcjqyml / wechatbot

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

机器人异常 #32

Closed tiexo closed 1 year ago

tiexo commented 1 year ago

按照教程一步步操作,扫码登录后,不管发送什么消息 回复都是:机器人异常,请稍候再试

我是跟chatgpt-qq项目放在同一个服务器,腾讯云的轻量服务器 麻烦指点一下,是哪里搞错了

这一步都是成功的:... Running on http://0.0.0.0:8080 (CTRL + C to quit) 就是最后一步: docker run -e CHATBOT_PROXY="http://chatgpt-qq-chatgpt-1:8080" --network chatgpt-qq_default lcjqyml/wechatbot:latest

http://chatgpt-qq-chatgpt-1:8080" --network chatgpt-qq_default 这两个是在哪里看的?是否需要修改? 我看运行的名字是这三个呀

chatgpt-qq_gocqhttp_1 ... done chatgpt-qq_chatgpt_1 ... done chatgpt-qq_watchtower_1 ... done

运行环境:

[7/26/2023, 3:41:57 PM] 🎯 ChatGPT triggered: 你是谁
[7/26/2023, 3:41:57 PM] 🎯 Chatbot triggered: http://chatgpt-qq-chatgpt-1:8080/v2/chat
[7/26/2023, 3:41:57 PM] Reply text -> 机器人异常,请稍后再试或联系管理员!
[7/26/2023, 3:41:57 PM] AxiosError: getaddrinfo ENOTFOUND chatgpt-qq-chatgpt-1
    at Function.AxiosError.from (file:///app/node_modules/axios/lib/core/AxiosError.js:89:14)
    at RedirectableRequest.handleRequestError (file:///app/node_modules/axios/lib/adapters/http.js:577:25)
    at RedirectableRequest.emit (node:events:513:28)
    at RedirectableRequest.emit (node:domain:489:12)
    at ClientRequest.eventHandlers.<computed> (/app/node_modules/follow-redirects/index.js:14:24)
    at ClientRequest.emit (node:events:513:28)
    at ClientRequest.emit (node:domain:489:12)
    at Socket.socketErrorListener (node:_http_client:494:9)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12) {
  hostname: 'chatgpt-qq-chatgpt-1',
  syscall: 'getaddrinfo',
  code: 'ENOTFOUND',
  errno: -3008,
  config: {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: [ 'xhr', 'http' ],
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    env: { FormData: [Function], Blob: null },
    validateStatus: [Function: validateStatus],
    headers: AxiosHeaders {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/json',
      'User-Agent': 'axios/1.3.6',
      'Content-Length': '110',
      'Accept-Encoding': 'gzip, compress, deflate, br'
    },
    method: 'post',
    url: 'http://chatgpt-qq-chatgpt-1:8080/v2/chat',
    data: '{"message":"你是谁","session_id":"friend-tang2song4yuan2ming2qing1","username":"tang2song4yuan2ming2qing1"}'
  },
  request: <ref *1> Writable {
    _writableState: WritableState {
      objectMode: false,
      highWaterMark: 16384,
      finalCalled: false,
      needDrain: false,
      ending: false,
      ended: false,
      finished: false,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: true,
      bufferProcessing: false,
      onwrite: [Function: bound onwrite],
      writecb: null,
      writelen: 0,
      afterWriteTickInfo: null,
      buffered: [],
      bufferedIndex: 0,
      allBuffers: true,
      allNoop: true,
      pendingcb: 0,
      constructed: true,
      prefinished: false,
      errorEmitted: false,
      emitClose: true,
      autoDestroy: true,
      errored: null,
      closed: false,
      closeEmitted: false,
      [Symbol(kOnFinished)]: []
    },
    _events: [Object: null prototype] {
      response: [Function: handleResponse],
      error: [Function: handleRequestError],
      socket: [Function: handleRequestSocket]
    },
    _eventsCount: 3,
    _maxListeners: undefined,
    _options: {
      maxRedirects: 21,
      maxBodyLength: Infinity,
      protocol: 'http:',
      path: '/v2/chat',
      method: 'POST',
      headers: [Object: null prototype],
      agents: [Object],
      auth: undefined,
      beforeRedirect: [Function: dispatchBeforeRedirect],
      beforeRedirects: [Object],
      hostname: 'chatgpt-qq-chatgpt-1',
      port: '8080',
      agent: undefined,
      nativeProtocols: [Object],
      pathname: '/v2/chat'
    },
    _ended: false,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 110,
    _requestBodyBuffers: [ [Object] ],
    _onNativeResponse: [Function (anonymous)],
    _currentRequest: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: false,
      _last: true,
      chunkedEncoding: false,
      shouldKeepAlive: false,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '110',
      _hasBody: true,
      _trailer: '',
      finished: false,
      _headerSent: true,
      _closed: false,
      socket: [Socket],
      _header: 'POST /v2/chat HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'User-Agent: axios/1.3.6\r\n' +
        'Content-Length: 110\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: chatgpt-qq-chatgpt-1:8080\r\n' +
        'Connection: close\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      path: '/v2/chat',
      _ended: false,
      res: null,
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'chatgpt-qq-chatgpt-1',
      protocol: 'http:',
      _redirectable: [Circular *1],
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kEndCalled)]: false,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(kUniqueHeaders)]: null
    },
    _currentUrl: 'http://chatgpt-qq-chatgpt-1:8080/v2/chat',
    [Symbol(kCapture)]: false
  },
  cause: Error: getaddrinfo ENOTFOUND chatgpt-qq-chatgpt-1
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'chatgpt-qq-chatgpt-1'
  }
}
lcjqyml commented 1 year ago

是的,应该是chatgpt-qq_gocqhttp_1,教程写错了。