Docker socket not available after any update

After any minor docker package update, i get next problems:

  • portainer can’t connect to localhost and agents. Dial unix /var/run/docker.sock: connect: connection refused
  • watchtower can’t check updates. Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
  • teamcity can’t build tasks.

so it break any services with mount:
- /var/run/docker.sock:/var/run/docker.sock

i tried to:
- /var/run/docker.sock:/var/run/docker.sock:z,ro

but see no any difference.

restart docker & docker.socket didn’t help.
restart portainer agent makes it available.
restart watchtower fix the updates.
restart teamcity sometimes help, sometimes not.

Docker 26-27, ubuntu 20-24.
That never happens with Centos 7. Never happens with Ubuntu about half year ago.

I need a way for at least automate availability fix with ansible.