[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openmrs-dev
Subject:    Re: error upgrading Openmrs 1.8.4 to Openmrs 1.9.8
From:       "Dugan, Tammy Marie" <tmdugan () iu ! edu>
Date:       2015-04-09 13:42:46
Message-ID: 552681D6.1030509 () iu ! edu
[Download RAW message or body]

Thank you, Luis. Replacing empty strings with nulls took care of the error.

Tammy

On 4/8/2015 4:02 PM, Lluis Martinez wrote:
> The unique constraint was created here
> 
> <changeSet id="20110708-2105" author="cta" dbms="mysql">
> <preConditions onFail="MARK_RAN">
> <not>
> <indexExists indexName="concept_source_unique_hl7_codes" />
> </not>
> </preConditions>
> <comment>
> Add unique constraint to the concept_source table
> </comment>
> <addUniqueConstraint tableName="concept_source" columnNames="hl7_code"
> constraintName="concept_source_unique_hl7_codes"/>
> </changeSet>
> 
> And the table renamed later 
> 
> <changeSet id="20110301-1030a" author="wyclif" dbms="mysql">
> <preConditions onFail="MARK_RAN">
> <and>
> <not><tableExists tableName="concept_reference_source" /></not>
> </and>
> </preConditions>
> <comment>Renaming the concept_source table to
> concept_reference_source</comment>
> <renameTable oldTableName="concept_source"
> newTableName="concept_reference_source"/>
> </changeSet>
> 
> But AFAIK null values do not count for uniqueness. If they contain
> spaces, try setting them to null before updating.
> 
> Cheers
> 
> 
> 
> 
> 
> On Wed, Apr 8, 2015 at 9:16 PM, Dugan, Tammy Marie <tmdugan@iu.edu
> <mailto:tmdugan@iu.edu>> wrote:
> 
> Concept_source
> 
> Tammy
> 
> On 4/8/2015 3:06 PM, Burke Mamlin wrote:
> > You definitely shouldn't have to populate hl7_source.  That field is
> > optional and I've seen many servers running 1.9, 2.0, and above with
> > blank HL7 source entries.
> > 
> > I'm confused by the error message:
> > 
> > SEVERE 4/8/15 2:27 PM:liquibase: Change Set
> > liquibase-update-to-latest.xml::20110708-2105::cta failed.  Error: Error
> > executing SQL ALTER TABLE *`concept_source`* ADD CONSTRAINT
> > `concept_source_unique_hl7_codes` UNIQUE (`hl7_code`): Duplicate entry '
> > ' for key 'concept_source_unique_hl7_codes'
> > liquibase.exception.DatabaseException: Error executing SQL ALTER TABLE
> > `concept_source` ADD CONSTRAINT `concept_source_unique_hl7_codes` UNIQUE
> > (`hl7_code`): Duplicate entry ' ' for key
> > 'concept_source_unique_hl7_codes'
> > 
> > 
> > Unless something has changed that I don't know about, there is no
> > "concept_source" table.  It's called "concept_reference_source".  So,
> > I'm not sure how it gets to the point of complaining of a duplicate
> > entry on a unique index on a table that doesn't exist. :-/
> > 
> > Is the table called concept_source or concept_reference_source in your
> > database?
> > 
> > -Burke
> > 
> > On Wed, Apr 8, 2015 at 2:43 PM, Dugan, Tammy Marie <tmdugan@iu.edu \
> > <mailto:tmdugan@iu.edu> <mailto:tmdugan@iu.edu <mailto:tmdugan@iu.edu>>> wrote:
> > 
> > Attached is a dump of the data table. Am I getting this error because
> > some rows have a null hl7_code column?
> > 
> > Thanks,
> > 
> > Tammy
> > 
> > On 4/8/2015 2:36 PM, Burke Mamlin wrote:
> > > My guess – either the upgrade is mistakenly referencing "concept_source"
> > > instead of "concept_reference_source" or you have duplicate values in
> > > concept_reference_source.hl7_code attribute.
> > > 
> > > -Burke
> > > 
> > > On Wed, Apr 8, 2015 at 2:31 PM, Dugan, Tammy Marie <tmdugan@iu.edu \
> > > <mailto:tmdugan@iu.edu> <mailto:tmdugan@iu.edu
> <mailto:tmdugan@iu.edu>>
> > > <mailto:tmdugan@iu.edu <mailto:tmdugan@iu.edu>
> <mailto:tmdugan@iu.edu <mailto:tmdugan@iu.edu>>>> wrote:
> > > 
> > > I get the following error when I try to upgrade between
> 1.8.4
> > and 1.9.8
> > > (downloaded from the openmrs download sight):
> > > 
> > > SEVERE 4/8/15 2:27 PM:liquibase: Change Set
> > > liquibase-update-to-latest.xml::20110708-2105::cta failed.
> > Error: Error
> > > executing SQL ALTER TABLE `concept_source` ADD CONSTRAINT
> > > `concept_source_unique_hl7_codes` UNIQUE (`hl7_code`):
> > Duplicate entry '
> > > ' for key 'concept_source_unique_hl7_codes'
> > > liquibase.exception.DatabaseException: Error executing SQL
> > ALTER TABLE
> > > `concept_source` ADD CONSTRAINT
> > `concept_source_unique_hl7_codes` UNIQUE
> > > (`hl7_code`): Duplicate entry ' ' for key
> > > 'concept_source_unique_hl7_codes'
> > > 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
> > > 
> > 
> org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:202)
> 
> > > at
> > > 
> > 
> liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
> > > at
> > > 
> > 
> org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:231)
> > > at
> > > 
> > 
> org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:167)
> > > at
> > > 
> > 
> org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:152)
> > > at
> > > 
> > 
> org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:115)
> > > at
> > > 
> > 
> org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:98)
> > > at
> > > 
> > 
> org.openmrs.api.context.Context.checkForDatabaseUpdates(Context.java:1116)
> > > at
> > org.openmrs.api.context.Context.startup(Context.java:827)
> > > at
> > org.openmrs.web.Listener.startOpenmrs(Listener.java:194)
> > > at
> org.openmrs.web.WebDaemon$1.run(WebDaemon.java:46)
> > > Caused by:
> > > 
> > 
> com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
> > > Duplicate entry ' ' for key
> 'concept_source_unique_hl7_codes'
> > > at
> > > 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> > Method)
> > > at
> > > 
> > 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 
> > > at
> > > 
> > 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 
> > > at
> > > 
> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> > > at
> com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
> > > at com.mysql.jdbc.Util.getInstance(Util.java:386)
> > > at
> > > 
> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)
> > > at
> > com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
> > > at
> > com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
> > > at
> com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
> > > at
> > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
> > > at
> > > 
> com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819)
> > > at
> > > 
> com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768)
> > > at
> > com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:949)
> > > at
> > com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:795)
> > > at
> > > 
> > 
> liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)
> 
> > > at
> > > 
> liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
> > > ... 16 more
> > > 
> > > --
> > > OpenMRS Developers: http://om.rs/dev
> > > Post: dev@openmrs.org <mailto:dev@openmrs.org>
> <mailto:dev@openmrs.org <mailto:dev@openmrs.org>>
> > <mailto:dev@openmrs.org <mailto:dev@openmrs.org>
> <mailto:dev@openmrs.org <mailto:dev@openmrs.org>>> | Unsubscribe:
> > > dev+unsubscribe@openmrs.org
> <mailto:dev%2Bunsubscribe@openmrs.org>
> > <mailto:dev%2Bunsubscribe@openmrs.org
> <mailto:dev%252Bunsubscribe@openmrs.org>>
> > <mailto:dev%2Bunsubscribe@openmrs.org
> <mailto:dev%252Bunsubscribe@openmrs.org>
> > <mailto:dev%252Bunsubscribe@openmrs.org
> <mailto:dev%25252Bunsubscribe@openmrs.org>>>
> > > Manage your OpenMRS subscriptions: http://om.rs/id
> > > 
> > > *** FINAL WARNING: This group will be moved to OpenMRS Talk
> > > effective 10 April 2015 at 19:00 UTC. Please visit
> > > https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508
> > > for details and to make necessary changes.
> > > 
> > > 
> > > --
> > > OpenMRS Developers: http://om.rs/dev
> > > Post: dev@openmrs.org <mailto:dev@openmrs.org> <mailto:dev@openmrs.org
> <mailto:dev@openmrs.org>> | Unsubscribe:
> > dev+unsubscribe@openmrs.org <mailto:dev%2Bunsubscribe@openmrs.org>
> <mailto:dev%2Bunsubscribe@openmrs.org
> <mailto:dev%252Bunsubscribe@openmrs.org>>
> > > Manage your OpenMRS subscriptions: http://om.rs/id
> > > 
> > > *** FINAL WARNING: This group will be moved to OpenMRS Talk effective 10
> > > April 2015 at 19:00 UTC. Please visit
> > > https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508
> > > for details and to make necessary changes.
> > > 
> > > To unsubscribe from this group and stop receiving emails from it, send
> > > an email to dev+unsubscribe@openmrs.org <mailto:dev%2Bunsubscribe@openmrs.org>
> > <mailto:dev%2Bunsubscribe@openmrs.org
> <mailto:dev%252Bunsubscribe@openmrs.org>>
> > > <mailto:dev+unsubscribe@openmrs.org
> <mailto:dev%2Bunsubscribe@openmrs.org>
> > <mailto:dev%2Bunsubscribe@openmrs.org
> <mailto:dev%252Bunsubscribe@openmrs.org>>>.
> > 
> > --
> > OpenMRS Developers: http://om.rs/dev
> > Post: dev@openmrs.org <mailto:dev@openmrs.org>
> <mailto:dev@openmrs.org <mailto:dev@openmrs.org>> | Unsubscribe:
> > dev+unsubscribe@openmrs.org
> <mailto:dev%2Bunsubscribe@openmrs.org>
> <mailto:dev%2Bunsubscribe@openmrs.org
> <mailto:dev%252Bunsubscribe@openmrs.org>>
> > Manage your OpenMRS subscriptions: http://om.rs/id
> > 
> > *** FINAL WARNING: This group will be moved to OpenMRS Talk
> > effective 10 April 2015 at 19:00 UTC. Please visit
> > 
> https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508
> > for details and to make necessary changes.
> > 
> > 
> > --
> > OpenMRS Developers: http://om.rs/dev
> > Post: dev@openmrs.org <mailto:dev@openmrs.org> | Unsubscribe:
> dev+unsubscribe@openmrs.org <mailto:dev%2Bunsubscribe@openmrs.org>
> > Manage your OpenMRS subscriptions: http://om.rs/id
> > 
> > *** FINAL WARNING: This group will be moved to OpenMRS Talk
> effective 10
> > April 2015 at 19:00 UTC. Please visit
> > 
> https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508
> > for details and to make necessary changes.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to dev+unsubscribe@openmrs.org
> <mailto:dev%2Bunsubscribe@openmrs.org>
> > <mailto:dev+unsubscribe@openmrs.org
> <mailto:dev%2Bunsubscribe@openmrs.org>>.
> 
> --
> OpenMRS Developers: http://om.rs/dev
> Post: dev@openmrs.org <mailto:dev@openmrs.org> | Unsubscribe:
> dev+unsubscribe@openmrs.org <mailto:dev%2Bunsubscribe@openmrs.org>
> Manage your OpenMRS subscriptions: http://om.rs/id
> 
> *** FINAL WARNING: This group will be moved to OpenMRS Talk
> effective 10 April 2015 at 19:00 UTC. Please visit
> https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508
> for details and to make necessary changes.
> 
> To unsubscribe from this group and stop receiving emails from it,
> send an email to dev+unsubscribe@openmrs.org
> <mailto:dev%2Bunsubscribe@openmrs.org>.
> 
> 
> -- 
> OpenMRS Developers: http://om.rs/dev
> Post: dev@openmrs.org | Unsubscribe: dev+unsubscribe@openmrs.org
> Manage your OpenMRS subscriptions: http://om.rs/id
> 
> *** FINAL WARNING: This group will be moved to OpenMRS Talk effective 10
> April 2015 at 19:00 UTC. Please visit
> https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508
> for details and to make necessary changes.
> 
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dev+unsubscribe@openmrs.org
> <mailto:dev+unsubscribe@openmrs.org>.

-- 
OpenMRS Developers: http://om.rs/dev
Post: dev@openmrs.org | Unsubscribe: dev+unsubscribe@openmrs.org
Manage your OpenMRS subscriptions: http://om.rs/id

*** FINAL WARNING: This group will be moved to OpenMRS Talk effective 10 April 2015 \
at 19:00 UTC. Please visit \
https://talk.openmrs.org/t/openmrs-developers-group-changes-2015-04-10/1508 for \
details and to make necessary changes.

To unsubscribe from this group and stop receiving emails from it, send an email to \
dev+unsubscribe@openmrs.org.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic