Page 1 of 2
Could not execute JDBC batch update 6.2.5
PostPosted:Fri Aug 28, 2015 6:54 am
by omnicron
I have an issue with a folder a user uploaded that for some reason duplicated itself with all it subfolders and files around 1000+ times.
I went to delete the subfolder with all its files and I get an
"Could not execute JDBC batch" after about 2+ hours.
I can not delete the folder due to this error message.
OpenKM 6.2.5
Ubuntu 14.04.2 LTS
Mysql 5.6.19
Any ideas?
Thanks!
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Sat Aug 29, 2015 7:30 am
by jllort
This is an old bug what on latest version is yet solved ( My mistake was allowed copy or move the contents into himselft and that caused infinite loop ).
You will not solve from UI, must be done by scripting accessing database at low level when deleting nodes. First of all stop openkm to be sure the looping process is definitively stopped.
Take this script as sample
http://wiki.openkm.com/index.php/Script ... _traversal and do some modifications:
Code: Select allimport org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.openkm.api.*;
import com.openkm.bean.*;
Logger log = LoggerFactory.getLogger("com.openkm.scripting");
int MAX_DEPTH = Integer.MAX_VALUE;
void nodeTask(String path, int depth) throws Exception {
for (Folder fld : OKMFolder.getInstance().getChildren(null, path)) {
log.info("Folder: {}", level);
if (depth < MAX_DEPTH) {
nodeTask(fld.getPath(), depth + 1);
}
}
OKMFolder.getInstance().purge(null, path);
}
log.info("***** Process BEGIN *****");
nodeTask("/okm:root", 0);
log.info("***** Process END *****");
IMPORTANT CHANGE THE nodeTask("/okm:root", 0); for the node you want to start deleting. The idea is go at the end and start backwards deleting. The proces can take several hours or days before be completed ( do not stop the openkm service while be running ). The purge methods removes definitively the node without going to trash.
When you get it solved migrate to latest 6.3 version
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Tue Sep 01, 2015 9:02 pm
by KittyCathy
IMPORTANT CHANGE THE nodeTask("/okm:root", 0); for the node you want to start deleting. The idea is go at the end and start backwards deleting. The proces can take several hours or days before be completed ( do not stop the openkm service while be running ). The purge methods removes definitively the node without going to trash.
Really? Already I was afraid that something messed up
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Wed Sep 02, 2015 12:03 am
by omnicron
I am running the script now... It appears to be working!
I followed use of the one in the link,
Thanks!
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Wed Sep 02, 2015 12:53 am
by omnicron
I got this error...
Sourced file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : target exception : at Line: 10 : in file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : .getChildren ( null , path ) Target exception: java.lang.StackOverflowError
It seemed to run for awhile. Is there just too many folders?
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Wed Sep 02, 2015 5:58 am
by omnicron
Here is the script I am running.
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.openkm.api.*;
import com.openkm.bean.*;
Logger log = LoggerFactory.getLogger("com.openkm.scripting");
int MAX_DEPTH = Integer.MAX_VALUE;
void nodeTask(String path, int depth) throws Exception {
for (Folder fld : OKMFolder.getInstance().getChildren(null, path)) {
log.info("Folder: {}", fld.getPath());
if (depth < MAX_DEPTH) {
nodeTask(fld.getPath(), depth + 1);
}
}
}
log.info("***** Process BEGIN *****");
nodeTask("/okm:root/path 2 folder", 0);
log.info("***** Process END *****");
Here is the error I get a few minutes after.
Sourced file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : target exception : at Line: 12 : in file: inline evaluation of: ``import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.openkm.api . . . '' : .getChildren ( null , path ) Target exception: java.lang.StackOverflowError
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Thu Sep 03, 2015 7:57 am
by jllort
Seems you should increase the ram of the tomcat ( increase the maxpermsize at setenv.bat to 1024m )
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Fri Sep 04, 2015 7:28 am
by omnicron
Right now my settings are the following.
-Xms4096m -Xmx4096m -XX:PermSize=1024m -XX:MaxPermSize=2024m -Xss1g -Djava.awt.headless=true -Dfile.encoding=utf-8
maxperm size would not solve the issue.. I had to add -Xsss1g ( or some number) Java default is 512m which was exhausting the stack with the recursion of the directories.
I had it set to 8m and it worked for long but did not finish... now I set it to 1g and it has been running for 8 hours and is still not done... this is THOUSANDS of folders with 5 subfolders per folder...
I hope this fixes it soon.
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Fri Sep 04, 2015 7:32 am
by omnicron
On executing the script. I think I am doing this correctly...
I pasted the script into the scripting screen under the administration panel in OpenKM and pressed the evaluate button..
I can see the script running on catalina.out showing each directory traversal... it is at a few thousand right now....
About 4 hours into the running the OpenKM screen shows "An internal server error occurred. Please try again later." but I still see the logging of the script running...
I tried adding the script to start.bsh but not all the classes are loaded and it does not run properly....
Better ideas?
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Fri Sep 04, 2015 7:10 pm
by omnicron
It still does not resolve the problem.....
I really need to fix this issue... There has to a solution that works!
Any more ideas?
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Mon Sep 07, 2015 9:23 am
by omnicron
I am getting a new error message.
Code: Select all2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] WARN com.openkm.module.db.stuff.DbSimpleAccessManager - com.openkm.module.db.base.BaseFolderModule -> getUserContentInfo (BaseFolderModule.java:346)
2015-09-07 02:22:21,124 [Thread-1468] INFO com.openkm.module.db.stuff.DbSimpleAccessManager - ***************************
2015-09-07 02:22:21,124 [Thread-1468] INFO com.openkm.module.db.stuff.DbSimpleAccessManager - ***************************
THOUSANDS of times in catalina.out
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Mon Sep 07, 2015 9:18 pm
by omnicron
It has been going on for over a day now.... No help?
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Tue Sep 08, 2015 11:12 am
by jllort
Stop the application and start again. Probably will be better use systemToken rather null.
import com.openkm.module.db.stuff.DbSessionManager;
String systemToken = DbSessionManager.getInstance().getSystemToken();
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Tue Sep 08, 2015 11:57 am
by omnicron
In what way do I use the information you just provided? Do I add it to previous script or replace information in the previous script?
Thanks
Re: Could not execute JDBC batch update 6.2.5
PostPosted:Thu Sep 10, 2015 6:33 am
by jllort
Modify previous script adding these line at the beggining, then when you call methods replace null for systemToken.
for (Folder fld : OKMFolder.getInstance().getChildren(null, path)) to for (Folder fld : OKMFolder.getInstance().getChildren(systemToken, path)) and also the call of purge method.