Issue 18090
clb importer insert SQL error
18090
Reporter: mdoering
Type: Bug
Summary: clb importer insert SQL error
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2015-12-16 09:45:13.099
Updated: 2015-12-16 09:54:42.141
Resolved: 2015-12-16 09:54:41.966
Description: When indexing CoL on UAT with current snapshot code I get import exceptions.
There are 1.693.566 PSQLException occurring in the logs, suggesting no extension record made it through:
-----
[crap@uatcrawler-vh logs]$ less clb-importer.log
ERROR [2015-12-15 00:00:00,000+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: Failed to sync extensions for usage 105882128
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820671) already exists.
### The error may involve org.gbif.checklistbank.service.mybatis.mapper.SpeciesProfileMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO species_info (usage_fk, living_period, life_form, habitat, marine, freshwater, terrestrial, extinct, hybrid, age_in_days, size_in_millimeter, mass_in_gram, source_fk ) VALUES (?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ? )
### Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820671) already exists.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:341) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.sun.proxy.$Proxy39.insert(Unknown Source) ~[na:na]
at org.apache.ibatis.session.SqlSessionManager.insert(SqlSessionManager.java:220) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:52) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.sun.proxy.$Proxy52.insert(Unknown Source) ~[na:na]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.syncExtensionsInternal(DatasetImportServiceMyBatis.java:267) [checklistbank-cli.jar:2.30-SNAPSHOT]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.access$000(DatasetImportServiceMyBatis.java:68) [checklistbank-cli.jar:2.30-SNAPSHOT]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis$SyncExtension.run(DatasetImportServiceMyBatis.java:514) [checklistbank-cli.jar:2.30-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820671) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:495) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:488) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:45) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:73) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
... 18 common frames omitted
INFO [2015-12-15 00:00:00,014+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage org.gbif.checklistbank.model.UsageExtensions@4d648ac
INFO [2015-12-15 00:00:00,014+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage descriptions []
INFO [2015-12-15 00:00:00,014+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage distributions [Distribution{locality=Irish Exclusive economic Zone, country=null,
Status: PRESENT, lifeStage=null, temporal=null, threatStatus=null, establishmentMeans=null, appendixCites=null, source=Guiry, M.D. & Guiry, G.M. (2011). Species.ie version 1.0 World-wide electronic publication, National University of Ireland, Galway (version of 15 March 2010)., sourceTaxonKey=null, startDayOfYear=null, endDayOfYear=null, locationId=null, remarks=null}, Distribution{locality=European Marine Waters, country=null, status=PRESENT, lifeStage=null, temporal=null, threatStatus=null, establishmentMeans=null, appendixCites=null, source=Boxshall, G. (2001). Copepoda (excl. Harpacticoida), in: Costello, M.J. et al. (Ed.) (2001). European register of marine species: a check-list of the marine species in Europe and a bibliography of guides to their identification. Collection Patrimoines Naturels, 50: pp. 252-268, sourceTaxonKey=null, startDayOfYear=null, endDayOfYear=null, locationId=MRGID:7130, remarks=null}]
INFO [2015-12-15 00:00:00,014+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage identifiers []
INFO [2015-12-15 00:00:00,014+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage media []
INFO [2015-12-15 00:00:00,015+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage references [Reference{citation=Boxshall, G. (2001). Copepoda (excl. Harpacticoida), in: Costello, M.J. et al. (Ed.) (2001). European register of marine species: a check-list of the marine species in Europe and a bibliography of guides to their identification. Collection Patrimoines Naturels, 50: pp. 252-268, link=null, type=basis of record, remarks=null, doi=null, source=null, sourceTaxonKey=null}]
INFO [2015-12-15 00:00:00,015+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage speciesProfiles [SpeciesProfile{livingPeriod=null, lifeForm=null, habitat=null, marine=true, terrestrial=false, extinct=null, hybrid=null, ageInDays=null, sizeInMillimeter=null, massInGram=null, source=null, sourceTaxonKey=null}]
INFO [2015-12-15 00:00:00,015+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage typeSpecimens []
INFO [2015-12-15 00:00:00,015+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage vernacularNames []
ERROR [2015-12-15 00:00:00,020+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: Failed to sync extensions for usage 106075629
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820672) already exists.
### The error may involve org.gbif.checklistbank.service.mybatis.mapper.SpeciesProfileMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO species_info (usage_fk, living_period, life_form, habitat, marine, freshwater, terrestrial, extinct, hybrid, age_in_days, size_in_millimeter, mass_in_gram, source_fk ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820672) already exists.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:341) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.sun.proxy.$Proxy39.insert(Unknown Source) ~[na:na]
at org.apache.ibatis.session.SqlSessionManager.insert(SqlSessionManager.java:220) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:52) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.sun.proxy.$Proxy52.insert(Unknown Source) ~[na:na]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.syncExtensionsInternal(DatasetImportServiceMyBatis.java:267) [checklistbank-cli.jar:2.30-SNAPSHOT]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.access$000(DatasetImportServiceMyBatis.java:68) [checklistbank-cli.jar:2.30-SNAPSHOT]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis$SyncExtension.run(DatasetImportServiceMyBatis.java:514) [checklistbank-cli.jar:2.30-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820672) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:495) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:488) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:45) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:73) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
... 18 common frames omitted
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage org.gbif.checklistbank.model.UsageExtensions@3f5eb595
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage descriptions []
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage distributions []
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage identifiers []
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage media []
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage references [Reference{citation=Clark, H.L. (1912): Hawaiian and other Pacific Echini. The Pedinidae, Phymosomatidae, Stomopneustidae, and Echinometridae. - Memoirs of the Museum of Comparative Zoölogy at Harvard College, 34/4: 205-383., link=null, type=new combination reference, remarks=null, doi=null, source=null, sourceTaxonKey=null}, Reference{citation=Meijere, J.C.H.d. (1903): Vorläufige Beschreibung der neuen, durch die Siboga-Expedition gesammelten Echiniden. - Tijdschrift der Nederlandsche Dierkundige Vereeniging, 2de serie, 8/1: 1-16., link=null, type=original description, remarks=null, doi=null, source=null, sourceTaxonKey=null}, Reference{citation=Mortensen, T. (1940b). A Monograph of the Echinoidea. III, 1. Aulodonta, with Additions to Vol. II (Lepidocentroida and Stirodonta). 370 pp., C. A. Reitzel, Copenhagen., link=null, type=basis of record, remarks=null, doi=null, source=null, sourceTaxonKey=null}]
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage speciesProfiles [SpeciesProfile{livingPeriod=null, lifeForm=null, habitat=null, marine=true, terrestrial=false, extinct=false, hybrid=null, ageInDays=null, sizeInMillimeter=null, massInGram=null, source=null, sourceTaxonKey=null}]
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage typeSpecimens []
INFO [2015-12-15 00:00:00,021+0100] [import-mybatis-thread-1] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage vernacularNames []
ERROR [2015-12-15 00:00:00,022+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: Failed to sync extensions for usage 105954291
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820673) already exists.
### The error may involve org.gbif.checklistbank.service.mybatis.mapper.SpeciesProfileMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO species_info (usage_fk, living_period, life_form, habitat, marine, freshwater, terrestrial, extinct, hybrid, age_in_days, size_in_millimeter, mass_in_gram, source_fk ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820673) already exists.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_60]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_60]
at org.apache.ibatis.session.SqlSessionManager$SqlSessionInterceptor.invoke(SqlSessionManager.java:341) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.sun.proxy.$Proxy39.insert(Unknown Source) ~[na:na]
at org.apache.ibatis.session.SqlSessionManager.insert(SqlSessionManager.java:220) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:52) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.sun.proxy.$Proxy52.insert(Unknown Source) ~[na:na]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.syncExtensionsInternal(DatasetImportServiceMyBatis.java:267) [checklistbank-cli.jar:2.30-SNAPSHOT]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis.access$000(DatasetImportServiceMyBatis.java:68) [checklistbank-cli.jar:2.30-SNAPSHOT]
at org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis$SyncExtension.run(DatasetImportServiceMyBatis.java:514) [checklistbank-cli.jar:2.30-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_60]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820673) already exists.
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:495) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:488) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:45) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:73) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170) ~[checklistbank-cli.jar:2.30-SNAPSHOT]
... 18 common frames omitted
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage org.gbif.checklistbank.model.UsageExtensions@8b831a1
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage descriptions []
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage distributions []
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage identifiers []
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage media []
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage references []
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage speciesProfiles [SpeciesProfile{livingPeriod=null, lifeForm=null, habitat=null, marine=null, terrestrial=null, extinct=null, hybrid=null, ageInDays=null, sizeInMillimeter=null, massInGram=null, source=null, sourceTaxonKey=null}]
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage typeSpecimens []
INFO [2015-12-15 00:00:00,023+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: failed usage vernacularNames []
ERROR [2015-12-15 00:00:00,034+0100] [import-mybatis-thread-2] org.gbif.checklistbank.service.mybatis.DatasetImportServiceMyBatis: Failed to sync extensions for usage 106058987
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820674) already exists.
### The error may involve org.gbif.checklistbank.service.mybatis.mapper.SpeciesProfileMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO species_info (usage_fk, living_period, life_form, habitat, marine, freshwater, terrestrial, extinct, hybrid, age_in_days, size_in_millimeter, mass_in_gram, source_fk ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
### Cause: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "species_info_pkey"
Detail: Key (id)=(820674) already exists.
]]>
Author: mdoering@gbif.org
Created: 2015-12-16 09:51:58.132
Updated: 2015-12-16 09:51:58.132
This is a database problem. The postgres id generating sequences are behind actually used values.
Probably comes from copying the db from prod. Emending sequences with:
{noformat)
SELECT setval('citation_id_seq', (select max(id) from citation)+1);
SELECT setval('description_id_seq', (select max(id) from description)+1);
SELECT setval('distribution_id_seq', (select max(id) from distribution)+1);
SELECT setval('identifier_id_seq', (select max(id) from identifier)+1);
SELECT setval('literature_id_seq', (select max(id) from literature)+1);
SELECT setval('media_id_seq', (select max(id) from media)+1);
SELECT setval('name_id_seq', (select max(id) from name)+1);
SELECT setval('name_usage_id_seq', (select max(id) from name_usage)+1);
SELECT setval('species_info_id_seq', (select max(id) from species_info)+1);
SELECT setval('typification_id_seq', (select max(id) from typification)+1);
SELECT setval('vernacular_name_id_seq', (select max(id) from vernacular_name)+1);
SELECT setval('dataset_metrics_id_seq', (select max(id) from dataset_metrics)+1);
{noformat)