ioBroker.unifi icon indicating copy to clipboard operation
ioBroker.unifi copied to clipboard

Error timeout Axios

Open 1onar opened this issue 1 year ago • 23 comments

[updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/axios/lib/adapters/http.js:643:16) at RedirectableRequest.emit (node:events:517:28) at RedirectableRequest.emit (node:domain:489:12) at Timeout.<anonymous> (/opt/iobroker/node_modules/follow-redirects/index.js:169:12) at listOnTimeout (node:internal/timers:569:17) at processTimers (node:internal/timers:512:7)

1onar avatar Dec 16 '23 08:12 1onar

image

Same here

UniFi OS v3.2.7 Network Version 8.0.24 Protect Version 2.10.11

Fontheweg avatar Dec 18 '23 18:12 Fontheweg

same here after updating to OS v3.2.7 [updateUnifiData-login site undefined] error: Request failed with status code 401, stack: AxiosError: Request failed with status code 401 at settle (/opt/iobroker/node_modules/node-unifi/node_modules/axios/lib/core/settle.js:19:12) at IncomingMessage.handleStreamEnd (/opt/iobroker/node_modules/node-unifi/node_modules/axios/lib/adapters/http.js:570:11) at IncomingMessage.emit (node:events:525:35) at IncomingMessage.emit (node:domain:489:12) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)

Error site undefined (data): {"error":{"code":401,"message":"Unauthorized"}}

chris199512 avatar Dec 18 '23 19:12 chris199512

Same here. OS 3.2.7

[updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (C:\Program Files\ioBroker\node_modules\axios\lib\adapters\http.js:643:16) at RedirectableRequest.emit (node:events:517:28) at RedirectableRequest.emit (node:domain:489:12) at Timeout.<anonymous> (C:\Program Files\ioBroker\node_modules\follow-redirects\index.js:179:12) at listOnTimeout (node:internal/timers:569:17) at processTimers (node:internal/timers:512:7)

Pino72de avatar Dec 20 '23 11:12 Pino72de

For the Unifi-Protect Adapter the problem is solved: https://github.com/peterbaumert/ioBroker.unifi-protect/pull/199/files?diff=split&w=0

I modified my main.js an the adater is running now. I tried to compare the main.js from unifi-protect with the main.js from unifi, but there are many differences and I can't figure out how the login is done here ... So I hope somebody can adopt the solution from the unifi-protect adapter.

Fontheweg avatar Dec 20 '23 21:12 Fontheweg

with the update of the adapter to 0.6.7 beta it works

chris199512 avatar Dec 28 '23 13:12 chris199512

@mcm1957 why close this issue? Where is the fix. I can't see a mentioned 0.6.7 "beta". The last commit is 3 weeks ago.

1onar avatar Dec 30 '23 10:12 1onar

a) According to chris199512 's posting two days ago the adapter works with 0.6.7. So 've marked the issue as fixed.

b) If you cannot install 0.6.7 please open a topic at forum (https://forum.iobroker.net) This release ist available at latest and at stable repository. If you do not see it, there could be something wrong with you installation.

image

c) If the problem still exists with adapter release 0.6.7 please attach a log and note the currently used versions of releavant adapters (Adpater - should be 0.6.7, js-controller, node, o/s)

mcm1957 avatar Dec 30 '23 10:12 mcm1957

a) The adapter functions, but it still triggers errors. Perhaps you misunderstood @chris199512's post. The error has not been resolved.

b) 0.6.7 is installed. But thank you for your advise.

c) Yes, it does:

  • Adapter: 0.6.7
  • js-controller: 5.0.17
  • node.js: v18.19.0

time: 2023-12-30 11:31:15.497 debug: error

[updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/axios/lib/adapters/http.js:643:16) at RedirectableRequest.emit (node:events:517:28) at RedirectableRequest.emit (node:domain:489:12) at Timeout.<anonymous> (/opt/iobroker/node_modules/follow-redirects/index.js:169:12) at listOnTimeout (node:internal/timers:569:17) at processTimers (node:internal/timers:512:7)

Bildschirmfoto 2023-12-30 um 11 36 15 Bildschirmfoto 2023-12-30 um 11 36 29

1onar avatar Dec 30 '23 10:12 1onar

Thanks for detailled feedback. I've removed the fixed label.

mcm1957 avatar Dec 30 '23 10:12 mcm1957

Thanks for detailled feedback. I've removed the fixed label.

Thank you! My initial post should have been more detailed.

