Tomcat7 webapp start failure ContextLoader issue

610 views
Skip to first unread message

Sanket Gupte

unread,
Jan 23, 2017, 6:29:45 PM1/23/17
to xnat_discussion
Hola,
So, finally I decided to start the intimidating task of trying the migration from 1.6x to 1.7x
Failed at the first step.
Here is what I did/know

Copied new war to tomcat. Cleared the old war/webapp .
Restarted tomcat, I get 404 in the browser.

So, logs. All empty, except 1. The mighty spring.log 

2017-01-23 17:57:53,206 [localhost-startStop-1] WARN  org.springframework.web.context.support.AnnotationConfigWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.nrg.xnat.initialization.RootConfig]; nested exception is java.io.FileNotFoundException: class path resource [org/nrg/xnat/configuration/XnatServicesConfig.class] cannot be opened because it does not exist
2017-01-23 17:57:53,218 [localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org
.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.nrg.xnat.initialization.RootConfig]; nested exception is java.io.FileNotFoundException: class path resource [org/nrg/xnat/configuration/XnatServicesConfig.class] cannot be opened because it does not exist
        at org
.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:525)
        at org
.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:278)
        at org
.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:232)
        at org
.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:199)

I have java-7 . No evidence of java-8
Using my old setup. nginx with tomcat7 . In server.xml for tomcat I have
 <Context path="" docBase="/var/lib/tomcat7/webapps/xnat"/>
for the localhost -host.

For tomcat's catalina.out i have this:
Jan 23, 2017 5:57:13 PM org.apache.catalina.core.StandardEngine startInternal
INFO
: Starting Servlet Engine: Apache Tomcat/7.0.52 (Ubuntu)
Jan 23, 2017 5:57:53 PM org.apache.catalina.core.StandardContext startInternal
SEVERE
: Error listenerStart
Jan 23, 2017 5:57:53 PM org.apache.catalina.core.StandardContext startInternal
SEVERE
: Context [] startup failed due to previous errors

Thats all I know.
Any suggestions ?
Thanks a lot :)

Herrick, Rick

unread,
Jan 23, 2017, 7:37:38 PM1/23/17
to xnat_di...@googlegroups.com

That’s very strange, because that file isn’t imported by direct reference but by a scan: RootConfig imports ApplicationConfig, which scans a bunch of packages, including org.nrg.xnat.configuration which contains XnatServicesConfig. So Spring found XnatServicesConfig.class on that scan, but then can’t find it when it tries to load it.

 

I suspect it’s that <Context> element in your server.xml that’s causing the issue. Try shutting down Tomcat and removing the <Context> element from server.xml (in fact, you can restore the default server.xml file). Then rename the war file to ROOT.war, clear out any other folders under the webapps folder, and start Tomcat back up.

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

 

Voice: (314) 273-1645

Web: http://www.xnat.org

Twitter: @NrgXnat

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at https://groups.google.com/group/xnat_discussion.
For more options, visit https://groups.google.com/d/optout.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Sanket Gupte

unread,
Jan 24, 2017, 12:57:01 PM1/24/17
to xnat_discussion
Yeah that was the issue. Removing the context element (and tweaking a few other things did it)

Seems like I still have a long way to go.

I can reach the login screen. But when I log in (as admin) it is trying to go to the "Xnat Site Setup" page (/setup) but I only see a more or less blank screen. (Just see title)

I think tasks.log was relevant. So...

2017-01-24 12:37:18,321 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Update the user authentication table" completed at Tue Jan 24 12:37:18 EST 2017
2017-01-24 12:37:18,516 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Get site-wide PET tracer list" completed at Tue Jan 24 12:37:18 EST 2017
2017-01-24 12:37:18,533 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Encrypt XNAT passwords" completed at Tue Jan 24 12:37:18 EST 2017
2017-01-24 12:37:18,579 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Create or update database views" did not complete.
2017-01-24 12:37:18,588 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Get site-wide anon script" completed at Tue Jan 24 12:37:18 EST 2017
2017-01-24 12:37:18,978 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:37:18,981 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Update configuration service to convert long IDs to project IDs." completed at Tue Jan 24 12:37:18 EST 2017
2017-01-24 12:37:19,025 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Migrate XNAT database tables" completed at Tue Jan 24 12:37:19 EST 2017
2017-01-24 12:37:19,076 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Update new secure definitions" did not complete.
2017-01-24 12:37:34,083 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Create or update database views" did not complete.
2017-01-24 12:37:34,426 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:37:34,427 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Update new secure definitions" completed at Tue Jan 24 12:37:34 EST 2017
2017-01-24 12:37:55,886 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "Create or update database views" completed at Tue Jan 24 12:37:55 EST 2017
2017-01-24 12:37:58,852 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:38:14,161 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:38:29,404 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:38:44,653 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:38:59,896 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.
2017-01-24 12:39:15,178 [taskScheduler-1] INFO  org.nrg.xnat.initialization.InitializingTasksExecutor - Task "System Path Verification" did not complete.


and the last INFO message keeps repeating after every few seconds.

xdat.log looks like this
2017-01-24 12:37:32,723 [localhost-startStop-1] ERROR org.nrg.xdat.XDAT -
org
.nrg.xft.exception.ElementNotFoundException: Element not found: 'proc:genProcData'
        at org
.nrg.xft.meta.XFTMetaManager.FindElement(XFTMetaManager.java:189)
        at org
.nrg.xft.meta.XFTMetaManager.GetWrappedElementByName(XFTMetaManager.java:319)
        at org
.nrg.xft.schema.Wrappers.GenericWrapper.GenericWrapperElement.GetElement(GenericWrapperElement.java:160)
        at org
.nrg.xdat.XDAT.init(XDAT.java:326)
        at org
.nrg.xdat.servlet.XDATServlet.init(XDATServlet.java:72)
        at org
.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1279)
        at org
.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1192)
        at org
.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
        at org
.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5247)
        at org
.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5530)
        at org
.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org
.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org
.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org
.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
        at org
.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
        at org
.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
        at java
.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java
.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java
.lang.Thread.run(Thread.java:745)
2017-01-24 12:37:41,790 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Preparing to convert table xhbm_script_launch_request_event to use sequence for default value.
2017-01-24 12:37:41,791 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Queries prepared for conversion:
2017-01-24 12:37:41,791 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** CREATE SEQUENCE xhbm_script_launch_request_event_id_seq
2017-01-24 12:37:41,791 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** ALTER TABLE xhbm_script_launch_request_event ALTER COLUMN id SET DEFAULT nextval('xhbm_script_launch_request_event_id_seq')
2017-01-24 12:37:41,791 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** ALTER TABLE xhbm_script_launch_request_event ALTER COLUMN id SET NOT NULL
2017-01-24 12:37:41,791 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** ALTER SEQUENCE xhbm_script_launch_request_event_id_seq OWNED BY xhbm_script_launch_request_event.id
2017-01-24 12:37:41,837 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Ran the query SELECT (MAX(id) + 1) AS value FROM xhbm_script_launch_request_event and got the value 1
2017-01-24 12:37:41,837 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Now preparing to run the query: SELECT setval('xhbm_script_launch_request_event_id_seq', 1) AS value
2017-01-24 12:37:41,841 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Preparing to convert table xhbm_script_aud to use sequence for default value.
2017-01-24 12:37:41,841 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Queries prepared for conversion:
2017-01-24 12:37:41,841 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** CREATE SEQUENCE xhbm_script_aud_id_seq
2017-01-24 12:37:41,841 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** ALTER TABLE xhbm_script_aud ALTER COLUMN id SET DEFAULT nextval('xhbm_script_aud_id_seq')
2017-01-24 12:37:41,841 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** ALTER TABLE xhbm_script_aud ALTER COLUMN id SET NOT NULL
2017-01-24 12:37:41,842 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction -  *** ALTER SEQUENCE xhbm_script_aud_id_seq OWNED BY xhbm_script_aud.id
2017-01-24 12:37:41,848 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Ran the query SELECT (MAX(id) + 1) AS value FROM xhbm_script_aud and got the value 1
2017-01-24 12:37:41,848 [localhost-startStop-1] ERROR org.nrg.xft.db.DBAction - Now preparing to run the query: SELECT setval('xhbm_script_aud_id_seq', 1) AS value
2017-01-24 12:37:51,491 [taskScheduler-1] ERROR org.nrg.xdat.display.DisplayManager - Error in Display Document for 'xdat:user'.
No Such View Found. SESSION_ID

