I have installed X-Pack on a 5.1.2 cluster with a basic license, and then decided I want to remove it again. Following the instructions at https://www.elastic.co/guide/en/x-pack/current/installing-xpack.html#xpack-uninstalling, nodes are unable to join the cluster after restart due to https://github.com/elastic/elasticsearch/pull/15401, ie.
IllegalArgumentException[No custom metadata prototype registered for type [licenses], node likely missing plugins]
How do I properly and cleanly uninstall X-Pack?
Thanks in advance,