1onar avatar Dec 30 '23 11:12 1onar

After a few days I don't get the error, but the clients aren't updating again. So the fix only fixed the login, which was also where this error was thrown. Sorry, it looked like it was working

chris199512 avatar Dec 30 '23 11:12 chris199512

Same here, reinstalled 0.6.7 over the "old" 0.6.7 and still I get the error and no updates after a while. Still the issue is not fixed. No idea where I can get the link for a possbile "beta" version...used the link from this github repo.

unifi.0 2023-12-30 10:23:52.104 error [updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (C:\Program Files\ioBroker\node_modules\node-unifi\node_modules\axios\lib\adapters\http.js:643:16) at RedirectableRequest.emit (node:events:517:28) at RedirectableRequest.emit (node:domain:489:12) at Timeout.<anonymous> (C:\Program Files\ioBroker\node_modules\follow-redirects\index.js:179:12) at listOnTimeout (node:internal/timers:569:17) at processTimers (node:internal/timers:512:7)

Pino72 avatar Dec 30 '23 11:12 Pino72

I'm very interested in a solution. Is anyone here still actively working on the problem? What other logs are needed to locate the problem?

Knallix avatar Jan 05 '24 19:01 Knallix

Anyone feels motivated to look into it? did not have time yet :-(

Rello avatar Jan 27 '24 16:01 Rello

@jens-maus @Scrounger

Any chance to take a look? I don't have any matching equipment so I cannot do anything here.

mcm1957 avatar Jan 27 '24 17:01 mcm1957

hi ... is there already a solution?

Hant0r avatar Mar 11 '24 20:03 Hant0r

Would be really great if a Developer can take a look ...

nevermind2001 avatar Apr 06 '24 13:04 nevermind2001

New version 0.7.0 seems to have solved this issue :-)!! Thanks.

Pino72de avatar May 02 '24 08:05 Pino72de

Well, so I thought. Problem still exists:

[updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (C:\ioBroker\node_modules\node-unifi\node_modules\axios\lib\adapters\http.js:643:16) at RedirectableRequest.emit (node:events:517:28) at RedirectableRequest.emit (node:domain:489:12) at Timeout.<anonymous> (C:\ioBroker\node_modules\follow-redirects\index.js:210:12) at listOnTimeout (node:internal/timers:569:17) at processTimers (node:internal/timers:512:7)

Pino72 avatar May 04 '24 06:05 Pino72

Fehler besteht auch noch bei V 0.7.0

unifi.0 | 2024-05-28 23:35:41.748 | error | [updateUnifiData-login site undefined] error: timeout of 10000ms exceeded, stack: AxiosError: timeout of 10000ms exceeded at RedirectableRequest.handleRequestTimeout (/opt/iobroker/node_modules/node-unifi/node_modules/axios/lib/adapters/http.js:643:16) at RedirectableRequest.emit (node:events:519:28) at RedirectableRequest.emit (node:domain:488:12) at Timeout.<anonymous> (/opt/iobroker/node_modules/follow-redirects/index.js:210:12) at listOnTimeout (node:internal/timers:573:17) at processTimers (node:internal/timers:514:7)

Negalein avatar May 28 '24 21:05 Negalein

There are several errors. the 4 upper ones come from the sentry plugin, if this is enabled. it is not catching the "undefined" correctly and brakes painfully. we can improve this later...

Bildschirmfoto 2024-06-10 um 15 05 15

the main error is triggered here https://github.com/iobroker-community-adapters/ioBroker.unifi/blob/master/main.js#L269

try { await defaultController.login(); } catch (err) { this.handleError(err, undefined, 'updateUnifiData-login');

@Fontheweg you are doing the login yourself in your codeing. this Adapter here is using the node-unifi from @jens-maus and here it seems, that the timeout is exceeded here https://github.com/jens-maus/node-unifi/blob/master/unifi.js#L114

@Fontheweg I am not sure about your fix to protect. Do you have any input when comparing this to the node-unifi? I am not sure if just raising the timeout >10seconds would help?

Rello avatar Jun 10 '24 13:06 Rello

I raised the timeout to 30 seconds and did not have any issues since then. Perhaps the unifi is just a little slower than 10 seconds form time to time? I would submit a pull to raise this to 30s and hope we are done then

Rello avatar Jun 12 '24 06:06 Rello

I did not receive any further errors. will provide the pull for review...

Rello avatar Jun 13 '24 15:06 Rello