Re: Install error with databasechangelock - duplicate CREATE

<[email protected]>
Newsgroups gmane.network.opennms.install
Message-ID <[email protected]>
[email protected] wrote :

> Hi,
> 
> 
> I am installing on Solaris 10 with Postgres and am experiencing the following.  I've installed a previous version (1.6) without problem, but when I attempt to install 1.8.1, with /opt/opennms/install -dis, I get the following error.  I've tried wiping out the database and it doesn't make a difference.
> 
> - trying to load /usr/jdk/packages/lib/sparc/libjrrd.so: NO
>   - trying to load /lib/libjrrd.so: NO
>   - trying to load /usr/lib/libjrrd.so: NO
>   - trying to load /usr/lib/jni/libjrrd.so: NO
>   - trying to load /usr/lib/libjrrd.so: NO
>   - trying to load /usr/local/lib/libjrrd.so: NO
>   - trying to load /opt/NMSjicmp/lib/32/libjrrd.so: NO
>   - trying to load /opt/NMSjicmp/lib/64/libjrrd.so: NO
> - Failed to load the optional jrrd library.
>   - This error is not fatal, since jrrd is only required for optional features.
>   - For more information, see http://www.opennms.org/index.php/jrrd
> - using SQL directory... /opt/opennms/etc
> - using create.sql... /opt/opennms/etc/create.sql
> 0 [main] INFO org.opennms.core.schema.Migrator  - validating database version
> * using 'customuser' as the PostgreSQL user for OpenNMS
> * using 'custompassword' as the PostgreSQL password for OpenNMS
> * using 'opennmsdatabase' as the PostgreSQL database name for OpenNMS
> 723 [main] INFO org.opennms.core.schema.Migrator  - validating database version
> 776 [main] INFO org.opennms.core.schema.Migrator  - adding PL/PgSQL support to the database, if necessary
> 798 [main] INFO org.opennms.core.schema.Migrator  - PL/PgSQL call handler exists
> 805 [main] INFO org.opennms.core.schema.Migrator  - PL/PgSQL language exists
> - checking if database "customdatabase" is unicode... ALREADY UNICODE
> - Checking for old import files in /opt/opennms/etc... DONE
> - Migrating/creating database:
> Jan 28, 2011 10:41:00 AM liquibase.database.template.JdbcTemplate comment
> INFO: Create Database Lock Table
> Exception in thread "main" org.opennms.core.schema.MigrationException: unable to update the database
>         at org.opennms.core.schema.Migrator.migrate(Migrator.java:415)
>         at org.opennms.install.Installer.install(Installer.java:294)
>         at org.opennms.install.Installer.main(Installer.java:964)
> Caused by: liquibase.exception.LockException: liquibase.exception.JDBCException: Error executing SQL CREATE TABLE datab
> asechangeloglock (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP WITH TIME ZONE, LOCKEDBY VARCHAR(255)
> , CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))
>         at liquibase.lock.LockHandler.waitForLock(LockHandler.java:176)
>         at liquibase.Liquibase.update(Liquibase.java:100)
>         at org.opennms.core.schema.Migrator.migrate(Migrator.java:412)
>         ... 2 more
> Caused by: liquibase.exception.JDBCException: Error executing SQL CREATE TABLE databasechangeloglock (ID INT NOT NULL,
> LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP WITH TIME ZONE, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLO
> CK PRIMARY KEY (ID))
>         at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:56)
>         at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:87)
>         at liquibase.database.AbstractDatabase.checkDatabaseChangeLogLockTable(AbstractDatabase.java:728)
>         at liquibase.lock.LockHandler.waitForLock(LockHandler.java:145)
>         ... 4 more
> Caused by: org.postgresql.util.PSQLException: ERROR: relation "databasechangeloglock" already exists
>         at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
>         at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
>         at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
>         at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345)
>         at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:79)
>         at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:49)
>         ... 7 more
> ~
> 
> 
> 
> Thanks!
> 
> Sasha
> 
> 

Looking through the Liquibase code, it looks like this would happen every time, since aquireLock() calls checkDatabaseChangeLockLockTable(), which will create the table if the hasChangeLogLockTable() returns false, but then aquireLock() subsequently calls setCanCacheLiquibaseTableInfo(), which always sets the hasChangeLogLockTable variable to "false".  
 
But then why haven't other people had the same problem installing?????

Thanks,
Sasha

___________________________________
Sent using PCI Broadband webmail




------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-install mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-install
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.