There isn’t enough space here to detail all that could happen to cause off flavors. Most brewing books have a trouble-shooting section – check your symptoms for the likely cause. Most likely you have an infection. Check around the bottle neck. If there’s a ring, that’s usually a sign of infection (but can also be caused by priming with DME). Review your sanitation procedures. It may be an isolated case (we all make a batch of “dumper-brau” once in a while) but if the problem persists you probably have a hidden place in some of your equipment you’re not getting clean and sanitized.