cancel
Showing results for 
Search instead for 
Did you mean: 

Locked Document in 5.0.d

mrks_js1
Star Contributor
Star Contributor

Hi

I have 1 document in my test system that has a hardcore persistent lock. keeps me from trying to reproduce some issues. restart does _not_ clear the lock.

the document is not visible in the share doclib view. but it can be found in the node browser.

the document has these lock related properties:

cm:lockType = READ_ONLY_LOCK

cm:lockLifetime = PERSISTENT

cm:lockAdditionalInfo = null

cm:lockOwner = admin

And following lock-related aspects.

cm:lockable
cm:checkedOut

i can only access the preview of the document by assembling the url:

... document-details?nodeRef=workspace://SpacesStore/9d647cd6-fdb6-…

=> none of the document actions are present, the right menu is missing completely.

message on top says The item cannot be found. Either you do not have permissions to view the item, it has been removed or it never existed.

I also tried via js console to

node.removeAspect("cm:checkedOut");

= Cannot perform operation since the node (id:9d647cd6-fdb6-4033-83e7-08f05b1d3565) is locked.

node.cancelCheckout();

= Access Denied. You do not have the appropriate permissions to perform this operation.

node.unlock();

= The node (id: 9d647cd6-fdb6-4033-83e7-08f05b1d3565) could not be unlocked since it is checked out.

ran these as admin.

no locks on alfresco related tables in the database.

halp! Smiley Sad

version is 5.0.d community

7 REPLIES 7

kaynezhang
World-Class Innovator
World-Class Innovator

A node 's lock is saved in cm:lockable aspect and cm:lockType property.

If you have checked that there is no lock related record in database,then it could be that the cache is not synchronized with database. Can you try to restart you alfresco?

Hi - A restart does not make the lock go away unfortunately.

mitpatoliya
Star Collaborator
Star Collaborator

Are you having GDrive integration? I ran into some issue during GDrive integration. Issue was because document was marked as checkout from GDrive side. So, unless I login into GDrive and explicitly mark it as editing completed I was not able to do any operations on that document.

No - Google integration is disabled.

afaust
Legendary Innovator
Legendary Innovator

As I mentioned in IRC #alfresco yesterday I typically solve this via the JavaScript Console by removing the aspects and/or properties for this as you already tried. The important thing to do to make this work is to disable behaviours in the script before you attempt to remove the aspects / properties. So you need to lookup the "policyBehaviourFilter" bean (examples for bean lookup in a gist of mine: Useful Alfresco JavaScript console scripts · GitHub) and simply call "disableBehaviour()" on it. This operation only disables behaviours in the current transaction so there should be no side effect. Since all the core services building upon the foundation services are (typically) using behaviours for providing their functionality this is a master recipe to work around any issues they may cause / be a part of.

jego
Star Contributor
Star Contributor

lajosnagybroadb
Champ in-the-making
Champ in-the-making

Just try this code to remove unwanted lock from a node:

[code]

var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();

var policyBehaviourFilter = ctxt.getBean('policyBehaviourFilter', Packages.org.alfresco.repo.policy.BehaviourFilter);

policyBehaviourFilter.disableBehaviour();

document.removeAspect("cm:checkedOut");

document.removeAspect("cm:lockable");

[/code]

Welcome to the new Hyland Connect. Get started or submit feedback.