Page 1 of 1

OKM-002001 can't delete file doesn't exist

PostPosted:Tue Jun 02, 2015 10:46 pm
by gwaitsi
Hi, it seems as a consequence of my other issue Email - http://forum.openkm.com/viewtopic.php?f=5&t=12730 i now have a dozen files in the trash and when i try to purge them i get an error
OKM-002001 can't delete - file doesn't exist

how can i clear the trash queue given the repository files don't exist please

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Fri Jun 05, 2015 8:28 am
by jllort
What's your openkm version ?

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Fri Jun 05, 2015 8:43 am
by gwaitsi
hi jllort,

this occurred under 6.3.0 but i have since upgraded to 6.3.1

there are 9 entries in the trash, that think the file is there, but is reported as not being there.
This is also true when i run the Purge All script.

Seems i just need to purge the residue MySQL entries, no?

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Sat Jun 06, 2015 10:58 am
by jllort
If you're on 6.3.1 ( integration.openkm.com ) you're on right version, error was on previous ( but you must be there to solve it ).

This is an old bug, basically document that had more than one version, when user execute delete trash, were not deleted in correct order and that caused the problem, to solve it you must:
1- go to administration and execute check repository -> /okm:trash and also versions
2- You will get a list of errors
3- Error will shown document path, for each missing file you must execute something like
Code: Select all
echo $null >> d:\repository\datastore\6e\c5\b5\ef\6ec5b5ef-b3de-4698-bd17-abf7cb8ea099
Copy check repository results to text file -> save as csv, and then open with some spreedsheet ( user for example "->" as separator between columns ), and convert each row as the command you need to execute , etc...

Note: Probably if document has 5 version, you got more than one file lost, but check repository will stop on first, that means you should execute the repository checker several times until you get it solved.

Apologies for this error, it's a really tedious one.

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Sun Jun 07, 2015 5:07 pm
by gwaitsi
perfect....thanks

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Sat Dec 17, 2016 2:18 pm
by openkm_user
jllort wrote:If you're on 6.3.1 ( integration.openkm.com ) you're on right version, error was on previous ( but you must be there to solve it ).

This is an old bug, basically document that had more than one version, when user execute delete trash, were not deleted in correct order and that caused the problem, to solve it you must:
1- go to administration and execute check repository -> /okm:trash and also versions
2- You will get a list of errors
3- Error will shown document path, for each missing file you must execute something like
Code: Select all
echo $null >> d:\repository\datastore\6e\c5\b5\ef\6ec5b5ef-b3de-4698-bd17-abf7cb8ea099
Copy check repository results to text file -> save as csv, and then open with some spreedsheet ( user for example "->" as separator between columns ), and convert each row as the command you need to execute , etc...

Note: Probably if document has 5 version, you got more than one file lost, but check repository will stop on first, that means you should execute the repository checker several times until you get it solved.

Apologies for this error, it's a really tedious one.
Can you please be a bit more specific on how to use the above code? I have 20,000 of these records which I am trying to null.

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Sun Dec 18, 2016 6:28 am
by openkm_user
No problem, figured this out, created a batch file with all 20K lines of code and ran.

Thanks!

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Sun Dec 18, 2016 11:15 am
by jllort
A batch file is a good solution for it. Take in mind must create the folders and also the empty documents. Also you might be interested in creation of small java script for doing it ( probably more complex way for solving it ).

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Mon Dec 19, 2016 6:23 pm
by openkm_user
Thank you. I did it (batch), and it worked. Will this happen if Trash's same folder is Purged 2 or more times (like from 2 browser tabs)?

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Tue Dec 20, 2016 9:10 am
by jllort
I do not understanding what you are trying to tell with "if Trash's same folder is Purged 2 or more times" ?

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Tue Dec 20, 2016 1:01 pm
by openkm_user
Supposing if I login, Purge a folder in Trash, then open same OpenKM in another tab or browser, login as same user and Purge same folder again (while the delete is still going on in first tab). Will this affect anything?

Re: OKM-002001 can't delete file doesn't exist

PostPosted:Wed Dec 21, 2016 5:01 pm
by jllort
Not a good idea, from database view is a single transaction. Probably one will success and the other fails.