CoolKit-Technologies / ha-addon

Apache License 2.0
255 stars 116 forks source link

Login failed, axios error #85

Closed LaserLV52 closed 1 year ago

LaserLV52 commented 2 years ago

I have installed eWeLink Smart Home with version: 1.2.6 successfully. Also, i can open to the web ui of eWeLink Smart Home. But, when i want to sign in my account, it shows "Login failed, axios error". What is that mean? How can i solve it? Thanks!

niezw commented 1 year ago

When the network fluctuates, the server will not be accessible; if a similar situation occurs, it is recommended that you provide the log of addon.

If you have any more questions, please reopen this issues. Thank you for your reply.

vmassahi commented 10 months ago

I have the same issue. I can easily log into my account on anroid app and also web. but keep getting this error on HA. it is worth to be mentioned that on the configuration tab there is no box to enter auth token (just the network port). is it related?

here is the log on ewelink addon: _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: 10485760, protocol: 'https:', path: '/v2/user/login', method: 'POST', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: 'as-apia.coolkit.cc', port: null, nativeProtocols: [Object], pathname: '/v2/user/login' }, _ended: false, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 92, _requestBodyBuffers: [ [Object] ], _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: false, _headerSent: true, socket: [TLSSocket], _header: 'POST /v2/user/login HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'Content-Type: application/json\r\n' + 'X-CK-Nonce: K1pdDJvq\r\n' + 'X-CK-Appid: 4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak\r\n' + 'Authorization: Sign LP4PLS5ygWY2pNqcvcSsB1NH/o5dSrEmT/zPmXrLKe8=\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Content-Length: 92\r\n' + 'Host: as-apia.coolkit.cc\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/v2/user/login', _ended: false, res: null, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'as-apia.coolkit.cc', protocol: 'https:', _redirectable: [Circular *1],

  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'https://as-apia.coolkit.cc/v2/user/login',
_timeout: null,
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] } 2023-09-15T12:02:12.422Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:02:12.467Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:02:12.467Z [ERROR] getDataSync: diy.json -> no data 2023-09-15T12:02:34.093Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:04:34.099Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:06:34.107Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:08:34.112Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:10:34.118Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:12:11.170Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:12:11.189Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:12:11.190Z [ERROR] getDataSync: diy.json -> no data

LaserLV52 commented 10 months ago

I have the same issue. I can easily log into my account on anroid app and also web. but keep getting this error on HA. it is worth to be mentioned that on the configuration tab there is no box to enter auth token (just the network port). is it related?

here is the log on ewelink addon: _maxListeners: undefined, _options: { maxRedirects: 21, maxBodyLength: 10485760, protocol: 'https:', path: '/v2/user/login', method: 'POST', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: 'as-apia.coolkit.cc', port: null, nativeProtocols: [Object], pathname: '/v2/user/login' }, _ended: false, _ending: true, _redirectCount: 0, _redirects: [], _requestBodyLength: 92, _requestBodyBuffers: [ [Object] ], _onNativeResponse: [Function (anonymous)], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 7, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, destroyed: false, _last: true, chunkedEncoding: false, shouldKeepAlive: false, _defaultKeepAlive: true, useChunkedEncodingByDefault: true, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: null, _hasBody: true, _trailer: '', finished: false, _headerSent: true, socket: [TLSSocket], header: 'POST /v2/user/login HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /_\r\n' + 'Content-Type: application/json\r\n' + 'X-CK-Nonce: K1pdDJvq\r\n' + 'X-CK-Appid: 4s1FXKC9FaGfoqXhmXSJneb3qcm1gOak\r\n' + 'Authorization: Sign LP4PLS5ygWY2pNqcvcSsB1NH/o5dSrEmT/zPmXrLKe8=\r\n' + 'User-Agent: axios/0.21.4\r\n' + 'Content-Length: 92\r\n' + 'Host: as-apia.coolkit.cc\r\n' + 'Connection: close\r\n' + '\r\n', _keepAliveTimeout: 0, _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'POST', maxHeaderSize: undefined, insecureHTTPParser: undefined, path: '/v2/user/login', _ended: false, res: null, aborted: false, timeoutCb: null, upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, host: 'as-apia.coolkit.cc', protocol: 'https:', _redirectable: [Circular *1], [Symbol(kCapture)]: false, [Symbol(kNeedDrain)]: false, [Symbol(corked)]: 0, [Symbol(kOutHeaders)]: [Object: null prototype] }, _currentUrl: 'https://as-apia.coolkit.cc/v2/user/login', _timeout: null, [Symbol(kCapture)]: false }, response: undefined, isAxiosError: true, toJSON: [Function: toJSON] } 2023-09-15T12:02:12.422Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:02:12.467Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:02:12.467Z [ERROR] getDataSync: diy.json -> no data 2023-09-15T12:02:34.093Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:04:34.099Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:06:34.107Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:08:34.112Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:10:34.118Z [INFO] HA-WS heart beat result: "pong" 2023-09-15T12:12:11.170Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:12:11.189Z [ERROR] getDataSync: user.json -> no data 2023-09-15T12:12:11.190Z [ERROR] getDataSync: diy.json -> no data

I'm not really sure. I need to enter my account and password when I log in. Finally, my problem was solved by adding the country code in front of the account phone number.

vmassahi commented 10 months ago

Thanks for the reply. I eneded up creating another account with a different country code. and it somehome fixed the problem.