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

"Failed to connect to IoT in AWS" error upon starting addon #345

Open
KlaeFox opened this issue Dec 29, 2024 · 3 comments
Open

"Failed to connect to IoT in AWS" error upon starting addon #345

KlaeFox opened this issue Dec 29, 2024 · 3 comments

Comments

@KlaeFox
Copy link

KlaeFox commented Dec 29, 2024

Govee Device SKU

H6008 and H6010

Govee2MQTT Version

2024.07.13-82ddc6e9

Describe the issue

I have a fresh install of Home Assistant, I have started with clean installs on my dedicated NUC and have continued to encounter this issue each time after reinstalling:

I have followed the guide multiple times, I have requested and applied a new API key each time. I have attempted the process with older API keys I have been issued, but I have encountered the same error. I have NOT tried every issued API key on a fresh install.

Startup Diagnostics

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
GOVEE_API_KEY=REDACTED
GOVEE_MQTT_HOST=core-mosquitto
GOVEE_TEMPERATURE_SCALE=C
GOVEE_EMAIL=REDACTED
GOVEE_PASSWORD=REDACTED
GOVEE_MQTT_PASSWORD=REDACTED
GOVEE_MQTT_USER=addons
GOVEE_MQTT_PORT=1883
++ cd /app
++ exec /app/govee serve
[2024-12-28T21:06:14 INFO govee::commands::serve] Starting service. version 2024.07.13-82ddc6e9
[2024-12-28T21:06:14 INFO govee::commands::serve] Querying platform API for device list
[2024-12-28T21:06:14 INFO govee::commands::serve] Querying undocumented API for device + room list
Error: failed to connect to IoT in AWS
Caused by:
hostname resolution error: Name does not resolve
Stack backtrace:
0: govee::service::iot::start_iot_client::{{closure}}
1: govee::commands::serve::ServeCommand::run::{{closure}}
2: govee::Args::run::{{closure}}
3: tokio::runtime::park::CachedParkThread::block_on
4: tokio::runtime::context::runtime::enter_runtime
5: tokio::runtime::runtime::Runtime::block_on
6: govee::main
7: std::sys_common::backtrace::__rust_begin_short_backtrace
8: std::rt::lang_start::{{closure}}
9: std::rt::lang_start_internal
10: main
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Additional Logs

No response

Home Assistant Logs

2024/12/29 04:58:55 Start mDNS broadcast
2024/12/29 04:58:55 Publish http://192.168.0.128:8123 to _home-assistant._tcp
2024/12/29 04:58:55 Start webserver on http://0.0.0.0:8123
2024/12/29 04:59:19 Proxy request: /supervisor/network/info
2024/12/29 04:59:19 Proxy request: /supervisor/supervisor/logs/follow
2024/12/29 04:59:24 Proxy request: /supervisor/network/info
2024/12/29 04:59:29 Proxy request: /supervisor/network/info
2024/12/29 04:59:35 Proxy request: /supervisor/network/info
2024/12/29 04:59:41 Proxy request: /supervisor/network/info
2024/12/29 04:59:47 Proxy request: /supervisor/network/info
2024/12/29 04:59:53 Proxy request: /supervisor/network/info
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service legacy-services: stopping
Unable to find configuration. Creating default one in /config
[05:03:29] INFO: Home Assistant Core finish process exit code 0
[05:03:29] INFO: Home Assistant Core service shutdown
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
2024-12-28 21:08:07.710 ERROR (MainThread) [homeassistant.components.hassio] Failed to to call /addons/b9845f46_govee2mqtt/stats - Container addon_b9845f46_govee2mqtt is not running

Anything else?

My instance is not currently connected to my Nabu Casa cloud account

Home Assistant

Core
2024.12.5
Supervisor
2024.12.0
Operating System
14.1
Frontend
20241127.8

@wez
Copy link
Owner

wez commented Dec 31, 2024

It sounds like there is a DNS issue resolving the mqtt hostname from AWS. If you set the Debug Filter to govee=trace you'll see more context about that.

Caution

Take care about sharing things here from that logging when trace is enabled, especially around IoT part, as it may include session tokens that grant access to your govee account

Govee's infrastructure isn't the best, plus the IoT API itself is undocumented and unsupported; this sort of connectivity issue will likely resolve itself after a day or so.

wez added a commit that referenced this issue Dec 31, 2024
This makes it easier to understand errors if trace logging is not
enabled.

refs: #345
@teeps
Copy link

teeps commented Jan 2, 2025

Hi, I'm seeing the same thing since the update just before the New Year:

[2025-01-02T14:04:57 INFO govee::commands::serve] Starting service. version 2025.01.01-ae1f0cc1
[2025-01-02T14:04:57 INFO govee::commands::serve] Querying platform API for device list
[2025-01-02T14:04:57 TRACE govee::cache] cache miss for device-list
[2025-01-02T14:04:58 INFO govee::commands::serve] Querying undocumented API for device + room list
[2025-01-02T14:04:58 TRACE govee::cache] cache miss for account-info
[2025-01-02T14:04:59 TRACE govee::service::iot] LoginAccountResponse {
a: REDACTED,
b: REDACTED,
account_id: REDACTED,
client: REDACTED,
is_savvy_user: false,
refresh_token: Some(
REDACTED,
),
client_name: Some(
"",
),
push_token: Some(
REDACTED,
),
version_code: Some(
"",
),
version_name: Some(
"",
),
sys_version: Some(
"",
),
token: REDACTED,
token_expire_cycle: 57600,
topic: REDACTED,
}
[2025-01-02T14:04:59 TRACE govee::cache] cache hit for iot-key
[2025-01-02T14:04:59 TRACE govee::service::iot] IotKey {
endpoint: "aqm3wd1qlc3dy-ats.iot.us-east-1.amazonaws.com",
log: "pro0",
p12: REDACTED,
p12_pass: REDACTED,
}
[2025-01-02T14:04:59 TRACE govee::service::iot] parsing IoT PFX key
[2025-01-02T14:04:59 TRACE govee::service::iot] Connecting to IoT aqm3wd1qlc3dy-ats.iot.us-east-1.amazonaws.com port 8883
Error: failed to connect to IoT aqm3wd1qlc3dy-ats.iot.us-east-1.amazonaws.com:8883 in AWS
Caused by:
hostname resolution error: Name does not resolve
Stack backtrace:
0: std::backtrace::Backtrace::create
1: anyhow::context::<impl anyhow::Context<T,E> for core::result::Result<T,E>>::with_context
2: govee::service::iot::start_iot_client::{{closure}}
3: govee::commands::serve::ServeCommand::run::{{closure}}
4: govee::Args::run::{{closure}}
5: tokio::runtime::park::CachedParkThread::block_on
6: tokio::runtime::runtime::Runtime::block_on
7: govee::main
8: std::sys::backtrace::__rust_begin_short_backtrace
9: std::rt::lang_start::{{closure}}
10: std::rt::lang_start_internal
11: main
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I ran nslookup from my homeassistant and confirmed that it can resolve aqm3wd1qlc3dy-ats.iot.us-east-1.amazonaws.com from the command line. My network is all IPv4 with no IPv6 routing, just in case that makes any difference.

@teeps
Copy link

teeps commented Jan 3, 2025

I updated again this morning and the connection is successful now, so whether by accident or design it looks better to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants