Elasticsearch service won't start on Ubuntu 22.04 after a reboot

I installed Elasticsearch and Kibana yesterday and it worked fine, i rebooted the VM overnight and this morning it will not start the Elasticsearch service. When I go to the IP address I get the message that the Kibana Server is not ready yet even though it is running.

Job for elasticsearch.service failed because the control process exited with error code. See "systemctl status elasticsearch.service" and "journalctl -xeu elasticsearch.service" for details.

Logs:

[2024-10-24T08:44:42,830][INFO ][o.e.x.a.APMIndexTemplateRegistry] [UbuntuElas] APM index template registry is enabled
[2024-10-24T08:44:44,759][INFO ][o.e.t.n.NettyAllocator   ] [UbuntuElas] creating NettyAllocator with the following configs: [name=>
[2024-10-24T08:44:54,918][ERROR][o.e.b.Elasticsearch      ] [UbuntuElas] fatal exception while booting Elasticsearch
java.lang.IllegalArgumentException: setting [cluster.initial_master_nodes] is not allowed when [discovery.type] is set to [single-n>
        at org.elasticsearch.cluster.coordination.ClusterBootstrapService.<init>(ClusterBootstrapService.java:87) ~[elasticsearch-8>
        at org.elasticsearch.cluster.coordination.Coordinator.<init>(Coordinator.java:297) ~[elasticsearch-8.15.3.jar:?]
        at org.elasticsearch.discovery.DiscoveryModule.<init>(DiscoveryModule.java:199) ~[elasticsearch-8.15.3.jar:?]
        at org.elasticsearch.node.NodeConstruction.createDiscoveryModule(NodeConstruction.java:1516) ~[elasticsearch-8.15.3.jar:?]
        at org.elasticsearch.node.NodeConstruction.construct(NodeConstruction.java:1005) ~[elasticsearch-8.15.3.jar:?]

I have tried to restart the service and get the same error every time without fail. Tried rebooting and no change. The port (5601) is set to listening so is not blocked. I am completely stumped at this point.

I am running in Single Node.
This is my config file:

# address here to expose this node on the network:
#
network.host: 127.0.0.1
discovery.type: single-node
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 5601
#
# For more information, consult the network module documentation.


# Enable security features
xpack.security.enabled: true

xpack.security.enrollment.enabled: true

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["UbuntuElas"]

# Allow HTTP API connections from anywhere
# Connections are encrypted and require user authentication
http.host: 0.0.0.0

# Allow other nodes to join the cluster from anywhere
# Connections are encrypted and mutually authenticated
#transport.host: 0.0.0.0
type or paste code here

Remove this line from your config and restart elasticsearch

cluster.initial_master_nodes: ["UbuntuElas"]