Hi. My name is***** a camera repair technician with over 20 years in the business and I'll be glad to help you with your question today.
This is usually caused by contamination around the hinges on the flash head. Try gently lifting the flash head while pressing the flash release button. Then clean all surfaces and the hinge areas with warm water and a cotton swab.
You can always bypass the automatic flash by using one of the other modes, "P", "S", "A" or "M" modes.
Thanks Rick ,will give this a try