Upgrade Guide: 18 to 19

From OpenNMS
Jump to: navigation, search

Karaf

Old Karaf cached data

Make sure to delete the content of the ${OPENNMS_HOME}/data directory before you start OpenNMS Horizon the first time, it contains old cached Karaf data.

Note: It contains cached Karaf internal data, if someone browsed the Topology UI the history is lost and the last Karaf CLI commands are lost as well.

Karaf logging

The Karaf logging is moved from ${OPENNMS_HOME}/data/log/karaf.log to ${OPENNMS_HOME}/log/karaf.log

User Management

users.xml

If you migrate your users.xml you will see the following exception in your opennms logs and it will not start:

Caused by: org.xml.sax.SAXException: The attribute 'read-only' appears illegally on element 'user'.
?at org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandler.java:2781)
?at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:2314)
?at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:1353)
?at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.ja
va:1359)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScan
nerImpl.java:2784)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:5
05)
?at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
?at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
?at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
?at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
?at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:709)
?... 113 more

You have to remove the attributes, e.g. read-only, in the <user> section from:

Syntax <= 18.0.4

<user read-only="false">

Syntax >= 19.0.0

<user>

Because magic-users.properties doesn't exist anymore, all the "hidden" users have to be migrated as well. By default, only the following user has to be created in users.xml (it is probable that a users.xml.rpmnew contains what it is supposed to be there:

<user>
    <user-id>rtc</user-id>
     <full-name>RTC</full-name>
     <user-comments>RTC user, do not delete</user-comments>
     <password>68154466F81BFB532CD70F8C71426356</password>
     <role>ROLE_RTC</role>
</user>

Similarly, the default role will be ROLE_USER if there are no explicit roles listed on each user definition. That means, the admin users have to be updated, for example:

<user>
    <user-id>admin</user-id>
    <full-name>Administrator</full-name>
    <user-comments>Default administrator, do not delete</user-comments>
    <password>21232F297A57A5A743894A0E4A801FC3</password>
    <role>ROLE_ADMIN</role>
</user>

magic-users.properties

The magic-users.properties is removed and the roles are assigned through the WebUI and are persisted in the database now, see http://docs.opennms.org/opennms/releases/19.0.0/guide-admin/guide-admin.html#ga-role-user-management.

Known issues

Compass app is not full usable

The version string in Horizon 19.0.0 is not reported and the Compass app is limited in functionality. This issue is reported in NMS-9103.

Error in output.log: HZN-1015

You can ignore the following error in output.log. This issue is known.

ERROR: Bundle org.opennms.core.ipc.sink.xml [196] Error starting mvn:org.opennms.core.ipc.sink/org.opennms.core.ipc.sink.xml/19.0.0 (org.osgi.framework.BundleException: Unresolved constraint in bundle org.opennms.core.ipc.sink.xml [196]: Unable to resolve 196.0: missing requirement [196.0] osgi.wiring.package; (&(osgi.wiring.package=org.opennms.core.ipc.sink.api)(version>=19.0.0)(!(version>=20.0.0))))
 org.osgi.framework.BundleException: Unresolved constraint in bundle org.opennms.core.ipc.sink.xml [196]: Unable to resolve 196.0: missing requirement [196.0] osgi.wiring.package; (&(osgi.wiring.package=org.opennms.core.ipc.sink.api)(version>=19.0.0)(!(version>=20.0.0)))
 	at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4002)
 	at org.apache.felix.framework.Felix.startBundle(Felix.java:2045)
 	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)
 	at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
 	at java.lang.Thread.run(Thread.java:745)
 Exception in thread "EnhancedLinkd-Thread-4-of-5" java.lang.NullPointerException
 	at org.opennms.netmgt.enlinkd.NodeDiscoveryBridge.runCollection(NodeDiscoveryBridge.java:80)
 	at org.opennms.netmgt.enlinkd.NodeDiscovery.run(NodeDiscovery.java:106)
 	at org.opennms.netmgt.enlinkd.scheduler.Scheduler$1.run(Scheduler.java:187)
 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 	at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:124)
 	at java.lang.Thread.run(Thread.java:745)

HeatMap not working anymore: HZN-1023

The JavaScript includes of the GeoMap prevents the HeatMap from loading correctly even if the GeoMap isn't configured for the launching page. The issue is documented here.

Database migration

In case install -dis fails with the following error message:

SEVERE 2/14/17 9:29 AM:liquibase: Change Set 19.0.0/changelog.xml::19.0.0-insert-default-monitoringlocation::seth failed.  Error: Error executing SQL INSERT INTO monitoringlocations (id, monitoringarea) VALUES ('localhost', 'localhost'): ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.
liquibase.exception.DatabaseException: Error executing SQL INSERT INTO monitoringlocations (id, monitoringarea) VALUES ('localhost', 'localhost'): ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.
       at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
       at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)
       at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)
       at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075)
       at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)
       at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
       at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
       at liquibase.Liquibase.update(Liquibase.java:114)
       at org.opennms.core.schema.Migrator.migrate(Migrator.java:477)
       at org.opennms.install.Installer.install(Installer.java:273)
       at org.opennms.install.Installer.main(Installer.java:989)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       at org.opennms.bootstrap.Bootstrap$4.run(Bootstrap.java:460)
       at java.lang.Thread.run(Thread.java:745)
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
       at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
       at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:305)
       at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:291)
       at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:269)
       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:265)
       at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)
       at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
       ... 16 more
INFO 2/14/17 9:29 AM:liquibase: Successfully released change log lock
java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:497)
       at org.opennms.bootstrap.Bootstrap$4.run(Bootstrap.java:460)
       at java.lang.Thread.run(Thread.java:745)
Caused by: org.opennms.core.schema.MigrationException: unable to migrate the database
       at org.opennms.core.schema.Migrator.migrate(Migrator.java:479)
       at org.opennms.install.Installer.install(Installer.java:273)
       at org.opennms.install.Installer.main(Installer.java:989)
       ... 6 more
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set 19.0.0/changelog.xml::19.0.0-insert-default-monitoringlocation::seth:
    Reason: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO monitoringlocations (id, monitoringarea) VALUES ('localhost', 'localhost'): ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.:
         Caused By: Error executing SQL INSERT INTO monitoringlocations (id, monitoringarea) VALUES ('localhost', 'localhost'): ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.:
         Caused By: ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.
       at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)
       at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
       at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
       at liquibase.Liquibase.update(Liquibase.java:114)
       at org.opennms.core.schema.Migrator.migrate(Migrator.java:477)
       ... 8 more
Caused by: liquibase.exception.DatabaseException: Error executing SQL INSERT INTO monitoringlocations (id, monitoringarea) VALUES ('localhost', 'localhost'): ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.
       at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
       at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)
       at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)
       at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075)
       at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)
       ... 12 more
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "monitoringlocations_pkey"
 Detail: Key (id)=(localhost) already exists.
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291)
       at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432)
       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358)
       at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:305)
       at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:291)
       at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:269)
       at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:265)
       at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)
       at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
       ... 16 more

connect to the PostgreSQL command client psql and run the following command

DELETE FROM monitoringlocations WHERE id = 'localhost';

Run install -dis again and the problem should be solved.

Log Levels

The default log levels for most prefixes in past releases has been WARN, however, this release has them set to DEBUG (as is typical for SNAPSHOT releases). Future releases will revert back to WARN, as this change was not intentional. There is no JIRA issue as the root cause was simply that a step was accidentally skipped during the release process.

Config diff between 18.0.4-1 and 19.0.0-1

