Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-8779

Installer script doesn't work with PostgreSQL 9.6

    Details

      Description

      I upgraded PostgreSQL to 9.6.0, and I found that the install script doesn't work anymore because of the following error:

      09:10:44.826 [Main] INFO  org.opennms.core.schema.Migrator - validating database version
      * using 'postgres' as the PostgreSQL user for OpenNMS
      * using 'opennms' as the PostgreSQL database name for OpenNMS
      09:10:44.922 [Main] INFO  org.opennms.core.schema.Migrator - validating database version
      09:10:44.933 [Main] INFO  org.opennms.core.schema.Migrator - creating OpenNMS user, if necessary
      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:498)
      	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: an error occurred creating the OpenNMS user
      	at org.opennms.core.schema.Migrator.createUser(Migrator.java:339)
      	at org.opennms.core.schema.Migrator.prepareDatabase(Migrator.java:447)
      	at org.opennms.install.Installer.install(Installer.java:254)
      	at org.opennms.install.Installer.main(Installer.java:989)
      	... 6 more
      Caused by: org.postgresql.util.PSQLException: ERROR: unrecognized role option "createuser"
        Position: 54
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2284)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2003)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:200)
      	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:424)
      	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:321)
      	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:313)
      	at org.opennms.core.schema.Migrator.createUser(Migrator.java:337)
      	... 9 more
      

      It turns out that the release notes for 9.6.0 has:

      Remove the long-deprecated CREATEUSER/NOCREATEUSER options from CREATE ROLE and allied commands (Tom Lane)
      
      CREATEUSER actually meant SUPERUSER, for ancient backwards-compatibility reasons. This has been a constant source of confusion for people who (reasonably) expect it to mean CREATEROLE. It has been deprecated for ten years now, so fix the problem by removing it.
      

      Source: https://www.postgresql.org/docs/9.6/static/release-9-6.html

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: