supervisor icon indicating copy to clipboard operation
supervisor copied to clipboard

Error: Activating connection failed, check connection settings - While attempting to change IP address

Open eborchardt opened this issue 2 years ago • 7 comments

Describe the issue you are experiencing

Here is the original issue, which is now closed: https://github.com/home-assistant/supervisor/issues/3610

I'm still having the same issue even after switching to beta and upgrading Supervisor to 2022.06.1.

[core-ssh ~]$ ha network update wlan0 --ipv4-method static --ipv4-address 192.168.0.89/24
Error: Activating connection failed, check connection settings.

With debug logging:

[core-ssh ~]$ ha network update wlan0 --ipv4-method static --ipv4-address 192.168.0.89/24 --log-level debug
DEBU[0000] Adding homedir to searchpath                  homedir=/root
INFO[0000] No configfile found
DEBU[0000] Debug flags                                   apiToken=3e97abfda438e8034e19be54bf829b748fde369ae2da1e588ddde328ca1d1cd5fec03f9caa900d6504cb0abb206d2265d9a1c6334d0aafe4 cfgFile= endpoint=supervisor logLevel=debug noProgress=false rawJSON=false
DEBU[0000] network update                                args="[wlan0]"
DEBU[0000] [GenerateURI]                                 base=supervisor command="interface/{interface}/update" section=network
DEBU[0000] [GenerateURI] Result                          uri="http://supervisor/network/interface/{interface}/update" url="http://supervisor/network/interface/%7Binterface%7D/update" url(string)="http://supervisor/network/interface/{interface}/update"
DEBU[0000] Request body                                  options="map[enabled:true ipv4:map[address:[192.168.0.89/24] method:static]]"
DEBU[0000] Response                                      body="{\"result\": \"error\", \"message\": \"Activating connection failed, check connection settings.\"}" fields.time=136.189609ms headers="map[Content-Length:[90] Content-Type:[application/json; charset=utf-8] Date:[Mon, 27 Jun 2022 20:02:31 GMT] Server:[Python/3.9 aiohttp/3.8.1]]" received-at="2022-06-27 15:02:31.436911017 -0500 CDT m=+0.145869673" request="&{POST http://supervisor/network/interface/wlan0/update HTTP/1.1 1 1 map[Accept:[application/json] Authorization:[Bearer 3e97abfda438e8034e19be54bf829b748fde369ae2da1e588ddde328ca1d1cd5fec03f9caa900d6504cb0abb206d2265d9a1c6334d0aafe4] Content-Type:[application/json] User-Agent:[go-resty/2.7.0 (https://github.com/go-resty/resty)]] 0x40001a1830 0x2a24d0 73 [] false supervisor map[] map[] <nil> map[]   <nil> <nil> <nil> 0x4000138048}" status="400 Bad Request" statuscode=400
Error: Activating connection failed, check connection settings.

What is the used version of the Supervisor?

2022.6.1

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

What is the version of your installed operating system?

8.2

What version of Home Assistant Core is installed?

2022.6.7

Steps to reproduce the issue

Go to Configuration -> System -> Network Expand IPv4 under Configure network interfaces. Select Static instead of DHCP and try to save.

Anything in the Supervisor logs that might be useful for us?

Supervisor log:

