KevinBonnoron / node-red-contrib-freebox

4 stars 4 forks source link

Not able to perform calls #18

Closed ybizeul closed 2 years ago

ybizeul commented 3 years ago

It seems after rebooting the freebox I had to reconfigure the node, it worked once.

But now It doesn't seem I can make any API call anymore.

5 Aug 06:19:10 - [info] GET /connection
(node:17) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'method' of undefined
    at /data/node_modules/node-red-contrib-freebox/src/nodes/freebox-server/freebox-server.js:248:44
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at runNextTicks (internal/process/task_queues.js:66:3)
    at processImmediate (internal/timers.js:434:9)
5 Aug 06:19:10 - [info] POST /connection/ftth/
(node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 475)
5 Aug 06:19:10 - [error] post https://mafreebox.freebox.fr:443/api/v8/connection/ftth/ error: Error: Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream
    at createError (/data/node_modules/axios/lib/core/createError.js:16:15)
    at dispatchHttpRequest (/data/node_modules/axios/lib/adapters/http.js:71:23)
    at new Promise (<anonymous>)
    at httpAdapter (/data/node_modules/axios/lib/adapters/http.js:46:10)
    at dispatchRequest (/data/node_modules/axios/lib/core/dispatchRequest.js:52:10)
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  config: {
    url: 'https://mafreebox.freebox.fr:443/api/v8/connection/ftth/',
    method: 'post',
    data: 1628144350858,
    headers: {
      Accept: 'application/json, text/plain, */*',
      'Content-Type': 'application/x-www-form-urlencoded',
      'X-Fbx-App-Auth': undefined,
      'User-Agent': 'axios/0.21.1'
    },
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    adapter: [Function: httpAdapter],
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    httpsAgent: Agent {
      _events: [Object: null prototype],
      _eventsCount: 2,
      _maxListeners: undefined,
      defaultPort: 443,
      protocol: 'https:',
      options: [Object],
      requests: {},
      sockets: {},
      freeSockets: {},
      keepAliveMsecs: 1000,
      keepAlive: false,
      maxSockets: Infinity,
      maxFreeSockets: 256,
      maxTotalSockets: Infinity,
      totalSocketCount: 0,
      scheduling: 'fifo',
      maxCachedSessions: 100,
      _sessionCache: [Object],
      [Symbol(kCapture)]: false
    },
    validateStatus: [Function: validateStatus]
  },
  request: undefined,
  response: undefined,
  isAxiosError: true,
  toJSON: [Function: toJSON]
}
KevinBonnoron commented 3 years ago

Hello,

I am not at home right now but i will check this when i am home.

KevinBonnoron commented 3 years ago

I just pushed a new version 0.0.12 with some fixes and updates. Could you check that this fix your problem ?

KevinBonnoron commented 2 years ago

I closed the issue. Feel free to reopen if the issue is still here