Capt. Peter Ryan says HMCS Windsor will be out of commission for repairs from March until September at a navy facility in Halifax.
Ryan says the generator is one of two on the submarine that provides a crucial source of power for the vessel.
He says it is a key piece of equipment that must be fixed before the submarine can return to operations.
The submarine spent five years in a refit from 2007 until the middle of 2012, when it was returned to service.
The navy said in an email late Wednesday that the problem with the generator was detected shortly after it returned to sea.
Spokeswoman navy Lt. Jennifer Fidler said the work to correct the problem has been planned for months.
"HMCS Windsor is conducting ongoing local operations to train submariners. However, as it is operating with one generator, the submarine is under temporary restrictions on the range and endurance of these operations," she wrote in an email.
"The exact parameters of these restrictions are classified, and will remain in place until the affected diesel generator is replaced."
She said the diesel generators are large components attached to the submarine's diesel engines, and are used to charge the submarine's battery.
She estimated the cost of installing a replacement would be about $1.5 million.
The navy's four submarines were once heralded as a great bargain for taxpayers, but the poor condition of the British-built, diesel-electric vessels has since tarnished their reputation.
Prior problems with the fleet include extensive rust, flooding and hull dents.
HMCS Victoria — based on the West Coast — is now the navy's only fully operational submarine, having completed the test firing of a live torpedo.
Windsor was in operation but remained under dive restrictions and wasn't certified to fire its weapons.
HMCS Corner Brook is in dry dock for life extension and repairs after hitting the ocean floor off Vancouver Island.
The navy recently said HMCS Chicoutimi — which was damaged in a fire 10 years ago that killed a sailor — has been rebuilt and is set to return to the fleet.
Johanna Quinney, a spokesperson for Defence Minister Rob Nicholson, said in an email that the navy remains operationally ready.