22-06-27 15:17:39 INFO (MainThread) [supervisor.api.middleware.security] /network/interface/wlan0/update access from core_ssh
22-06-27 15:17:39 DEBUG (MainThread) [supervisor.host.network] Create new configuration for wlan0
22-06-27 15:17:39 DEBUG (MainThread) [supervisor.utils.dbus] ...arg ('a{sa{sv}}', {'connection': {'id': <dbus_next.signature.Variant ('s', Supervisor wlan0)>, 'type': <dbus_next.signature.Variant ('s', 802-11-wireless)>, 'uuid': <dbus_next.signature.Variant ('s', 5458ee90-5af7-4cd7-a927-c9dee018498a)>, 'llmnr': <dbus_next.signature.Variant ('i', 2)>, 'mdns': <dbus_next.signature.Variant ('i', 2)>, 'interface-name': <dbus_next.signature.Variant ('s', wlan0)>}, 'ipv4': {'method': <dbus_next.signature.Variant ('s', manual)>, 'dns': <dbus_next.signature.Variant ('au', [16820416])>, 'address-data': <dbus_next.signature.Variant ('aa{sv}', [{'address': <dbus_next.signature.Variant ('s', 192.168.0.89)>, 'prefix': <dbus_next.signature.Variant ('u', 24)>}])>, 'gateway': <dbus_next.signature.Variant ('s', 192.168.0.1)>}, 'ipv6': {'method': <dbus_next.signature.Variant ('s', auto)>}, '802-11-wireless': {'assigned-mac-address': <dbus_next.signature.Variant ('s', preserve)>, 'ssid': <dbus_next.signature.Variant ('ay', b'TheBatcave')>, 'mode': <dbus_next.signature.Variant ('s', infrastructure)>, 'powersave': <dbus_next.signature.Variant ('i', 1)>, 'security': <dbus_next.signature.Variant ('s', 802-11-wireless-security)>}, '802-11-wireless-security': {'auth-alg': <dbus_next.signature.Variant ('s', open)>, 'key-mgmt': <dbus_next.signature.Variant ('s', wpa-psk)>}}) (type <class 'tuple'>)
22-06-27 15:17:39 DEBUG (MainThread) [supervisor.utils.dbus] ...arg ('o', '/org/freedesktop/NetworkManager/Devices/4') (type <class 'tuple'>)
22-06-27 15:17:39 DEBUG (MainThread) [supervisor.utils.dbus] ...arg ('o', '/') (type <class 'tuple'>)
22-06-27 15:17:39 DEBUG (MainThread) [supervisor.utils.dbus] Call org.freedesktop.NetworkManager.AddAndActivateConnection on /org/freedesktop/NetworkManager
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Connect to D-Bus: org.freedesktop.NetworkManager - /org/freedesktop/NetworkManager/Settings/20
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Call org.freedesktop.NetworkManager.Settings.Connection.GetSettings on /org/freedesktop/NetworkManager/Settings/20
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Connect to D-Bus: org.freedesktop.NetworkManager - /org/freedesktop/NetworkManager/ActiveConnection/31
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] ...arg org.freedesktop.NetworkManager.Connection.Active (type <class 'str'>)
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/ActiveConnection/31
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.host.network] add_and_activate_connection returns /org/freedesktop/NetworkManager/ActiveConnection/31
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Install match for signal org.freedesktop.NetworkManager.Connection.Active.StateChanged
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] ...arg org.freedesktop.NetworkManager.Connection.Active (type <class 'str'>)
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Call org.freedesktop.DBus.Properties.GetAll on /org/freedesktop/NetworkManager/ActiveConnection/31
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Signal message received [1, 0], org.freedesktop.NetworkManager.Connection.Active.StateChanged object /org/freedesktop/NetworkManager/ActiveConnection/31
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.host.network] Active connection state changed to 1
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.utils.dbus] Signal message received [4, 3], org.freedesktop.NetworkManager.Connection.Active.StateChanged object /org/freedesktop/NetworkManager/ActiveConnection/31
22-06-27 15:17:40 DEBUG (MainThread) [supervisor.host.network] Active connection state changed to 4


### Additional information

_No response_

eborchardt avatar Jun 27 '22 20:06 eborchardt

You're only entering the IP address from the looks of it. For a valid static config you need an ip address, a gateway and a DNS server. Did you enter the other pieces previously and just not show that or are you missing those?

mdegat01 avatar Jun 27 '22 20:06 mdegat01

Originally, I tried using the web UI to make the change. However, after finding #3610 and reading the comments there, I tried using the CLI. image image

eborchardt avatar Jun 27 '22 20:06 eborchardt

I tried with all three in CLI to be certain:

[core-ssh ~]$ ha network update wlan0 --ipv4-method static --ipv4-address 192.168.0.89/24 --ipv4-gateway 192.168.0.1 --ipv4-nameserver 192.168.0.1
Error: Activating connection failed, check connection settings.

eborchardt avatar Jun 27 '22 20:06 eborchardt

I ended up making a full backup and restoring it to a fresh installation. Now the network settings can be changed and saved successfully.

eborchardt avatar Jul 19 '22 01:07 eborchardt

Hi, I have exactly the same issue. Does anybody have a solution that does not include fresh installation?

mrazekfilip avatar Jul 22 '22 15:07 mrazekfilip

I believe I am having the same exact problem. I installed Home Assistant on a Raspberry Pi 4 B 4GB. Then I restored a full backup I took from a working Home Assistant VM (fully up-to-date before I created the backup) to the Pi. DHCP over ethernet worked great after it finished the restore, but I can't manage to get it to connect to WiFi.

