Make update_metadata handle invalid provider credentials