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

Client Error GotError #353

Closed
networkneil opened this issue Jul 19, 2023 · 22 comments
Closed

Client Error GotError #353

networkneil opened this issue Jul 19, 2023 · 22 comments
Labels
bug Something isn't working

Comments

@networkneil
Copy link

Describe The Bug:
Unable to connect to Hyundai Telematics API

To Reproduce:

  1. Adding the Plugin
  2. User settings
  3. save the configuration
  4. Homebridge dashboard shows the API error.

I tried using the same login on the Hyundai app and myhyundai website, both worked as expected.

Expected behavior:
The Dashboard should show its able to connect to Hyundai Telematics API and be able to perform various Vehicle tasks such as to lock and unlock
Logs:

Client Error GotError [RequestError]: write EPROTO C0C78E174B7F0000:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../deps/openssl/openssl/ssl/statem/extensions.c:922:

    at ClientRequest.<anonymous> (/var/lib/homebridge/node_modules/homebridge-hyundai-bluelink/node_modules/got/source/request-as-event-emitter.js:178:14)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.origin.emit (/var/lib/homebridge/node_modules/homebridge-hyundai-bluelink/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at TLSSocket.socketErrorListener (node:_http_client:502:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EPROTO',
  host: 'api.telematics.hyundaiusa.com',
  hostname: 'api.telematics.hyundaiusa.com',
  method: 'POST',
  path: '/v2/ac/oauth/token',
  socketPath: undefined,
  protocol: 'https:',
  url: 'https://api.telematics.hyundaiusa.com/v2/ac/oauth/token',
  gotOptions: {
    path: '/v2/ac/oauth/token',
    protocol: 'https:',
    slashes: true,
    auth: null,
    host: 'api.telematics.hyundaiusa.com',
    port: null,
    hostname: 'api.telematics.hyundaiusa.com',
    hash: null,
    search: null,
    query: null,
    pathname: '/v2/ac/oauth/token',
    href: 'https://api.telematics.hyundaiusa.com/v2/ac/oauth/token',
    retry: {
      retries: [Function (anonymous)],
      methods: [Set],
      statusCodes: [Set],
      errorCodes: [Set]
    },
    headers: {
      'user-agent': 'PostmanRuntime/7.26.10',
      client_id: 'REDACTED',
      client_secret: 'REDACTED',
      accept: 'application/json',
      'accept-encoding': 'gzip, deflate',
      'content-type': 'application/json',
      'content-length': 71
    },
    hooks: {
      beforeRequest: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: [],
      beforeError: [],
      init: []
    },
    decompress: true,
    throwHttpErrors: true,
    followRedirect: true,
    stream: false,
    form: false,
    json: true,
    cache: false,
    useElectronNet: false,
    method: 'POST',
    body: '{"username":"REDACTED","password":"REDACTED"}'
  }
}

Plugin Config:

{
    "credentials": {
        "username": "REDACTED",
        "password": "REDACTED",
        "region": "US",
        "brand": "hyundai",
        "pin": "REDACTED"
    },
    "vehicles": [
        {
            "vin": "REDACTED",
            "maxRange": 380
        }
    ],
    "remoteStart": {
        "airCtrl": true,
        "heating1": false,
        "defrost": false,
        "igniOnDuration": 10
    },
    "platform": "Hyundai",
    "_bridge": {
        "username": "REDACTED",
        "port": REDACTED
    }
}

Screenshots:

Environment:

  • Plugin Version: homebridge-hyundai-bluelink v1.4.1
  • Homebridge Version: Up To Date [v1.6.1]
  • Node.js Version: v18.16.0
  • NPM Version: 9.5.1
  • Operating System: Ubuntu Jammy Jellyfish (22.04.2 LTS)
@networkneil networkneil added the bug Something isn't working label Jul 19, 2023
@networkneil
Copy link
Author

Steps already taken:

  1. Restarted the Homebride server in the UI using "Force Service Restart"
  2. Restarted the VM
  3. Followed the instructions https:/SteffeyDev/homebridge-hyundai-bluelink#ssl-key-too-small
  4. Tried doing the Start and Stop using the Hyundai App and Hyundai website, both working as expected.

@fratinize
Copy link

Same here

@carlosgamezvillegas
Copy link

Same issue here. Sometimes when I restart the plug in I don't have the error but now it has been a day and still not working.

@carlosgamezvillegas
Copy link

carlosgamezvillegas commented Jul 23, 2023

Please see this post from the Bluelinky Github: Hacksore/bluelinky#254.
To work around the problem downgrading the Node to V16 is needed.

Kind regards,

@drumstix1020
Copy link

I couldn't find that thread, but I figured I'd at least try downgrading to Node v16. I tried to check my current Node version to no luck, the Raspberry Pi I'm running on seems to think it isn't installed - unless it isn't installed? I just reinstalled the OS fresh and am rebuilding my Homebridge setup. Maybe Node wasn't installed along the way with Homebridge or the system? Here are my logs, if anybody can look through to see if I'm getting something different from OP --

[8/11/2023, 1:38:47 AM] [Hyundai] Client Error GotError [RequestError]: write EPROTO C0BAFE76:error:0A000152:SSL routines:final_renegotiate:unsafe legacy renegotiation disabled:../deps/openssl/openssl/ssl/statem/extensions.c:922:

    at ClientRequest.<anonymous> (/var/lib/homebridge/node_modules/homebridge-hyundai-bluelink2/node_modules/got/source/request-as-event-emitter.js:178:14)
    at Object.onceWrapper (node:events:628:26)
    at ClientRequest.emit (node:events:525:35)
    at ClientRequest.origin.emit (/var/lib/homebridge/node_modules/homebridge-hyundai-bluelink2/node_modules/@szmarczak/http-timer/source/index.js:37:11)
    at TLSSocket.socketErrorListener (node:_http_client:502:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'EPROTO',
  host: 'api.telematics.hyundaiusa.com',
  hostname: 'api.telematics.hyundaiusa.com',
  method: 'POST',
  path: '/v2/ac/oauth/token',
  socketPath: undefined,
  protocol: 'https:',
  url: 'https://api.telematics.hyundaiusa.com/v2/ac/oauth/token',
  gotOptions: {
    path: '/v2/ac/oauth/token',
    protocol: 'https:',
    slashes: true,
    auth: null,
    host: 'api.telematics.hyundaiusa.com',
    port: null,
    hostname: 'api.telematics.hyundaiusa.com',
    hash: null,
    search: null,
    query: null,
    pathname: '/v2/ac/oauth/token',
    href: 'https://api.telematics.hyundaiusa.com/v2/ac/oauth/token',
    retry: {
      retries: [Function (anonymous)],
      methods: [Set],
      statusCodes: [Set],
      errorCodes: [Set]
    },
    headers: {
      'user-agent': 'PostmanRuntime/7.26.10',
      client_id: 'm66129Bb-em93-SPAHYN-bZ91-am4540zp19920',
      client_secret: 'v558o935-6nne-423i-baa8',
      accept: 'application/json',
      'accept-encoding': 'gzip, deflate',
      'content-type': 'application/json',
      'content-length': 70
    },
    hooks: {
      beforeRequest: [],
      beforeRedirect: [],
      beforeRetry: [],
      afterResponse: [],
      beforeError: [],
      init: []
    },
    decompress: true,
    throwHttpErrors: true,
    followRedirect: true,
    stream: false,
    form: false,
    json: true,
    cache: false,
    useElectronNet: false,
    method: 'POST',
    body: '{"username":"[email protected]","password":"cutwyh-2duwpo-josbuS"}'
  }
}

@carlosgamezvillegas
Copy link

I made some edits to the link so you might want to try again. If you have Homebridge UI installed it should be easy to identify the node version you are currently running.

I believe I used this command in Terminal to get the right node version: sudo hb-service update-node 16.13.0
IMG_2614

@drumstix1020
Copy link

That did the trick! I only edited your code slightly to get the updated 16.20.1 like in your screenshot instead of 16.13.0, and it worked perfectly. So excited to try this out now that the accessory is showing up in the Home app!

@fratinize
Copy link

Do we really have to down grade to an, as of this month am I supported version of node?
I'm sure there are lots of smart people out there that can't fix this. Wish my brain was big enough or I'd do it! If I can help the next maintainer pls reach out, I would love
To get this working again with out an unsupported version of node. Ty

@carlosgamezvillegas
Copy link

Unfortunately, the issue is with one of the dependencies of the plug-in. The people that made Bluelinky are fine with the workaround and are not in a hurry to fix it any time soon.

You can find more information here: Hacksore/bluelinky#254

Having an unsupported version of node is not necessarily bad u less other Homebridge have issues with it

@shpress
Copy link

shpress commented Nov 8, 2023

No longer able to downgrade below 16.18.2 and still getting the same error. @drumstix1020 What code did you edit and how please help!!

@carlosgamezvillegas
Copy link

@shpress, you can use this command in Terminal to install a working node.js version: sudo hb-service update-node 16.20.2

If id does not want to install the version check what hombridge version you have. I think the Homebridge 1.7 requieres node.js 18 at the least

@shpress
Copy link

shpress commented Nov 9, 2023

@carlosgamezvillegas So I was able t get to 16.20.2 but still getting this error homebridge-hyundai-bluelink] Status fetch error Cannot read properties of undefined (reading 'result')

@carlosgamezvillegas
Copy link

I just restated my hombridge to de if I got the same error but it loads just fine. Did you update anything else? Hombridge?

@shpress
Copy link

shpress commented Nov 9, 2023

So I try running a command from my Apple Home App and this is what happens:
[11/9/2023, 6:50:23 PM] [homebridge-hyundai-bluelink] Starting Vehicle
[2023-11-09 18:50:23] info: Begin pre-authentication
[11/9/2023, 6:50:28 PM] [homebridge-hyundai-bluelink] Start Response Vehicle started!

But nothing actually happens with the car. Sorry im somewhat technical but just so lost with this one.

@carlosgamezvillegas
Copy link

What Version of Hombridge are you using?

@shpress
Copy link

shpress commented Nov 10, 2023

1.7.0

OS: Ubuntu Focal Fossa (20.04.5 LTS)
Hostname: oznu-homebridge-1

@carlosgamezvillegas
Copy link

Probably that is the issue. Hombridge 1.7 does not support node.js 16. Try to downgrade Homebridge

@shpress
Copy link

shpress commented Nov 10, 2023

Just tried that on 1.6.1 still having the same issue.

@carlosgamezvillegas
Copy link

I am out of ideas. The only thing left is to do a fresh installation of Homebridge 1.6 in a different device to check if that fixes the issue.

@fratinize
Copy link

Do we really have to down grade to an, as of this month am I supported version of node? I'm sure there are lots of smart people out there that can't fix this. Wish my brain was big enough or I'd do it! If I can help the next maintainer pls reach out, I would love To get this working again with out an unsupported version of node. Ty

I am surprised the big brains around here haven’t taken control and fixed this looks like Bluetooth k has a new interface maybe someone can attach this and fix it ty let me k ow if I can help

@carlosgamezvillegas
Copy link

carlosgamezvillegas commented Dec 2, 2023

@fratinize, like it was mentioned before, the issue is not with this plugin it is with one of the dependencies. We need that to be fix first before this plugin can be fix. The dependency is Bluelinky l, and when I reached out to them about this issue they mentioned that one of their dependencies was causing the issue.

@fratinize
Copy link

fratinize commented Dec 2, 2023 via email

@networkneil networkneil closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants