iobroker-community-adapters / ioBroker.unifi

ioBroker.unifi is an ioBroker adapter for your UniFi network devices.
MIT License
73 stars 24 forks source link

Error timeout Axios #731

Open 1onar opened 8 months ago

1onar commented 8 months ago

[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)

Fontheweg commented 8 months ago

image

Same here

UniFi OS v3.2.7 Network Version 8.0.24 Protect Version 2.10.11

chris199512 commented 8 months ago

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"}}

Pino72de commented 8 months ago

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)

Fontheweg commented 8 months ago

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.

chris199512 commented 8 months ago

with the update of the adapter to 0.6.7 beta it works

1onar commented 8 months ago

@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.

mcm1957 commented 8 months ago

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)

1onar commented 8 months ago

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:

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
mcm1957 commented 8 months ago

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

1onar commented 8 months ago

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

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

chris199512 commented 8 months ago

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

Pino72 commented 8 months ago

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)

Knallix commented 8 months ago

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?

Rello commented 7 months ago

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

mcm1957 commented 7 months ago

@jens-maus @Scrounger

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

Hant0r commented 6 months ago

hi ... is there already a solution?

nevermind2001 commented 5 months ago

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

Pino72de commented 4 months ago

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

Pino72 commented 4 months ago

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)

Negalein commented 3 months ago

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)
Rello commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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