meta_element insertion can cause archiving errors in XNAT when archiving many studies at once
Description
Environment
None
QA Notes
None
Attachments
1
- 21 Apr 2022, 10:23 PM
relates to
Activity
Show:
Charlie Moore April 13, 2023 at 8:35 PM
I’ve been spamming my XNAT with sessions over and over today and haven’t seen this once, so I’m cautiously optimistic we’re good to go
Charlie Moore April 5, 2023 at 5:53 PM
If you start up XNAT on a fresh database now, you get this pretty scary-looking message in configuration.log
from these changes:
2023-04-05 12:46:13,638 [taskScheduler-1] ERROR org.nrg.xnat.initialization.InitializingTasksExecutor - An error occurred while running the task Initialize all caches that implement the Initializing interface., 1 incomplete tasks found.
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT xdat_meta_element_id, element_name FROM xdat_meta_element WHERE element_name IN ()]; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Position: 89
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:230)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:654)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:688)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:715)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:765)
at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192)
at org.nrg.xnat.services.cache.DefaultCacheManager.initializeXdatMetaElements(DefaultCacheManager.java:346)
at org.nrg.xnat.services.cache.DefaultCacheManager.initialize(DefaultCacheManager.java:129)
at org.nrg.xnat.initialization.tasks.InitializeCachesTask.processUninitializedCaches(InitializeCachesTask.java:92)
at org.nrg.xnat.initialization.tasks.InitializeCachesTask.callImpl(InitializeCachesTask.java:50)
at org.nrg.xnat.initialization.tasks.AbstractInitializingTask.call(AbstractInitializingTask.java:31)
at org.nrg.xnat.initialization.tasks.AbstractInitializingTask.call(AbstractInitializingTask.java:18)
at org.nrg.xnat.initialization.InitializingTasksExecutor$CheckTasks.runTask(InitializingTasksExecutor.java:61)
at org.nrg.xnat.task.AbstractXnatRunnable.run(AbstractXnatRunnable.java:33)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Position: 89
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2510)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2245)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:311)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:447)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:368)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:159)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:109)
at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:696)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:638)
... 20 common frames omitted
Flagged
Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Charlie MooreCharlie Moore(Deactivated)Reporter
Charlie MooreCharlie Moore(Deactivated)Labels
Due date
Feb 23, 2023Product Team
CoreStart date
Feb 23, 2023Sprint
NoneFix versions
Priority
Critical
Details
Details
Assignee
Charlie Moore
Charlie Moore(Deactivated)Reporter
Charlie Moore
Charlie Moore(Deactivated)Labels
Due date
Feb 23, 2023
Product Team
Core
Start date
Feb 23, 2023
Sprint
None
Fix versions
Priority
More fields
Time tracking
More fields
Time tracking
More fields
Time trackingZendesk Support
Linked Tickets
Zendesk Support
Linked Tickets
Zendesk Support

Linked Tickets
Clockify
Start / Stop
Clockify
Start / Stop
Clockify

Start / Stop
Created April 21, 2022 at 10:22 PM
Updated October 11, 2023 at 2:54 PM
Resolved April 6, 2023 at 3:24 PM
When you send several small studies to XNAT's CSTORE receiver sequentially without delay, XNAT tends to encounter errors. In particular, I sent around 1000 studies, and around 10 ended up in "Error" state in the prearchive instead of autoarchiving correctly. The most common way this manifests which we’re tackling in 1.8.8 is shown in the screenshot.