Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Extend Pwd-Size from 15 Chars to 32, document it and check for the length. #19

Closed
jpwenzel opened this issue Oct 29, 2020 · 6 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jpwenzel
Copy link
Contributor

I have installed the adapter in my Docker-based ioBroker installation and performed basic configuration through the Web UI (Dyson login credentials, region etc.). The adapter instance fails to start with these messages in the (debug) log:

2020-10-29 10:04:30.566 - info: host.9bac9de985e1 "system.adapter.dysonairpurifier.0" enabled
2020-10-29 10:04:30.572 - info: host.9bac9de985e1 instance system.adapter.dysonairpurifier.0 started with pid 617
2020-10-29 10:04:30.870 - debug: dysonairpurifier.0 (617) Redis Objects: Use Redis connection: 127.0.0.1:9001
2020-10-29 10:04:30.882 - debug: dysonairpurifier.0 (617) Objects client ready ... initialize now
2020-10-29 10:04:30.883 - debug: dysonairpurifier.0 (617) Objects create System PubSub Client
2020-10-29 10:04:30.883 - debug: dysonairpurifier.0 (617) Objects create User PubSub Client
2020-10-29 10:04:30.883 - debug: dysonairpurifier.0 (617) Objects client initialize lua scripts
2020-10-29 10:04:30.886 - debug: dysonairpurifier.0 (617) Objects connected to redis: 127.0.0.1:9001
2020-10-29 10:04:30.888 - debug: dysonairpurifier.0 (617) objectDB connected
2020-10-29 10:04:30.889 - debug: dysonairpurifier.0 (617) Redis States: Use Redis connection: 127.0.0.1:9000
2020-10-29 10:04:30.890 - debug: dysonairpurifier.0 (617) States create User PubSub Client
2020-10-29 10:04:30.891 - debug: dysonairpurifier.0 (617) States create System PubSub Client
2020-10-29 10:04:30.893 - debug: dysonairpurifier.0 (617) States connected to redis: 127.0.0.1:9000
2020-10-29 10:04:30.893 - debug: dysonairpurifier.0 (617) statesDB connected
2020-10-29 10:04:31.465 - info: dysonairpurifier.0 (617) starting. Version 0.5.1 in /opt/iobroker/node_modules/iobroker.dysonairpurifier, node: v10.23.0, js-controller: 3.1.6
2020-10-29 10:04:31.474 - debug: dysonairpurifier.0 (617) Entering Function [configIsValid]
2020-10-29 10:04:31.474 - debug: dysonairpurifier.0 (617) Locale: de
2020-10-29 10:04:31.474 - debug: dysonairpurifier.0 (617) pollInterval: 30
2020-10-29 10:04:31.475 - debug: dysonairpurifier.0 (617) System secrect resolved. Using for decryption.
2020-10-29 10:04:31.476 - debug: dysonairpurifier.0 (617) Signing in into dyson API.
2020-10-29 10:04:31.518 - silly: dysonairpurifier.0 (617) States system redis pmessage system.adapter.dysonairpurifier.0.logLevel/system.adapter.dysonairpurifier.0.logLevel:{"val":"silly","ack":true,"ts":1603962271496,"q":0,"from":"system.adapter.dysonairpurifier.0","lc":1603962271496}
2020-10-29 10:04:31.751 - error: dysonairpurifier.0 (617) Error during dyson API login:Error: Request failed with status code 401, Callstack: Error: Request failed with status code 401
at createError (/opt/iobroker/node_modules/iobroker.dysonairpurifier/node_modules/axios/lib/core/createError.js:16:15)
at settle (/opt/iobroker/node_modules/iobroker.dysonairpurifier/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/opt/iobroker/node_modules/iobroker.dysonairpurifier/node_modules/axios/lib/adapters/http.js:244:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
2020-10-29 10:04:31.752 - error: dysonairpurifier.0 (617) [error.response.data]: [object Object]
2020-10-29 10:04:31.752 - error: dysonairpurifier.0 (617) [error.response.status]: 401
2020-10-29 10:04:31.752 - error: dysonairpurifier.0 (617) [error.response.headers]: [object Object]
2020-10-29 10:04:31.756 - error: dysonairpurifier.0 (617) [main()] error: Converting circular structure to JSON, stack: TypeError: Converting circular structure to JSON
at JSON.stringify ()
at dysonAPILogIn.then.catch (/opt/iobroker/node_modules/iobroker.dysonairpurifier/main.js:547:61)
at process._tickCallback (internal/process/next_tick.js:68:7)

@Grizzelbee
Copy link
Owner

Hmm. Strange. This code part worked much better in the past - relating the error handling.

But a few things I can see:

  1. node: v10.23.0 - Think about updating to the current version 12.x as it is the mainstream version; 14.x is already the offical LTS Version
  2. Error during dyson API login:Error: Request failed with status code 401, Callstack: Error: Request failed with status code 401
    HTTP 401 is the usual "Unauthorized" - meaning your credentials aren't well. Please doublecheck them first.

@Grizzelbee Grizzelbee added bug Something isn't working help wanted Extra attention is needed labels Oct 29, 2020
@jpwenzel
Copy link
Contributor Author

Thanks for the fast feedback!

  1. I will be upgrading node and build a newer Docker image, thanks!
  2. Triple-checked. :) The credentials are stored in a key-vault and copy-pasted from there. They work in the Dyson app as well as in the Web UI (16 random characters and symbols).

@jpwenzel
Copy link
Contributor Author

<input class="value" id="Password" type="password" maxlength="15">

I think I found the issue... :D

@jpwenzel
Copy link
Contributor Author

I created a password with 15 characters only, this allowed me to log in. :)
Now you have another beta tester with a DP01! 👍

@Grizzelbee Grizzelbee changed the title Can't connect to Dyson API Bug: Extend Pwd-Size from 15 Chars to 20, document it and check for the length. Oct 29, 2020
@Grizzelbee
Copy link
Owner

Thanks for your Effort finding this issue.
Updated the title and going to fix this and the crappy error handling.

@Grizzelbee Grizzelbee self-assigned this Oct 29, 2020
@Grizzelbee Grizzelbee changed the title Bug: Extend Pwd-Size from 15 Chars to 20, document it and check for the length. Bug: Extend Pwd-Size from 15 Chars to 32, document it and check for the length. Oct 29, 2020
Grizzelbee added a commit that referenced this issue Oct 29, 2020
Grizzelbee added a commit that referenced this issue Oct 29, 2020
@Grizzelbee
Copy link
Owner

Is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants