cancel
Showing results for 
Search instead for 
Did you mean: 

web script search returning deleted nodes...

mfishm1
Champ in-the-making
Champ in-the-making
Hi,

I have a webscript that I am calling through a rest call that makes a call like:

var nodes = search.luceneSearch("TYPE:\"{http://www.mycompany.org/model/myproject/1.0}fileType\"", "cm:created", true);

It has been working for quite a while but, for some reason, I recently got into a situation where this query started returning nodes that already have there node_deleted marked to true.  This caused the following exception:

<exception>org.alfresco.web.scripts.WebScriptException - Wrapped Exception (with status template): Error during processing of the template 'get(name) failed on instance of org.alfresco.repo.template.TempalteNode'.  Please contact your system adminstrator.</exception>
<callstack>
org.alfresco.service.cmr.repository.InvalidNodeRefException:  Node does not exist:  workspace://SpaceStore/2471d2c8-1fdf-4f3b-9421-b36e056506e1
org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:156)
org.alfresco.repo.node.db.DbNodeServiceImpl.hasAspect(DbNodeServiceImpl.java:712)


I am currently using alfresco labs 3.0 stable version. 

Could anyone suggest what could cause this problem or a good way to at least detect it and prune those nodes from my list?

Thanks.
3 REPLIES 3

tuty_richard
Champ in-the-making
Champ in-the-making
Hi,

By any chance are you able to resolve this poblem. If you solved can please share me the solution.

Regards
Richard

mrogers
Star Contributor
Star Contributor
What is probably happening is that you are finding nodes in the ArchiveStore as well as the workspace store.

Just filter out the results according to which store they are in.

tuty_richard
Champ in-the-making
Champ in-the-making
Hi mrogers,

Thanks for your updates. I tried ASPECT:\sys:archived to filter that result but its working at one level.
For example If I have space like  comapnyhome/test/test1/test2. If I delete test2 folder and files inside it and executed query it works but if try to delete a folder directly of test folder again the issue persits.

Var query = "@cm\\:created:["+ tdate + " TO "+ fdate +"] -ASPECT:\"sys:archived\"

I you have any idea on how to filter can you please help me out.

Regards
Richard