Opennms fails to start

hi,
I can’t seem to figure out this error when trying to initialize the server. can anyone help?

deb11-SRV01:~$ sudo systemctl status opennms.service
● opennms.service - OpenNMS server
     Loaded: loaded (/lib/systemd/system/opennms.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2021-08-23 13:18:34 EDT; 2h 12min ago
    Process: 884 ExecStart=/usr/share/opennms/bin/opennms -s start (code=exited, status=1/FAILURE)
        CPU: 3.025s

Aug 23 13:18:19 deb11-SRV01 systemd[1]: Starting OpenNMS server...
Aug 23 13:18:34 deb11-SRV01 opennms[884]: Starting OpenNMS:
Aug 23 13:18:34 deb11-SRV01 opennms[1949]: ERROR: XML validation failed: /usr/share/opennms/etc/opennms-datasource.xml
Aug 23 13:18:34 deb11-SRV01 opennms[1949]:            run '/usr/bin/xmllint /usr/share/opennms/etc/opennms-datasource.xml' fo>
Aug 23 13:18:34 deb11-SRV01 opennms[884]: Validation failed on 1 XML files.  Exiting.
Aug 23 13:18:34 deb11-SRV01 opennms[884]: failed
Aug 23 13:18:34 deb11-SRV01 systemd[1]: opennms.service: Control process exited, code=exited, status=1/FAILURE
Aug 23 13:18:34 deb11-SRV01 systemd[1]: opennms.service: Failed with result 'exit-code'.
Aug 23 13:18:34 deb11-SRV01 systemd[1]: Failed to start OpenNMS server.
Aug 23 13:18:34 deb11-SRV01 systemd[1]: opennms.service: Consumed 3.025s CPU time.
dimitrib@deb11-SRV01:~$ 
dimitrib@deb11-SRV01:~$ 

:woman_facepalming: You can fix me, I’m a wiki post.

Answer is right there.

Aug 23 13:18:34 deb11-SRV01 opennms[1949]: ERROR: XML validation failed: /usr/share/opennms/etc/opennms-datasource.xml
Aug 23 13:18:34 deb11-SRV01 opennms[1949]: run ‘/usr/bin/xmllint /usr/share/opennms/etc/opennms-datasource.xml’ fo>
Aug 23 13:18:34 deb11-SRV01 opennms[884]: Validation failed on 1 XML files. Exiting.

There is an issue with your opennms-datasource.xml file that isn’t properly formatted.

here is the file and it looks good but am I missing something?

sudo /usr/bin/xmllint /usr/share/opennms/etc/opennms-datasource.xml

/usr/share/opennms/etc/opennms-datasource.xml:9: parser error : Extra content at the end of the document
  jdbc-data-source name="opennms-admin" 
  ^


<jdbc-data-source name="opennms"
                    database-name="opennms"
                    class-name="org.postgresql.Driver"
                    url="jdbc:postgresql://localhost:5432/opennms"
                    user-name="opennms"
                    password=" some password     "



<jdbc-data-source name="opennms-admin"
                    database-name="template1"
                    class-name="org.postgresql.Driver"
                    url="jdbc:postgresql://localhost:5432/template1"
                    user-name="postgres"
                    password=" some password     "

I can’t actually tell because your post lacks any formatting markdown, but xmllint is complaining because whatever you’ve got there isn’t valid XML. A pristine copy should look like:

<?xml version="1.0" encoding="UTF-8"?>
<datasource-configuration xmlns:this="http://xmlns.opennms.org/xsd/config/opennms-datasources"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.opennms.org/xsd/config/opennms-datasources
  http://www.opennms.org/xsd/config/opennms-datasources.xsd ">

  <connection-pool factory="org.opennms.core.db.HikariCPConnectionFactory"
    idleTimeout="600"
    loginTimeout="3"
    minPool="50"
    maxPool="50"
    maxSize="50" />

  <jdbc-data-source name="opennms"
                    database-name="opennms"
                    class-name="org.postgresql.Driver"
                    url="jdbc:postgresql://localhost:5432/opennms"
                    user-name="opennms"
                    password="opennms" />

  <jdbc-data-source name="opennms-admin"
                    database-name="template1"
                    class-name="org.postgresql.Driver"
                    url="jdbc:postgresql://localhost:5432/template1"
                    user-name="postgres"
                    password="" />
</datasource-configuration>

Thank you! it would appear that somehow the files were named incorrectly and the datasource file had an extra s at the end of the file.