Use warn_once instead of warn (#5038)