The problem does not seem to go away for me after wiping and restoring from a full backup, as commented two posts prior.

HA Info:

$ ha info
arch: aarch64
channel: stable
docker: 20.10.14
features:
- reboot
- shutdown
- services
- network
- hostname
- timedate
- os_agent
- haos
- resolved
hassos: "8.4"
homeassistant: 2022.8.0
hostname: homeassistant
logging: info
machine: raspberrypi4-64
operating_system: Home Assistant OS 8.4
state: running
supervisor: 2022.07.0
supported: true
supported_arch:
- aarch64
- armv7
- armhf
timezone: America/Chicago

From the UI, when I try to join my WiFi network, I get the error "Failed to change network settings Activating connection failed, check connection settings."

From the shell, I get the following:

$ ha network update wlan0 --ipv4-address 10.151.1.104/24 --ipv4-gateway 10.151.1.1 --ipv4-method static --ipv4-nameserver 1.1.1.1 --log-level debug
DEBU[0000] Adding homedir to searchpath                  homedir=/root
INFO[0000] No configfile found
DEBU[0000] Debug flags                                   apiToken=REDACTED cfgFile= endpoint=supervisor logLevel=debug noProgress=false rawJSON=false
DEBU[0000] network update                                args="[wlan0]"
DEBU[0000] [GenerateURI]                                 base=supervisor command="interface/{interface}/update" section=network
DEBU[0000] [GenerateURI] Result                          uri="http://supervisor/network/interface/{interface}/update" url="http://supervisor/network/interface/%7Binterface%7D/update" url(string)="http://supervisor/network/interface/{interface}/update"
DEBU[0000] Request body                                  options="map[enabled:true ipv4:map[address:[10.151.1.104/24] gateway:10.151.1.1 method:static]]"
DEBU[0025] Response                                      body="{\"result\": \"error\", \"message\": \"Activating connection failed, check connection settings.\"}" fields.time=25.157400335s headers="map[Content-Length:[90] Content-Type:[application/json; charset=utf-8] Date:[Wed, 03 Aug 2022 21:43:39 GMT] Server:[Python/3.9 aiohttp/3.8.1]]" received-at="2022-08-03 16:43:39.499367781 -0500 CDT m=+25.166282060" request="&{POST http://supervisor/network/interface/wlan0/update HTTP/1.1 1 1 map[Accept:[application/json] Authorization:[Bearer REDACTED] Content-Type:[application/json] User-Agent:[go-resty/2.7.0 (https://github.com/go-resty/resty)]] 0x40001abd70 0x2a0fc0 96 [] false supervisor map[] map[] <nil> map[]   <nil> <nil> <nil> 0x400013a048}" status="400 Bad Request" statuscode=400
Error: Activating connection failed, check connection settings.

wlan0 Network Info:

$ ha network info wlan0
connected: true
enabled: true
interface: wlan0
ipv4:
  address: []
  gateway: null
  method: disabled
  nameservers: []
ipv6:
  address: []
  gateway: null
  method: disabled
  nameservers: []
primary: false
type: wireless
vlan: null
wifi:
  auth: wpa-psk
  mode: infrastructure
  signal: 72
  ssid: REDACTED

AndrewPaglusch avatar Aug 03 '22 21:08 AndrewPaglusch

I just managed to fix this for myself. I disabled PMF (Protected Management Frames) in my UniFi controller for the SSID I was trying to join. As soon as that was disabled, HA was able to join the network.

AndrewPaglusch avatar Aug 04 '22 03:08 AndrewPaglusch

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Oct 03 '22 04:10 github-actions[bot]

i am having this exact issue .

Home Assistant 2022.10.0 Supervisor 2022.09.1 Operating System 9.0 Frontend 20221005.0 - latest

connect to my wifi without incident. It uses DHCP. Tried to set static IP from GUI, and get error when saving it: "Failed to change network settings. Activating connection failed, check connection settings."

opened terminal & SSH add in, typed

ha network update wlan0 --ipv4-method static --ipv4-address 192.168.1.2/24 --ipv4-gateway 192.168.1.1 --ipv4-nameserver 192.168.1.1

Error: Activating connection failed, check connection settings.

supercazzola avatar Oct 06 '22 04:10 supercazzola

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 05 '22 06:11 github-actions[bot]