Skip to content

IPv6 connectivity malfunction #412

@zenfinityy

Description

@zenfinityy

Describe the bug
My network does not support IPv6, but the plugin still tries to connect to Tuya servers (in this case openapi.tuyaeu.com) via IPv6 first.
Since there is no IPv6 connectivity, the request fails and does not fall back to IPv4, even though IPv4 is available and works.

Expected behavior
The plugin should either:

  • detect when IPv6 is unavailable and automatically fall back to IPv4, or
  • always prefer IPv4 if IPv6 cannot be reached.

Screenshots
N/A

Device info (please complete the following information, which can be found in log):
N/A

Device functions (please complete the following information, which can be found in log):
N/A

Additional info
Here are the logs cleaned with sensitive information redacted

[TuyaPlatform] Restarting child bridge...
Got SIGTERM, shutting down child bridge process...
[TuyaPlatform] Child bridge process ended
[TuyaPlatform] Process Ended. Code: 143, Signal: null
[TuyaPlatform] Restarting Process...
[TuyaPlatform] Launched child bridge with PID 252207
Registering platform 'homebridge-tuya-platform.TuyaPlatform'
[TuyaPlatform] Loaded homebridge-tuya-platform v1.5.0 child bridge successfully
Loaded 2 cached accessories from cachedAccessories.
Publishing bridge accessory (name: TuyaPlatform, publishInfo: {...}).
Homebridge v1.11.0 (TuyaPlatform) is running on port 39540.
[TuyaPlatform] Initializing TuyaPlatform platform...
[TuyaPlatform] Initializing child bridge
[TuyaPlatform] Launched child bridge with PID 252363
[TuyaPlatform] Loaded homebridge-tuya-platform v1.5.0 child bridge successfully
Publishing bridge accessory (name: yamaha-zone-tv, publishInfo: {...}).
Publishing bridge accessory (name: TuyaPlatform, publishInfo: {...}).
[TuyaPlatform] Restarting child bridge...
Got SIGTERM, shutting down child bridge process...
[TuyaPlatform] Child bridge process ended
[TuyaPlatform] Process Ended. Code: 143, Signal: null
[TuyaPlatform] Restarting Process...
[TuyaPlatform] Launched child bridge with PID 252738
Registering platform 'homebridge-tuya-platform.TuyaPlatform'
[TuyaPlatform] Loaded homebridge-tuya-platform v1.5.0 child bridge successfully
Loaded 0 cached accessories from cachedAccessories.
Publishing bridge accessory (name: TuyaPlatform, publishInfo: {...}).
Initializing TuyaPlatform...
TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaeu.com, path = /v1.0/iot-01/associated-users/actions/authorized-login, params = null, body = {...}, headers = {...}
Homebridge v1.11.0 (TuyaPlatform) is running on port 39540.
AggregateError: 
    at internalConnectMultiple (node:net:1134:18)
    at internalConnectMultiple (node:net:1210:5)
    at Timeout.internalConnectMultipleTimeout (node:net:1742:5)
    at listOnTimeout (node:internal/timers:590:11)
    at processTimers (node:internal/timers:523:7) {
  code: 'ETIMEDOUT',
  config: {...},
  request: <ref *1> Writable {...},
  response: undefined,
  isAxiosError: true,
  toJSON: [Function: toJSON],
  [errors]: [
    Error: connect ETIMEDOUT 3.69.78.245:443
    Error: connect ENETUNREACH 2a05:d014:afa:af00:568a:5cc6:4603:c040:443 - Local (:::0)
    Error: connect ETIMEDOUT 52.29.137.228:443
    Error: connect ENETUNREACH 2a05:d014:afa:af01:a30:a16:5141:f133:443 - Local (:::0)
    Error: connect ETIMEDOUT 52.57.166.16:443
    Error: connect ENETUNREACH 2a05:d014:afa:af02:6799:509:2d19:6de1:443 - Local (:::0)
  ]
}
Attention⚠️ ⚠️ ⚠️ ! You get an error!
Failed to get device information. Please check if the config.json is correct.

I'm using plugin version 1.5.0, homebridge version 1.11.0.
I can confirm after running

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

the problem is rectified, however this is a dirty fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions