ensure there is a build_env_id before trying to use it to lookup the build_env