def METHOD_NAME(env: BatchedVecEnv | NonBatchedVecEnv, env_info: EnvInfo, cfg: Config) -> None:
    new_env_info = extract_env_info(env, cfg)
    if new_env_info != env_info:
        cache_filename = env_info_cache_filename(cfg)
        log.error(
            f"Env info does not match the cached value: {env_info} != {new_env_info}. Deleting the cache entry {cache_filename}"
        )
        try:
            os.remove(cache_filename)
        except OSError:
            # ignoring errors, this is not super important
            pass
        log.error(
            "This is likely because the environment has changed after the cache entry was created. "
            "Either restart the experiment to fix this or run with --use_env_info_cache=False to avoid such problems in the future."
        )
        raise ValueError("Env info mismatch. See logs above for details.")