There is more to your story, which might help figure this out: history of kidney stones? History of bladder infections or kidney infections? My best guesses based on your story are that you either have (1)reflux
from the bladder back up the ureter or (2) a stone in the ureter. See a urologist.