Won't Fix
Details
Assignee
UnassignedUnassignedReporter
Sebastian KordzikSebastian KordzikHB Grooming Date
Oct 19, 2021Components
Due date
Jun 17, 2015Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Sebastian Kordzik
Sebastian KordzikHB Grooming Date
Oct 19, 2021
Components
Due date
Jun 17, 2015
Priority
PagerDuty
PagerDuty
PagerDuty
Created June 10, 2015 at 7:01 AM
Updated October 19, 2021 at 5:43 PM
Resolved October 19, 2021 at 5:39 PM
After using OpenNMS 1.12.0 for quite a while, we tried upgrading it to a more recent version. Following the suggestions and the requirements of the RPM packages we upgraded JDK to version 8 and postgresql to version 9.
Unfortunatly we couldn't complete the upgrade because of an error while running /opt/opennms/bin/install -dis
The error occurs during schema upgrade:
using SQL directory... /opt/opennms/etc
using create.sql... /opt/opennms/etc/create.sql
12:29:09.895 [Main] INFO org.opennms.core.schema.Migrator - validating database version
using 'postgres' as the PostgreSQL user for OpenNMS
using 'opennms_prod_177' as the PostgreSQL database name for OpenNMS
12:29:09.972 [Main] INFO org.opennms.core.schema.Migrator - validating database version
12:29:09.982 [Main] INFO org.opennms.core.schema.Migrator - adding PL/PgSQL support to the database, if necessary
12:29:09.986 [Main] INFO org.opennms.core.schema.Migrator - PL/PgSQL call handler exists
12:29:09.987 [Main] INFO org.opennms.core.schema.Migrator - PL/PgSQL language exists
checking if database "opennms_prod_177" is unicode... ALREADY UNICODE
Checking for old import files in /opt/opennms/etc... DONE
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$3.run(Bootstrap.java:366)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"
Position: 13
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410)
at org.opennms.core.db.install.InstallerDb.databaseSetUser(InstallerDb.java:2024)
at org.opennms.install.Installer.install(Installer.java:270)
at org.opennms.install.Installer.main(Installer.java:985)
... 6 more
The corresponding postresql log error is:
So we went back to Upgrade in steps. First upgrade was to 1.12.9-2, after that to 14 and then to 16. Unfortunatly the error existed in each version - our database had already been migrated to postgresql 9 - and there is no turning back. We are still running OpenNMS 1.12.9 (though without successfully running the install script).
In a test installation we used an older database, still version 8, where the install script performed without error.
In Postgresql 9 it doesn't matter if we use the current database, an empty one, one created with the create.sql file or no database at all - the error occures regardless.
Funny thing, this error was already reported a while back (http://issues.opennms.org/browse/NMS-4206) and was supposedly fixed. Either this doesn't apply to the RPM release of OpenNMS or is just another (new) error.
Is there a hotfix available? Or a different approach to install schema upgrades? And then running the install tools without the schema upgrades?