My recommendations are a consult with a veterinary behaviorist and possibly medication. German Shepherds are one of the breeds prone to Obsessive-Compulsive Disorder (OCD) type behaviors. Theirs frequently takes the form of tail chasing.
You can find board certified behaviorists here https://www.dacvb.org/search/custom.asp?id=4709 Your primary vet might need to make a referral for you.
You can find board certified behaviorists here https://www.dacvb.org/search/custom.asp?id=4709 Your primary vet might need to make a referral for you.