This can happen if you have updated docker, but the service has not been restarted. You will then try to connect to the docker daemon with the updated client, while the daemon (that was already running before the update) is still running the older version.
To fix this, restart the service:
service docker restartsystemd:
systemctl restart docker