Nmcli error - "failed to update connection: error writing to file"

nmcli command cannot modify NetworkManager connections:

nmcli connection modify <conn> ipv6.ip6-privacy 0
Error: Failed to modify connection '<conn>': failed to update connection: error writing to file '/etc/NetworkManager/system-connections/<conn>.nmconnection': failed to create file /etc/NetworkManager/system-connections/<conn>.nmconnection.ANXVP3: Read-only file system

This happens even after setenforce 0, so cannot be about SElinux.

Obviously, system is writable - I can edit the file myself. I execute the command as root.

This happens with the KDE applet also. Of course the files belong to root and have 600 permissions - but this is mandatory (otherwise NM just rejects the connection whatsoever). But normally, users can do this without root permissions!

Note: I use GNU Stow to manage connections info in a git repo. These connections have been pulled from the repo - but seem to work just fine (also with applet) - until I needed to modify an option. I know I can edit the files directly (that’s what I do currently) - but would be nice to understand what happens there, and also let the graphical configuration with KDE applet work.

Could anyone provide some insights on:

  • why this happens (esp. as root!)
  • how exactly NM handles connection files (esp. when working from the DE without root!)

Thank you!


System infos:

  • Fedora 43

Relevant app infos:

  • NetworkManager-1.54.3-2.fc43

That looks odd.

What do you see if you do these commands?

lsblk -f
sudo touch /etc/NetworkManager/system-connections/q.q

lsblk -f (relevant portion, UUIDs redacted):

└─nvme0n1p5                                   crypto_LUKS 2            <uuid>                
  └─luks-<uuid> btrfs             fedora <uuid>  357.5G    17% /var
                                                                                                       /tmp
                                                                                                       /usr/local
                                                                                                       /opt
                                                                                                       /home
                                                                                                       /.snapshots
                                                                                                       /

sudo touch /etc/NetworkManager/system-connections/test works fine, as expected:

sudo ls -l /etc/NetworkManager/system-connections/test
-rw-r--r--. 1 root root 0 May 24 16:20 /etc/NetworkManager/system-connections/test

As mentioned, I would not be able to modify the files manually if something was wrong with the FS mounting.

The actual file operations are performed by NetworkManager.service, which runs as root. It exposes a D-Bus service which can be called (potentially by non-root users) to create/edit connection files.

Do you mean that you used Stow to create files in /etc/NetworkManager/system-connections that are actually symlinks to a git repo?