Obstruction theory in fiber spaces