A cargo ship in Norway ran aground just meters from a home, sparking investigations into the cause of the near-disaster.