Unable to move files from within smart folders - Type virtualization template search failed error

cancel
Showing results for 
Search instead for 
Did you mean: 
therealkemmett
Active Member

Unable to move files from within smart folders - Type virtualization template search failed error

I have created a two level folder structure. A folder on the second level has a rule that sets the file type, and an aspect that creates some smart folders and adds/sets some properties on files when they are moved into the folder (very similar to the claims example in the smart folders tutorial - see https://docs.alfresco.com/community/tasks/sf-tutorial.html). When a file is dragged into one of the smart folders, the file is typed, aspects added, and properties populated successfully.

However, I am subsequently unable to move those files into other folders, to either the root (Documents) or second level. Alfresco logs show

"2018-05-17 14:49:33,120 ERROR [org.alfresco.repo.virtual.store.TypeVirtualizationMethod] [http-apr-8080-exec-45] Type virtualization template search failed.
org.alfresco.traitextender.ExtensionTargetException: java.lang.StackOverflowError" and a long trace.

Using Alfresco Community (Build: 201605)

8 Replies
afaust
Master

Re: Unable to move files from within smart folders - Type virtualization template search failed error

Though it is long, it would be good to have the stacktrace attached to your question, so people could check it to find which operation has a bug (and a stackoverflow is almost always a bug / programming error). Also, could you check / verify this issue still exists in the most recent Community GA version (201707)?

therealkemmett
Active Member

Re: Unable to move files from within smart folders - Type virtualization template search failed error

Thanks for the quick reply Axel. I've followed your advice and attached the trace for reference.

I'm not easily able to update to the latest Community edition here at work; I can try on my home system (unfortunately a different OS).

afaust
Master

Re: Unable to move files from within smart folders - Type virtualization template search failed error

Looking at the stacktrace, the issue looks to be caused by an interesting constellation with your smart folder structure. Could it be that your smart folder structure accidentally contains a smart folder which - via its selection query - contains the top level folder and thus creates a circular graph? That's the only way that this stack overflow issue could be caused.

When using traditional folders, Alfresco will prevent the user from creating circular graphs, i.e. create a folder which in itself contains a parent/ancestor folder. But with smart folders, it is not protected against this since the folder query can select anything.

therealkemmett
Active Member

Re: Unable to move files from within smart folders - Type virtualization template search failed error

That's possible Axel. I appreciate your help with this -  I'm new to Alfresco, and have been relying on the smart folders tutorial for guidance.

I have a number of nodes, each structured as follows:

{

"name" : Test media example",
    "nodes" :
    [
        {
            "id" : "00",
            "name" : "00 General",
            "description":"Aircraft System 00",
            "search" : {
                "language" : "fts-alfresco",
                "query" : "(PATH:'/app:company_home/st:sites//*') AND =kwgt:ataChapter:'00 General'"
            },
            "filing" : {
                "path" : "%ACTUAL_PATH%",
                "classification" : {
                    "aspects" : [
                        "kwgt:ataData", "kwgt:commonData"
                    ]
                },
                "properties" : {
                    "kwgt:ataChapter" : "00 General",
                    "kwgt:docStatus" : "New",
                    "kwgt:docSensitivity" : "Basic"
                }
            }
        },

   ....

]

}

These build the structure in the "Incoming" folder in the below screen grab. The idea is that a user can drag a file into one of the smart folders to have two aspects attached, and some properties set. We would subsequently like to use folders to mark and change the status (availability) of the file, and other properties in it's lifecycle.

On further checking, I can move a file if I remove the kwgt:ataData aspect from it. This aspect has one property, which is a list of values.

Example of the folder hierarchy

afaust
Master

Re: Unable to move files from within smart folders - Type virtualization template search failed error

So I actually now have had a similar use case on Alfresco 6.0. Interestingly, I did not get your error, but a different one - maybe yours was only present in that particular version. Technically, the implementation of Smart Folders prevents files from being moved from one Smart Folder into another. This limitation was knowingly added by Alfresco in order to enable them to release the first version of Smart Folders in the release that they had targeted. Unfortunately since then, no further update has been made to that feature. I have actually started to implement some patches to the core in order to deal with my use case ("moving around files / folders between Smart Folders to change the status /reclassify them").

You can always move the same files outside of a Smart Folder context. But you need to find the file outside of the Smart Folder in the first place to be able to do that. In my use case, the user only has access to the Smart Folders and the physical folders are actually hidden, so they cannot get to the file in any other context.

therealkemmett
Active Member

Re: Unable to move files from within smart folders - Type virtualization template search failed error

Hi Axel, I greatly appreciate you following up to resolve this. I have spent a great deal of time trying to work out what I was doing wrong Smiley Sad

Smart folders are very useful and powerful but I think their usefulness is limited by this inhibited functionality. Moving files from folder to folder is a handy way to add and change file properties. Hopefully the functionality will be improved in future versions.

afaust
Master

Re: Unable to move files from within smart folders - Type virtualization template search failed error

I also made this a topic in the recent Office Hours session in order to find out more about the reasons those limitations are there (they claimed they encountered issues / side effects with transactionality) and how we could best procede to potentially have changes I make integrated in the core.

therealkemmett
Active Member

Re: Unable to move files from within smart folders - Type virtualization template search failed error

Thanks Axel, hopefully they will support your changes.

Do you think it would be helpful to update the current smart folders documentation and tutorials to reflect the current limitation? It would have saved us a lot of time.