Network Manager issue

Hi.
I am getting the following issue on RPI with network manager config.

When installing the correct config for wifi - everything works, no issues.
Now the problem arises when user installs config that has an invalid password like this.

network:
  version: 2
  renderer: NetworkManager
  wifis:
    wlan0:
      access-points:
        "POINT":
          password: "WRONG"
      dhcp4: true

Now if he installs correct config:

network:
  version: 2
  renderer: NetworkManager
  wifis:
    wlan0:
      access-points:
        "NAME":
          password: "CORRECT"
      dhcp4: true

There is still no network connection. I double-checked the behavior. It is completely reproducible. Any ideas what’s wrong? How can it be worked around?

The only workaround I found was changing from NetwokManager to networkd. Which did not work every time.

After changing config, have you called
$ netplan apply ?
Also are you really using benefits of NM. It seems to me that for simple network configuration like this, default networkd rendered should be sufficient.

That been said, NM plugin which will read config without need to call netplan apply is also in works and will be available in the future

We do not call netplan apply explicitly. When user inserts USB stick with network config we overwrite the old config if it changed and reboot. Do we need to if we reboot?
Works fine in all cases except for this one.

The reason we use NM is that we want to also support creating wi-fi access point in the future (so for now, yes, we could default to networkd).

nope, if you reboot the netplan generate/apply dance happens automatically (you do not need to reboot anymore if you do a dbus call for the netplan generate/appl bits instead though, the network-setup-control interface got enhanced)

I think it’s worth pointing out that this is for Core 16. Not sure if that changes anything.

And as mentioned in the parent post. The issue is reproducible 100% (at lease on core 16). The issue happens only when correct access point name is entered with incorrect password.

So I understand it fully
You say if you do following:

  • set netplan config with WRONG Wi-Fi password
  • reboot
  • set netplan config with CORECT Wi-Fi password
  • reboot
    Device still has no network. And this is reproducible on Core 16 every time

Can you please try same thing, but instead of reboot call $ netplan generate; netplan apply
If you have some problem
Just trying to narrow down the problem.
@abeato any idea what can be causing this?

netplan on core16 had a bug so netplan apply did not restart the network services sometimes. Said this, if you restart things should be fine.

Do you see the old or the new password when you run:

nmcli c show <conn> -s  | grep 802-11-wireless-security.psk

Also, which is the content of these folders:

/run/NetworkManager/system-connections/
/var/snap/network-manager/current/conf/system-connections/