I often run into this problem when there is a mismatch between the node labels defined in the compose file and the ones defined in the actual node, either because I set a wrong label (e.g. a typo) or simply forgot to label nodes at all.
To label nodes:
1) For each target node do:
docker-machine ssh <manager_node_name> 'docker node update --label-add <label_name>=<label_value> <target_node_name>'
2) Make sure they match the ones defined in the compose file.
3) restart docker service in manager node
for example:
compose file:
dummycontainer:
image: group/dummyimage
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.labels.dummy_label == dummy]
restart_policy:
condition: on-failure
assuming that I want to deploy this replica in a node called dummy_node:
docker-machine ssh manager_node 'docker node update --label-add dummy_label=dummy dummy_node'
and restart docker in the manager node.
Finally, if you deploy you should expect dummycontainer running in dummy_node, assuming that the label was correctly set in both steps. Otherwise it is expectable to see the error you are getting.
Best regards