Skip to content

Fix TAXONLABEL.linked column type mismatch causing nexus file upload failure#402

Merged
rvosa merged 2 commits intomasterfrom
copilot/fix-nexus-file-upload-insert
Jan 13, 2026
Merged

Fix TAXONLABEL.linked column type mismatch causing nexus file upload failure#402
rvosa merged 2 commits intomasterfrom
copilot/fix-nexus-file-upload-insert

Conversation

Copy link
Contributor

Copilot AI commented Jan 13, 2026

Nexus file uploads fail with SQLGrammarException because TAXONLABEL.linked column is smallint in the database but the Java entity expects boolean. PostgreSQL rejects the type mismatch on insert.

Changes

  • Database migration (patches/0010_fix-taxonlabel-linked-column-type.sql): Converts linked column from smallint to boolean
    ALTER TABLE taxonlabel
        ALTER COLUMN linked TYPE boolean
        USING (linked <> 0);
  • Updated init_db_uptodate.pg: Added missing patch includes (0008, 0009) and new patch (0010)

Applying to existing databases

psql -d treebase -f patches/0010_fix-taxonlabel-linked-column-type.sql
Original prompt

When I do a nexus file upload, the parsing works but the insert of the resulting data files:

Data Access Failure
could not execute batch; SQL [insert into TAXONLABEL (VERSION, LINKED, STUDY_ID, TaxonLabel, TAXONVARIANT_ID, TAXONLABEL_ID) values (?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute batch

org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute batch; SQL [insert into TAXONLABEL (VERSION, LINKED, STUDY_ID, TaxonLabel, TAXONVARIANT_ID, TAXONLABEL_ID) values (?, ?, ?, ?, ?, ?)]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute batch at org.springframework.orm.hibernate5.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:195) at org.springframework.orm.hibernate5.HibernateTemplate.doExecute(HibernateTemplate.java:374) at org.springframework.orm.hibernate5.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:334) at org.springframework.orm.hibernate5.HibernateTemplate.flush(HibernateTemplate.java:786) at org.cipres.treebase.dao.AbstractDAO.flush(AbstractDAO.java:164) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:234) at jdk.proxy3/jdk.proxy3.$Proxy125.flush(Unknown Source) at org.cipres.treebase.service.study.SubmissionServiceImpl.addNexusFile(SubmissionServiceImpl.java:691) at org.cipres.treebase.service.study.SubmissionServiceImpl.addNexusFilesJDBC(SubmissionServiceImpl.java:604) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:569) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241) at jdk.proxy3/jdk.proxy3.$Proxy141.addNexusFilesJDBC(Unknown Source) at org.cipres.treebase.web.controllers.UploadFileController.onSubmit(UploadFileController.java:219) at org.cipres.treebase.web.compat.CancellableFormController.processFormSubmission(CancellableFormController.java:209) at org.cipres.treebase.web.compat.CancellableFormController.handleRequestInternal(CancellableFormController.java:112) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:177) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:51) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at javax.servlet.http.HttpServlet.service(HttpServlet.java:555) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:142) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:239) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFil...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…lint to boolean

Co-authored-by: rvosa <106490+rvosa@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix data access failure during nexus file upload insert Fix TAXONLABEL.linked column type mismatch causing nexus file upload failure Jan 13, 2026
Copilot AI requested a review from rvosa January 13, 2026 19:17
@rvosa rvosa marked this pull request as ready for review January 13, 2026 19:28
@rvosa rvosa merged commit 331f0cd into master Jan 13, 2026
3 checks passed
@rvosa rvosa deleted the copilot/fix-nexus-file-upload-insert branch January 13, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants