prep_env: fail early if something goes bad