Are you by chance diabetic? Flank pain is usually associated with the kidneys, and people with diabetes usually have keytones in the urine.
Hello,
Presence of ketones in urine is not normal and can be found in metabolic abnormalities such as diabetes, renal glycosuria, or glycogen storage disease, dietary conditions such as starvation, fasting, high protein, or low carbohydrate diets, prolonged vomiting, and anorexia and conditions in which metabolism is increased, such as hyperthyroidism, fever, pregnancy or lactation.
You need to consult a physician and get all these causes ruled out.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.