Docker stack deploy --with-registry-auth results "this node is not a swarm manager."

I run
$ docker stack deploy --with-registry-auth
this node is not a swarm manager. Use “docker swarm init” or “docker swarm join” to connect this node to swarm and try again

But when I run
$ docker swarm init
Error response from daemon: This node is already part of a swarm. Use “docker swarm leave” to leave this swarm and join another one.

Help, please?

$ docker -v
Docker version 18.06.1-ce, build e68fc7a

$ uname -a
Linux sks06mpbl001 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21 18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

Runned docker info:

$ docker info
Containers: 32
 Running: 16
 Paused: 0
 Stopped: 16
Images: 20
Server Version: 18.06.1-ce
Storage Driver: overlay2
 Backing Filesystem: xfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: error
 NodeID: 
 Error: manager stopped: can't initialize raft node: WAL error cannot be repaired: unexpected EOF
 Is Manager: false
 Node Address: 10.ххх.ххх.ххх
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-862.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.5 (Maipo)
OSType: linux
Architecture: x86_64
CPUs: ххх
Total Memory: хххGiB
Name: sks06mpbl001
ID: OHEB:MSQ4:YYOF:PEWL:KOCU:I3BU:XWM4:3R3Y:NI54:ZHIS:L2LW:6GC2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: http://127.0.0.1:3128
No Proxy: localhost,127.0.0.0/8,<host....>,<another-host>
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Registry Mirrors:
 https://<host_registry>/
Live Restore Enabled: false

You problem is not “Docker stack deploy –with-registry-auth results”. Your problem starts on the cluster’s consensus level:

Probably you filesytem under /var/lib/docker ran full and your raft transaction log is messed up. Free up some space and cross your fingers that other manager nodes will “repair” the broken node. If the other managers are affected as well or this is your own manager: prepare yourself to delete the swarm and re-initiate it from zero again.