I am attempting to connect my Ubuntu 22.04 laptop to my router using Wi-Fi. When the Wi-Fi network is not saved on my laptop, I can successfully connect to it. However, after saving the network, whenever I reboot the system, it continuously tries to connect to the saved Wi-Fi network but fails. To connect again, I have to manually make the system forget the network and enter the password each time. I'm unsure about the cause of this issue and how to resolve it.
Here is the log of the network manager when it fails to connect to my wifi apple.media
<info> [1684446527.3141] policy: auto-activating connection 'apple.media 1' (f272beb8-535a-4983-a621-20320a061a62)
<info> [1684446527.3150] device (wlp0s20f3): Activation: starting connection 'apple.media 1' (f272beb8-535a-4983-a621-20320a061a62)
<info> [1684446527.3152] device (wlp0s20f3): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
<info> [1684446527.3156] manager: NetworkManager state is now CONNECTING
<info> [1684446527.3161] device (wlp0s20f3): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> [1684446527.3165] device (wlp0s20f3): Activation: (wifi) access point 'apple.media 1' has security, but secrets are required.
<info> [1684446527.3166] device (wlp0s20f3): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
<info> [1684446527.3169] sup-iface[91da9b268ff7a7b8,0,wlp0s20f3]: wps: type pbc start...
<info> [1684446527.3189] device (wlp0s20f3): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
<info> [1684446527.3193] device (wlp0s20f3): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> [1684446527.3194] device (wlp0s20f3): Activation: (wifi) connection 'apple.media 1' has security, and secrets exist. No new secrets needed.
<info> [1684446527.3194] Config: added 'ssid' value 'apple.media'
<info> [1684446527.3195] Config: added 'scan_ssid' value '1'
<info> [1684446527.3195] Config: added 'bgscan' value 'simple:30:-70:86400'
<info> [1684446527.3195] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
<info> [1684446527.3195] Config: added 'auth_alg' value 'OPEN'
<info> [1684446527.3195] Config: added 'psk' value '<hidden>'
<info> [1684446527.3397] device (wlp0s20f3): supplicant interface state: scanning -> authenticating
<info> [1684446527.3398] device (p2p-dev-wlp0s20f3): supplicant management interface state: scanning -> authenticating
<info> [1684446527.3659] device (wlp0s20f3): supplicant interface state: authenticating -> associating
<info> [1684446527.3660] device (p2p-dev-wlp0s20f3): supplicant management interface state: authenticating -> associating
<info> [1684446527.4165] device (wlp0s20f3): supplicant interface state: associating -> completed
<info> [1684446527.4166] device (wlp0s20f3): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "apple.media"
<info> [1684446527.4166] device (p2p-dev-wlp0s20f3): supplicant management interface state: associating -> completed
<info> [1684446527.4169] device (wlp0s20f3): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
<info> [1684446527.4176] dhcp4 (wlp0s20f3): activation: beginning transaction (timeout in 45 seconds)
<info> [1684446533.0269] dhcp6 (wlp0s20f3): activation: beginning transaction (timeout in 45 seconds)
<info> [1684446578.5906] device (wlp0s20f3): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
<info> [1684446578.5912] manager: NetworkManager state is now DISCONNECTED
<warn> [1684446578.5917] device (wlp0s20f3): Activation: failed for connection 'apple.media 1'
<info> [1684446578.5921] device (wlp0s20f3): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
<info> [1684446578.6147] dhcp4 (wlp0s20f3): canceled DHCP transaction
<info> [1684446578.6148] dhcp6 (wlp0s20f3): canceled DHCP transaction
<info> [1684446578.7371] device (wlp0s20f3): supplicant interface state: completed -> disconnected
<info> [1684446578.7372] device (p2p-dev-wlp0s20f3): supplicant management interface state: completed -> disconnected
Here is the log when the network manager connects to my wifi for the first time (after I enforce it to forget the wifi):
<info> [1684447330.9858] device (wlp0s20f3): Activation: starting connection 'apple.media 1' (b2b07adc-a947-422c-806a-90d5d8248cf7)
<info> [1684447330.9859] audit: op="connection-add-activate" uuid="b2b07adc-a947-422c-806a-90d5d8248cf7" name="apple.media 1" pid=2944 uid=1000 result="success"
<info> [1684447330.9861] device (wlp0s20f3): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
<info> [1684447330.9863] manager: NetworkManager state is now CONNECTING
<info> [1684447330.9864] device (wlp0s20f3): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> [1684447330.9866] device (wlp0s20f3): Activation: (wifi) access point 'apple.media 1' has security, but secrets are required.
<info> [1684447330.9866] device (wlp0s20f3): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
<info> [1684447330.9867] sup-iface[91da9b268ff7a7b8,0,wlp0s20f3]: wps: type pbc start...
<info> [1684447330.9955] device (wlp0s20f3): supplicant interface state: disconnected -> scanning
<info> [1684447330.9955] device (p2p-dev-wlp0s20f3): supplicant management interface state: disconnected -> scanning
<info> [1684447337.3745] device (wlp0s20f3): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
<info> [1684447337.3752] device (wlp0s20f3): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
<info> [1684447337.3757] device (wlp0s20f3): Activation: (wifi) connection 'apple.media 1' has security, and secrets exist. No new secrets needed.
<info> [1684447337.3757] Config: added 'ssid' value 'apple.media'
<info> [1684447337.3757] Config: added 'scan_ssid' value '1'
<info> [1684447337.3758] Config: added 'bgscan' value 'simple:30:-70:86400'
<info> [1684447337.3758] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
<info> [1684447337.3758] Config: added 'auth_alg' value 'OPEN'
<info> [1684447337.3758] Config: added 'psk' value '<hidden>'
<info> [1684447337.3955] device (wlp0s20f3): supplicant interface state: scanning -> authenticating
<info> [1684447337.3956] device (p2p-dev-wlp0s20f3): supplicant management interface state: scanning -> authenticating
<info> [1684447337.4214] device (wlp0s20f3): supplicant interface state: authenticating -> associating
<info> [1684447337.4214] device (p2p-dev-wlp0s20f3): supplicant management interface state: authenticating -> associating
<info> [1684447337.4557] device (wlp0s20f3): supplicant interface state: associating -> completed
<info> [1684447337.4558] device (wlp0s20f3): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "apple.media"
<info> [1684447337.4558] device (p2p-dev-wlp0s20f3): supplicant management interface state: associating -> completed
<info> [1684447337.4560] device (wlp0s20f3): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
<info> [1684447337.4564] dhcp4 (wlp0s20f3): activation: beginning transaction (timeout in 45 seconds)
<info> [1684447339.1861] dhcp6 (wlp0s20f3): activation: beginning transaction (timeout in 45 seconds)
<info> [1684447340.1905] dhcp4 (wlp0s20f3): state changed new lease, address=192.168.2.15
<info> [1684447340.1947] device (wlp0s20f3): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
<info> [1684447340.2143] device (wlp0s20f3): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
<info> [1684447340.2147] device (wlp0s20f3): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
<info> [1684447340.2152] manager: NetworkManager state is now CONNECTED_LOCAL
<info> [1684447340.2166] manager: NetworkManager state is now CONNECTED_SITE
<info> [1684447340.2167] policy: set 'apple.media 1' (wlp0s20f3) as default for IPv4 routing and DNS
<info> [1684447340.2175] device (wlp0s20f3): Activation: successful, device activated.
<info> [1684447342.3843] manager: NetworkManager state is now CONNECTED_GLOBAL