Skip to content

Unable to send webhook and telegram notifications #165

Open
@mwnu

Description

@mwnu

Test messages can be sent to webhook and telegram, but when notifications are enabled in the monitor, messages cannot be sent.
This is the webhook error log:

Error: notification.test AxiosError: Request failed with status code 404
    at settle (file:///app/tianji/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/settle.js:19:12)
    ... 13 lines matching cause stack trace ...
    at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) {
  cause: AxiosError: Request failed with status code 404
      at settle (file:///app/tianji/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/settle.js:19:12)
      at IncomingMessage.handleStreamEnd (file:///app/tianji/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/http.js:599:11)
      at IncomingMessage.emit (node:events:530:35)
      at endReadableNT (node:internal/streams/readable:1698:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
      at Axios.request (file:///app/tianji/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/Axios.js:45:41)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async Object.send (file:///app/tianji/src/server/dist/src/server/model/notification/provider/webhook.js:10:9)
      at async sendNotification (file:///app/tianji/src/server/dist/src/server/model/notification/index.js:7:5)
      at async file:///app/tianji/src/server/dist/src/server/trpc/routers/notification.js:23:9
      at async resolveMiddleware (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:102:30)
      at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)
      at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)
      at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)
      at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24) {
    code: 'ERR_BAD_REQUEST',
    config: {
      transitional: [Object],
      adapter: [Array],
      transformRequest: [Array],
      transformResponse: [Array],
      timeout: 0,
      xsrfCookieName: 'XSRF-TOKEN',
      xsrfHeaderName: 'X-XSRF-TOKEN',
      maxContentLength: -1,
      maxBodyLength: -1,
      env: [Object],
      validateStatus: [Function: validateStatus],
      headers: [Object [AxiosHeaders]],
      method: 'post',
      url: 'https://notice.domain.com:8888/notice/tools/plugin/tianji/notice ';,
      data: '{"notification":{"workspaceId":"clnzoxcy10001vy2ohi4obbi0","name":"nzu-tianji","type":"webhook","payload":{"webhookUrl":"https://notice.domain.com:8888/notice/tools/plugin/tianji/notice ";}},"title":"nzu-tianji Notification Testing","content":"Tianji: Insight into everything\\nThis is Notification Testing from nzu-tianji\\n[image]","raw":[{"type":"title","level":2,"content":"Tianji: Insight into everything"},{"type":"text","content":"This is Notification Testing from nzu-tianji"},{"type":"newline"},{"type":"image","url":"https://tianji.msgbyte.com/img/social-card.png ";}],"time":"2025-02-23T08:10:51.021Z"}'
    },
    request: ClientRequest {
      _events: [Object: null prototype],
      _eventsCount: 7,
      _maxListeners: undefined,
      outputData: [],
      outputSize: 0,
      writable: true,
      destroyed: true,
      _last: false,
      chunkedEncoding: false,
      shouldKeepAlive: true,
      maxRequestsOnConnectionReached: false,
      _defaultKeepAlive: true,
      useChunkedEncodingByDefault: true,
      sendDate: false,
      _removedConnection: false,
      _removedContLen: false,
      _removedTE: false,
      strictContentLength: false,
      _contentLength: '619',
      _hasBody: true,
      _trailer: '',
      finished: true,
      _headerSent: true,
      _closed: true,
      socket: [TLSSocket],
      _header: 'POST /notice/tools/plugin/tianji/notice HTTP/1.1\r\n' +
        'Accept: application/json, text/plain, */*\r\n' +
        'Content-Type: application/json\r\n' +
        'User-Agent: tianji/1.18.5\r\n' +
        'Content-Length: 619\r\n' +
        'Accept-Encoding: gzip, compress, deflate, br\r\n' +
        'Host: notice.domain.com:8888\r\n' +
        'Connection: keep-alive\r\n' +
        '\r\n',
      _keepAliveTimeout: 0,
      _onPendingData: [Function: nop],
      agent: [Agent],
      socketPath: undefined,
      method: 'POST',
      maxHeaderSize: undefined,
      insecureHTTPParser: undefined,
      joinDuplicateHeaders: undefined,
      path: '/notice/tools/plugin/tianji/notice',
      _ended: true,
      res: [IncomingMessage],
      aborted: false,
      timeoutCb: null,
      upgradeOrConnect: false,
      parser: null,
      maxHeadersCount: null,
      reusedSocket: false,
      host: 'notice.domain.com',
      protocol: 'https:',
      _redirectable: [Writable],
      [Symbol(shapeMode)]: false,
      [Symbol(kCapture)]: false,
      [Symbol(kBytesWritten)]: 0,
      [Symbol(kNeedDrain)]: false,
      [Symbol(corked)]: 0,
      [Symbol(kOutHeaders)]: [Object: null prototype],
      [Symbol(errored)]: null,
      [Symbol(kHighWaterMark)]: 16384,
      [Symbol(kRejectNonStandardBodyWrites)]: false,
      [Symbol(kUniqueHeaders)]: null
    },
    response: {
      status: 404,
      statusText: 'Not Found',
      headers: [Object [AxiosHeaders]],
      config: [Object],
      request: [ClientRequest],
      data: '404: Not Found'
    },
    status: 404
  },
  code: 'INTERNAL_SERVER_ERROR',
  name: 'TRPCError'
}
POST /trpc/notification.test?batch=1 500 - - 57.822 ms

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions