Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign key constraint on name_usage_2295_name_id_fkey #996

Closed
gdower opened this issue Apr 5, 2021 · 2 comments
Closed

Foreign key constraint on name_usage_2295_name_id_fkey #996

gdower opened this issue Apr 5, 2021 · 2 comments
Labels

Comments

@gdower
Copy link
Contributor

gdower commented Apr 5, 2021

The preview release failed with a foreign key constraint on name_usage_2295_name_id_fkey. The referenced nameID 4b4998a5-efb9-4712-99cb-a11e284320ab is Lophogastrida G. O. Sars, 1870 from ITIS. It's not flagged with any importer issues.

Logs:

org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "name_usage_2295" violates foreign key constraint "name_usage_2295_name_id_fkey"
  Detail: Key (name_id)=(4b4998a5-efb9-4712-99cb-a11e284320ab) is not present in table "name_2295".
### The error may exist in life/catalogue/db/mapper/DatasetPartitionMapper.xml
### The error may involve life.catalogue.db.mapper.DatasetPartitionMapper.createFk-Inline
### The error occurred while setting parameters
### SQL: ALTER TABLE name_usage_2295 ADD FOREIGN KEY (name_id) REFERENCES name_2295      ON DELETE CASCADE
### Cause: org.postgresql.util.PSQLException: ERROR: insert or update on table "name_usage_2295" violates foreign key constraint "name_usage_2295_name_id_fkey"
  Detail: Key (name_id)=(4b4998a5-efb9-4712-99cb-a11e284320ab) is not present in table "name_2295".
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:67)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:57)
	at com.sun.proxy.$Proxy151.createFk(Unknown Source)
	at life.catalogue.db.mapper.DatasetPartitionMapper.lambda$attach$14(DatasetPartitionMapper.java:224)
	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
	at life.catalogue.db.mapper.DatasetPartitionMapper.lambda$attach$15(DatasetPartitionMapper.java:224)
	at java.base/java.util.Map.forEach(Map.java:661)
	at life.catalogue.db.mapper.DatasetPartitionMapper.attach(DatasetPartitionMapper.java:224)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
	at org.apache.ibatis.binding.MapperProxy.invokeDefaultMethod(MapperProxy.java:76)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:51)
	at com.sun.proxy.$Proxy151.attach(Unknown Source)
	at life.catalogue.dao.Partitioner.attach(Partitioner.java:105)
	at life.catalogue.dao.Partitioner.attach(Partitioner.java:91)
	at life.catalogue.release.AbstractProjectCopy.run(AbstractProjectCopy.java:132)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "name_usage_2295" violates foreign key constraint "name_usage_2295_name_id_fkey"
  Detail: Key (name_id)=(4b4998a5-efb9-4712-99cb-a11e284320ab) is not present in table "name_2295".
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:473)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:393)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
	at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:153)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
	... 19 common frames omitted
@gdower gdower added the bug label Apr 5, 2021
@yroskov
Copy link

yroskov commented Apr 5, 2021

I established order Lophogastrida as a new ITIS sector recently (2021-04-02): CatalogueOfLife/testing#8

This order appears in Search (Assembly) twice:
image

There is no access to the first name in the Index.

@gdower
Copy link
Contributor Author

gdower commented Apr 5, 2021

I think we figured it out and are going to run another release. I'll re-open this if we still have an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants