OAKLAND, Calif. — The charred, roofless shell of the Ghost Ship, the warehouse where 36 people perished on a chilly Friday evening in early December, is clearly visible from the driveway of Oakland firehouse No. 13.

Though the warehouse sits less than 200 yards away, the firehouse’s proximity did nothing to help prevent America’s deadliest structural fire in more than a decade. For years before the Dec. 2 fire, the Ghost Ship may just as well have been invisible to the Oakland Fire Department.

[Ghost Ship Trial: Jury acquits one man and can’t reach verdict on the other.]

Raucous parties. Frequent complaints by neighbors. Calls summoning firefighters to put out fires at nearby properties. None of these triggered an inspection of the warehouse by the crew at the firehouse a short block away.

A criminal investigation led by the Alameda County district attorney is now underway into the liability of the owner of the property, the master tenant who essentially ran the warehouse, and others. But dozens of interviews and a review of documents show that the fire was a disaster waiting to happen, a deadly mix of a flawed safety inspection system and a shortage of affordable housing that led tenants to live in a building that was never intended to be a residence. Once the fire erupted, people were trapped in a cluttered warehouse with just two exits.