Project ID was used in a previously deleted project and cannot be reused.

368 views
Skip to first unread message

jos...@viviano.ca

unread,
Jul 2, 2015, 5:14:42 PM7/2/15
to xnat_di...@googlegroups.com
Hi there,

Due to a typo we hastily deleted and tried to reconstitute a project with a very specific ID (we need this ID to be intact to maintain compatibility with our pipelines) and XNAT will not allow us to reuse this ID.

Is there a workaround?

Thanks,
Joseph

Moore, Charlie

unread,
Jul 2, 2015, 5:24:21 PM7/2/15
to xnat_di...@googlegroups.com

Joseph,

 

What version of XNAT are you running? I believe this should be possible as of 1.6.4.

 

Thanks,

Charlie

--
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 http://groups.google.com/group/xnat_discussion.
For more options, visit https://groups.google.com/d/optout.

jos...@viviano.ca

unread,
Jul 2, 2015, 5:51:31 PM7/2/15
to xnat_di...@googlegroups.com, moo...@wustl.edu
We're using 1.6.2.1

Moore, Charlie

unread,
Jul 2, 2015, 6:02:53 PM7/2/15
to jos...@viviano.ca, xnat_di...@googlegroups.com

Other than an upgrade to 1.6.4, I’m not sure what your options are for a workaround. Rick, if you have any ideas, the original bug where Jenny wanted this is XARC-1471 (this is not publicly accessible, sorry).

 

Thanks,

Charlie

Herrick, Rick

unread,
Jul 2, 2015, 7:13:00 PM7/2/15
to xnat_di...@googlegroups.com, jos...@viviano.ca
Joseph,

As Charlie says, the most straightforward fix would be an upgrade to 1.6.4 or to wait until 1.6.5 is released, which will be a matter of a couple of weeks.

The other option is to pull in the changeset where this fix was made:


Save the contents of that as a file, e.g. file.diff, then, on top of your xnat_builder folder, run this:

hg qimport file.diff
hg qpush

Then run your update script. I think that should work. If it *doesn’t* work (and I can’t test it properly because I have other change sets in my builder and Mercurial gets upset at me), you can try making those changes in the respective Java files directly.

This will make your builder a bit more difficult to update later, but you should be able to roll back the patch with:

hg qpop
hg qrm file.diff

Hope this helps. If you have any difficulties, let me know.

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

(314) 740-5961



The material in this message is private and may contain Protected Healthcare Information (PHI). 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.

shaoyu su

unread,
Sep 18, 2017, 2:17:46 PM9/18/17
to xnat_discussion
Hi, Rick,

This also occurs on version 1.7.3.1, build: 1358.

Thanks,

Shaoyu

Herrick, Rick

unread,
Sep 18, 2017, 3:04:35 PM9/18/17
to xnat_di...@googlegroups.com

By default, you still can’t re-use previously used project IDs. This is controlled by the “security.allowProjectIdReuse” site configuration property, which defaults to false. You set this to true with a call to the REST API:

 

$ http --session=admin --print=b POST xnat-dev04.nrg.mir/xapi/siteConfig/security.allowProjectIdReuse <<< "true"

$ http --session=admin --print=b xnat-dev04.nrg.mir/xapi/siteConfig/security.allowProjectIdReuse

true

 

With that, you should be to re-use project IDs of projects that are deleted after setting that property. To re-use the project IDs of projects deleted before setting the property, you’ll also need to run a query to update your XNAT installation’s project history table:

 

xnat=> UPDATE xnat_projectdata_history SET id = CONCAT(id, EXTRACT(EPOCH FROM change_date) * 1000);

 

This needs to be run against the database for your XNAT server, either using the psql command-line client or some sort of admin UI for the database like pgAdmin. You could run it from the command line by wrapping up the psql call as well:

 

$ sudo -u xnat psql -c "UPDATE xnat_projectdata_history SET id = CONCAT(id, EXTRACT(EPOCH FROM change_date) * 1000)"

 

You’d need to change the user names to have the correct XNAT service (i.e. Tomcat) account and database user names.

 

-- 

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine


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.

shaoyu su

unread,
Sep 18, 2017, 3:35:44 PM9/18/17
to xnat_discussion
Rick,

Thank you so much for the detailed answer! It is very much better than my brutal approach by directly deleting data in xnat_projectdata_history table.

Shaoyu
Reply all
Reply to author
Forward
0 new messages