The first error ..well I think its not finding a datatype, which is okay since I haven't started dealing with the plugins yet. But the last line error. I dont know what that means.

What should I do.

Thanks :)

Herrick, Rick

unread,
Jan 24, 2017, 1:46:39 PM1/24/17
to xnat_di...@googlegroups.com

You’re actually starting up fine for the most part. The unresolved data type from your (non-existent or at least not-yet-extant) plugin is the problem. You have a reference in the table xdat_element_security to 'proc:genProcData'. The data-type manager starts at the security table, then tries to find the data type to set various properties correctly. It doesn’t find the data type, doesn’t deal with that particularly well, and blows up. We’re trying to locate areas in the code where this occurs so that we can catch those exceptions, log them with some useful information, and then proceed. I’ve already fixed the lines of code where you’re hitting that exception, but it’s not pushed up yet.

 

The way to work around this is, at this point, converting your data types into plugins. To get started, you could simply copy all of the data-type schemas over and create a jar file from those. First create an empty folder, then create a folder in there named schemas. Copy all of the folders containing your data-type schemas into that folder. So your structure should look something like this:

 

schemas

  |--proc

  |    |--proc.xsd

  |          |--displays

  |                |--proc_type1_display.xml

  |                |--proc_type2_display.xml

  |--other

  |    |--other.xsd

  |          |--displays

  |                |--other_type1_display.xml

  |                |--other_type2_display.xml

  |--another

       |--another.xsd

             |--displays

                   |--another_type1_display.xml

                   |--another_type2_display.xml

 

Now, in your working folder, run this command (you can change the name and version of the jar to whatever you want your plugin to be called, but you can remove it later and replace it with something with a different name and it won’t make any difference: nothing is tracked by the name of the jar file that contains it):

 

jar cf yourplugin-1.0.jar *

 

Now take the jar that it builds, copy it into the plugins folder of your XNAT installation, and restart Tomcat. That should help get the data types fully configured on start-up again and make these errors go away. You won’t have any of the report/edit screens for your data types and so on until you migrate the rest of the associated code, but it should at least get you where you can start up.

 

The tasks.log entry is just the system path verification start-up task indicating that it hasn’t yet verified the system paths (e.g. archive, prearchive, etc.). Which makes sense because those values haven’t yet been set. That said, the repeating warning is annoying and I believe it’s been fixed in the latest code (I think 1.7.2 has the fix: what version are you installing?).

 

The last error about xdat_user and SESSION_ID is a red herring. It’s happening in an area of the code that changing would cause lots of ripple effects, so we haven’t been able to fix it.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

 

Sanket Gupte

unread,
Jan 24, 2017, 2:03:40 PM1/24/17
to xnat_discussion
Okay. I'll build the plugin as you instructed.
I am using 1.7.2  I believe. I downloaded the 1.7.2 . It's whatever was there on this link yesterday (1/23/201): https://bintray.com/nrgxnat/applications/XNAT/

Herrick, Rick

unread,
Jan 24, 2017, 2:10:06 PM1/24/17
to xnat_di...@googlegroups.com

OK, system paths shouldn’t be doing that. I’ll verify that it works properly and fix it if not.

Sanket Gupte

unread,
Jan 24, 2017, 3:26:57 PM1/24/17
to xnat_discussion
Failing at a new step now. Probably for a similar reason. But at the same stage . Can't see anything on the setup page.

xdat.log  probably not relevant
2017-01-24 14:59:34,180 [taskScheduler-1] ERROR org.nrg.xdat.display.DisplayManager - Error in Display Document for 'xdat:user'.

No Such View Found. SESSION_ID

