It was a bit old, was retrofitted awhile back. Perhaps something was missed or improperly done during that process.
I think they bought it from Germany.
“The Nanggala was built in Germany and joined the Indonesian fleet in 1981. It underwent a refit in South Korea that was completed in 2012 and the vessel was said to be in good condition, according to Reuters.”