Modified Files

	modified:   all.policy
	modified:   collectd-configuration.xml
	modified:   config.properties
	modified:   create.sql
	modified:   custom.properties
	modified:   database-reports.xml
	modified:   database-schema.xml
	modified:   datacollection/fortinet-fortigate-application-v5.2.xml
	modified:   datacollection/netapp.xml
	modified:   events/opennms.events.xml
	modified:   jasper-reports.xml
	modified:   java.util.logging.properties
	modified:   jmx-datacollection-config.xml
	modified:   jmx.acl.cfg
	modified:   jmx.acl.java.lang.Memory.cfg
	modified:   jmx.acl.org.apache.karaf.bundle.cfg
	modified:   jmx.acl.org.apache.karaf.config.cfg
	modified:   jmx.acl.org.apache.karaf.security.jmx.cfg
	modified:   jmx.acl.osgi.compendium.cm.cfg
	modified:   jmxremote.access
	modified:   jre.properties
	modified:   keys.properties
	modified:   libraries.properties
	modified:   log4j2.xml
	modified:   opennms-activemq.xml
	modified:   opennms-upgrade-status.properties
	modified:   opennms.properties
	modified:   org.apache.felix.fileinstall-deploy.cfg
	modified:   org.apache.karaf.command.acl.config.cfg
	modified:   org.apache.karaf.command.acl.features.cfg
	modified:   org.apache.karaf.command.acl.jaas.cfg
	modified:   org.apache.karaf.command.acl.osgi.cfg
	modified:   org.apache.karaf.command.acl.scope_bundle.cfg
	modified:   org.apache.karaf.command.acl.shell.cfg
	modified:   org.apache.karaf.features.cfg
	modified:   org.apache.karaf.features.obr.cfg
	modified:   org.apache.karaf.features.repos.cfg
	modified:   org.apache.karaf.jaas.cfg
	modified:   org.apache.karaf.kar.cfg
	modified:   org.apache.karaf.log.cfg
	modified:   org.apache.karaf.shell.cfg
	modified:   org.opennms.features.geocoder.google.cfg
	modified:   org.opennms.features.topology.app.cfg
	modified:   org.opennms.features.topology.app.icons.application.cfg
	modified:   org.opennms.features.topology.app.icons.bsm.cfg
	modified:   org.opennms.features.topology.app.icons.list
	modified:   org.opennms.features.topology.app.icons.sfree.cfg
	modified:   org.opennms.features.topology.app.icons.vmware.cfg
	modified:   org.ops4j.pax.logging.cfg
	modified:   org.ops4j.pax.url.mvn.cfg
	modified:   poller-configuration.xml
	modified:   report-templates/AssetManagementMaintExpired.jasper
	modified:   report-templates/AssetManagementMaintStrategy.jasper
	modified:   report-templates/AvailabilitySummary.jasper
	modified:   report-templates/AveragePeakTrafficRates.jasper
	modified:   report-templates/DiskUsageForCTX.jasper
	modified:   report-templates/Early-Morning-Report.jasper
	modified:   report-templates/EventAnalysis.jasper
	modified:   report-templates/InterfaceAvailabilityReport.jasper
	modified:   report-templates/NodeAvailabilityReport.jasper
	modified:   report-templates/ResponseTime.jasper
	modified:   report-templates/ResponseTimeCharts.jasper
	modified:   report-templates/ResponseTimeSummary.jasper
	modified:   report-templates/SerialInterfaceUtilizationSummary.jasper
	modified:   report-templates/SnmpInterfaceOperAvailabilityReport.jasper
	modified:   report-templates/TotalBytesTransferredByInterface.jasper
	modified:   report-templates/sample-report.jasper
	modified:   report-templates/subreports/95thPercentileTrafficRate_subreport.jasper
	modified:   report-templates/subreports/AvailabilitySummaryChart_subreport.jasper
	modified:   report-templates/subreports/DiskUsageForCTXServers_subreport1.jasper
	modified:   report-templates/subreports/InterfaceAvailabilityReport_subreport1.jasper
	modified:   report-templates/subreports/NodeId_to_NodeLabel_subreport.jasper
	modified:   report-templates/subreports/PeakTraffic_subreport.jasper
	modified:   report-templates/subreports/ResponseTimeSummary_Availability_Offenders_subreport.jasper
	modified:   report-templates/subreports/ResponseTimeSummary_Availability_Offenders_subreport.jrxml
	modified:   report-templates/subreports/ResponseTimeSummary_Availability_subreport.jasper
	modified:   report-templates/subreports/ResponseTimeSummary_Response_Offenders_subreport.jasper
	modified:   report-templates/subreports/ResponseTimeSummary_subreport.jasper
	modified:   report-templates/subreports/ResponseTime_subreport1.jasper
	modified:   report-templates/subreports/Top25PercentDown_subreport.jasper
	modified:   report-templates/subreports/TotalBytesTransferredByInterface_subreport1.jasper
	modified:   shell.init.script
	modified:   snmp-graph.properties.d/bluecoat-sgproxy-graph.properties
	modified:   snmp-graph.properties.d/checkpoint-graph.properties
	modified:   snmp-graph.properties.d/cisco-graph.properties
	modified:   snmp-graph.properties.d/ciscoNexus-graph.properties
	modified:   snmp-graph.properties.d/clavister-graph.properties
	modified:   snmp-graph.properties.d/ejn-graph.properties
	modified:   snmp-graph.properties.d/f5-graph.properties
	modified:   snmp-graph.properties.d/fortinet-fortigate-application-v5.2-graph.properties
	modified:   snmp-graph.properties.d/hwg-graph.properties
	modified:   snmp-graph.properties.d/ipunity-graph.properties
	modified:   snmp-graph.properties.d/jboss-graph.properties
	modified:   snmp-graph.properties.d/juniper-graph.properties
	modified:   snmp-graph.properties.d/lmsensors-graph.properties
	modified:   snmp-graph.properties.d/microsoft-sql-graph.properties
	modified:   snmp-graph.properties.d/mikrotik-graph.properties
	modified:   snmp-graph.properties.d/mysql-graph.properties
	modified:   snmp-graph.properties.d/netapp-graph.properties
	modified:   snmp-graph.properties.d/opennms-graph.properties
	modified:   snmp-graph.properties.d/paloalto-graph.properties
	modified:   snmp-graph.properties.d/postgresql-graph.properties
	modified:   snmp-graph.properties.d/riverbed-steelhead-graph.properties
	modified:   snmp-graph.properties.d/sofaware-embeddedngx-graph.properties
	modified:   snmp-graph.properties.d/vmware-cim-graph-simple.properties
	modified:   snmp-graph.properties.d/vmware3-graph-simple.properties
	modified:   snmp-graph.properties.d/vmware4-graph-simple.properties
	modified:   snmp-graph.properties.d/xmp-graph.properties
	modified:   startup.properties
	modified:   statsd-configuration.xml
	modified:   users.xml
	modified:   vmware-datacollection-config.xml

Files deleted

	deleted:    magic-users.properties
	deleted:    poller-config.properties
	deleted:    snmp-graph.properties.d/cassandra21x-graph.properties
	deleted:    snmp-graph.properties.d/cassandra21x-newts-graph.properties

Files new

	datacollection/vmware6.xml
	graphml-edge-status/
	infopanel/
	jmx-datacollection-config.d/
	report-templates/TopIOWait.jasper
	report-templates/TopIOWait.jrxml
	snmp-graph.properties.d/activemq-graph.properties
	snmp-graph.properties.d/cassandra-graph.properties
	snmp-graph.properties.d/cassandra-newts-graph.properties
	snmp-graph.properties.d/elasticsearch-graph.properties
	snmp-graph.properties.d/kafka-graph.properties
	snmp-graph.properties.d/opennms-minion-graph.properties
	snmp-graph.properties.d/vmware6-graph-simple.properties
	trend-configuration.xml
	xml-datacollection-config.xml
	xml-datacollection/elasticsearch-cluster-stats.xml

Full plain config diff: https://gist.github.com/indigo423/a8b15b7594bb0b68f859e36cdda2260e