Unable to tag a docker image using Travis CI environment variables

I am using Travis to tag my image like this:

docker tag ${image}:latest ${REPO}/${NS}/${image}:${minor}/${TRAVIS_REPO_SLUG}/${TRAVIS_BRANCH}

But, I am getting this error:

Error parsing reference: "hyc-ca-container-docker-local.artifactory.swg-devops.com/ca-k8s/artifacts:0.1/demonpreet/ca-k8s-images/master" is not a valid repository/tag: invalid reference format

Can anyone guide me how to resolve?

Source: StackOverflow