收藏
回答

调用微信模版消息(业务通知)报错?

报错如下:

2021-02-13 19:23:16,951 ERROR 13938 [-/undefined/-/30004ms POST /node-jielong/record/sendMsg] 

 err: RequestError: Error: Client network socket disconnected before secure TLS connection was established

    at new RequestError (/data/jielong-node/node_modules/_request-promise-core@1.1.4@request-promise-core/lib/errors.js:14:15)

    at Request.plumbing.callback (/data/jielong-node/node_modules/_request-promise-core@1.1.4@request-promise-core/lib/plumbing.js:87:29)

    at Request.RP$callback [as _callback] (/data/jielong-node/node_modules/_request-promise-core@1.1.4@request-promise-core/lib/plumbing.js:46:31)

    at self.callback (/data/jielong-node/node_modules/_request@2.88.2@request/request.js:185:22)

    at Request.emit (events.js:315:20)

    at Request.onRequestError (/data/jielong-node/node_modules/_request@2.88.2@request/request.js:877:8)

    at ClientRequest.emit (events.js:315:20)

    at TLSSocket.socketErrorListener (_http_client.js:469:9)

    at TLSSocket.emit (events.js:315:20)

    at emitErrorNT (internal/streams/destroy.js:106:8)

    at emitErrorCloseNT (internal/streams/destroy.js:74:3)

    at processTicksAndRejections (internal/process/task_queues.js:80:21) {

  cause: Error: Client network socket disconnected before secure TLS connection was established

      at connResetException (internal/errors.js:607:14)

      at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)

      at TLSSocket.emit (events.js:327:22)

      at endReadableNT (internal/streams/readable.js:1327:12)

      at processTicksAndRejections (internal/process/task_queues.js:80:21) {

    code: 'ECONNRESET',

    path: null,

    host: 'api.weixin.qq.com',

    port: 443,

    localAddress: undefined

  },

  error: Error: Client network socket disconnected before secure TLS connection was established

      at connResetException (internal/errors.js:607:14)

      at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)

      at TLSSocket.emit (events.js:327:22)

      at endReadableNT (internal/streams/readable.js:1327:12)

      at processTicksAndRejections (internal/process/task_queues.js:80:21) {

    code: 'ECONNRESET',

    path: null,

    host: 'api.weixin.qq.com',

    port: 443,

    localAddress: undefined

  },

  options: {

    method: 'POST',

    url: 'https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=42_tj0br6_wdg0OECWU9B9j1fhtR9YdAXwX0UjSdJ79WzP8sGkpelrItq_hg66Ylvcf7DRC0IDXZA2ymfSwhdR3v5S0HzdAQydd5LHdCgoqnYSRbOBMN4TqWZJmnAtHQuUMkyUP-6faD7AqqdciTRMaAGACAV',

    json: true,

    body: {

      touser: 'oXDf-w-oVJXu8-YT2yaB',

      template_id: 'btUuZJgjtPejADpVqRyMBL6gcY_cZocwc',

      miniprogram: [Object],

      data: [Object]

    },

    callback: [Function: RP$callback],

    transform: undefined,

    simple: true,

    resolveWithFullResponse: false,

    transform2xxOnly: false

  },

  response: undefined

}


回答关注问题邀请回答
收藏

1 个回答

  • Vinlic
    Vinlic
    2021-02-13

    小程序模板消息已经弃用,请使用订阅消息:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html

    2021-02-13
    有用
    回复 3
    • 文强
      文强
      2021-02-14
      文档上没说弃用呀,用的是公众号的模板消息发送接口,昨天很多次调用报这个错误
      2021-02-14
      回复
    • Vinlic
      Vinlic
      发表于小程序端
      2021-02-14回复文强
      噢噢,公众号的,我仔细看了下这个错误,应该是请求连接问题,网络相关
      2021-02-14
      回复
    • 文强
      文强
      2021-02-14回复Vinlic
      是啊,请求超时,最近两天经常出现,估计是调用这个接口的人数较多造成的,原来没出现过
      2021-02-14
      回复
登录 后发表内容
问题标签