sql.log  definitely relevant
Message: ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-01-24 15:16:06,474 - SELECT pg_get_serial_sequence('xnat_projectData_resource','xnat_projectData_resource_id') AS col_name
2017-01-24 15:16:06,482 - SELECT pg_get_serial_sequence('xnat_projectData_investigator','xnat_projectData_investigator_id') AS col_name
2017-01-24 15:16:06,484 - SELECT * FROM xnat_projectData_investigator_xnat_projectData_investigator_id_seq
2017-01-24 15:16:06,485 - SELECT * FROM xnat_projectData_investigator_xnat_projectData_investigator__seq
2017-01-24 15:16:06,487 - SELECT pg_get_serial_sequence('xnat_subjectData_resource','xnat_subjectData_resource_id') AS col_name
2017-01-24 15:16:06,490 - SELECT pg_get_serial_sequence('xnat_experimentData_resource','xnat_experimentData_resource_id') AS col_name
2017-01-24 15:16:06,490 - SELECT * FROM xnat_experimentData_resource_xnat_experimentData_resource_id_seq
2017-01-24 15:16:06,497 - SELECT pg_get_serial_sequence('xnat_datatypeProtocol_fieldGroups','xnat_datatypeProtocol_fieldGroups_id') AS col_name
2017-01-24 15:16:06,498 - SELECT * FROM xnat_datatypeProtocol_fieldGroups_xnat_datatypeProtocol_fieldGroups_id_seq
2017-01-24 15:16:06,498 - SELECT * FROM xnat_datatypeProtocol_fieldGro_xnat_datatypeProtocol_fieldGro_seq
2017-01-24 15:16:22,804 - An error occurred in the SQL statement: --DISPLAY LINK
CREATE OR REPLACE VIEW displayfields_iq_iqAssessmentData AS SELECT SEARCH
.xnat_subjectAssessorData8 AS SUBJECT_ID, SEARCH.iq_iqAssessmentData0 AS EXPT_ID, '/@WEBAPP/images/r.gif'::text AS RPT, SEARCH.xnat_experime
ntData11 AS DATE
, CAST(COALESCE(EXTRACT(YEAR FROM AGE(SEARCH.xnat_experimentData11, SEARCH.xnat_demographicData_xnat_demographicData1)),FLOOR((EXTRACT(YEAR FROM SEARCH.xnat_experimentData11)) - ....ETC
Error: 0, state: 42P16
Message: ERROR: cannot change name of view column "iqsrc" to "iq_src"

So, yeah, it's about the old datatypes. But I did it. I did as you said. I have a jar file of the format you mention. I didn't change anything in the old schemas.

Similarly a few other errors.
Message: ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-01-24 15:16:22,808 - An error occurred in the SQL statement: --DEFINED VIEW
CREATE OR REPLACE VIEW VAL_PROTOCOLDATA_PROJECTS AS SELECT id
, '<' || expt.project || '>' || xs_a_concat(',<' || shared.project || '>') AS projects FROM xnat_experimentData expt LEFT JOIN xnat_experimentData_share shared ON expt.id=shared.sharing_share_xnat_experimentda_id LEFT JOIN xdat_meta_element xme ON expt.extension = xme.xdat_meta_element_id WHERE element_name='val:protocolData' GROUP BY expt.id,expt.project;


Error: 0, state: 25P02
Message: ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-01-24 15:16:22,808 - An error occurred in the SQL statement: --DISPLAY LINK
CREATE OR REPLACE VIEW displayfields_val_protocolData AS SELECT SEARCH
.val_protocolData0 AS EXPT_ID, '/@WEBAPP/images/r.gif'::text AS RPT, SEARCH.xnat_experimentData10 AS DATE, VAL_PROTOCOLDATA_PROJECTS_PROJECTS AS PROJECTS, COALESCE(SEARCH.xnat_experimentData26, SEARCH.val_protocolData0) AS LABEL, SEARCH.table5_login AS INSERT_USER, SEARCH.val_protocolData_meta_data466 AS INSERT_DATE, SEARCH.xnat_experimentData20 AS PROJECT, SEARCH.val_protocolData2 AS CHECK_STATUS, SEARCH.val_protocolData_meta_data463 AS QUARANTINE_STATUS  FROM (SELECT DISTINCT  table2.id AS val_protocolData0, table4.status AS val_protocolData_meta_data463, table2.date AS xnat_experimentData10, table2.label AS xnat_experimentData26, table5.login AS table5_login, table4.insert_date AS val_protocolData_meta_data466, table2.project AS xnat_experimentData20, val_protocolData.check_status AS val_protocolData2, VAL_PROTOCOLDATA_PROJECTS.PROJECTS AS VAL_PROTOCOLDATA_PROJECTS_PROJECTS FROM val_protocolData val_protocolData   LEFT JOIN xnat_imageAssessorData table0 ON val_protocolData.id=table0.id   LEFT JOIN xnat_derivedData table1 ON table0.id=table1.id   LEFT JOIN xnat_experimentData table2 ON table1.id=table2.id   LEFT JOIN val_protocolData_meta_data table4 ON val_protocolData.protocolData_info=table4.meta_data_id   LEFT JOIN xdat_user table5 ON table4.insert_user_xdat_user_id=table5.xdat_user_id  LEFT JOIN VAL_PROTOCOLDATA_PROJECTS VAL_PROTOCOLDATA_PROJECTS ON table2.id=VAL_PROTOCOLDATA_PROJECTS.id) SEARCH RIGHT JOIN (SELECT DISTINCT val_protocolData0 FROM (SELECT table2.id AS val_protocolData0, table2.date AS xnat_experimentData10 FROM val_protocolData val_protocolData   LEFT JOIN xnat_imageAssessorData table0 ON val_protocolData.id=table0.id   LEFT JOIN xnat_derivedData table1 ON table0.id=table1.id   LEFT JOIN xnat_experimentData table2 ON table1.id=table2.id) WHERE_CLAUSE ) WHERE_CLAUSE ON WHERE_CLAUSE.val_protocolData0=SEARCH.val_protocolData0 ORDER BY (SEARCH.val_protocolData0) ;


Error: 0, state: 25P02
Message: ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-01-24 15:16:22,809 - An error occurred in the SQL statement: --DEFINED VIEW
CREATE OR REPLACE VIEW LAST_LOGIN AS
select DISTINCT ON (user_xdat_user_id) user_xdat_user_id AS USER_ID, login_date FROM xdat_user_login ORDER BY user_xdat_user_id,login_date DESC;


Error: 0, state: 25P02
Message: ERROR: current transaction is aborted, commands ignored until end of transaction block
2017-01-24 15:16:22,809 - An error occurred in the SQL statement: --DEFINED VIEW
CREATE OR REPLACE VIEW XNAT_OTHERDICOMSESSIONDATA_PROJECTS AS SELECT id
, '<' || expt.project || '>' || xs_a_concat(',<' || shared.project || '>') AS projects FROM xnat_experimentData expt LEFT JOIN xnat_experimentData_share shared ON expt.id=shared.sharing_share_xnat_experimentda_id LEFT JOIN xdat_meta_element xme ON expt.extension = xme.xdat_meta_element_id WHERE element_name='xnat:otherDicomSessionData' GROUP BY expt.id,expt.project;


Error: 0, state: 25P02
Message: ERROR: current transaction is aborted, commands ignored until end of transaction block


And a few dozen more this type of errors.

How do I proceed :(

Herrick, Rick

unread,
Jan 24, 2017, 6:10:33 PM1/24/17
to xnat_di...@googlegroups.com

I think that this is related to a change in PostgreSQL or maybe a change in our configuration for PostgreSQL, where the available characters for identifiers changed or maybe how attribute and table names got truncated to generate the column names. I’m really not sure. Luckily, this is pretty easy, because views don’t contain data, so you can just completely do away with them and XNAT will rebuild them on restart.

 

Try this out:

 

https://gist.github.com/rherrick/efa7736f219ffec77efb6eea2124d3b4

 

You can run this through pgAdmin or the psql command-line client or whatever:

 

$ service tomcat7 stop

$ psql < find_and_drop_xnat_views.sql

$ psql -c "SELECT drop_xnat_views('xnat');"

$ service tomcat7 start

 

I’m going to try to get these into the SQL generated by XNAT itself, so it should always be available later on.

Sanket Gupte

unread,
Jan 24, 2017, 9:01:30 PM1/24/17
to xnat_discussion
Great. Thanks a bunch. That worked.
Tried it blindly first, didn't work. Then looked into the script, and figured out 'xnat' is the database user and not the database. So, changed it to what user I actually have. (I assumed it was deleting all views by all users.)

Also for people returning to this thread for a similar issue.. If needed you might want to add " -d xnatdb -U xnat01" after "psql" on the command line . And 'xnat01' as the argument to drop_xnat_views.  assuming your database is xnatdb and user is xnat01.
Reply all
Reply to author
Forward
0 new messages