Page 1 of 1

UserMailImporter.bsh Cron not working

PostPosted:Thu Dec 03, 2020 2:47 pm
by arwenvd
Hello there, fellow users,
I am facing some very strange problem with OpenKM cronjobs.

The cron i question is UserMailImporter.bsh

The problem looks like this:
When registering new mail, the cron cannot create inbox folder and sync the mails. Once the inbox folder is created, it is working properly.
When run manually, the script is able to create the inbox folder and sync.

The openkm.log throws some java exception when run automatically. The error is not present, when run manually with the yellow lighning:
Code: Select all
java.lang.NullPointerException: null
	at com.openkm.module.db.DbFolderModule.create(DbFolderModule.java:101) ~[classes/:6.3.9]
	at com.openkm.api.OKMFolder.createSimple(OKMFolder.java:68) ~[classes/:6.3.9]
	at com.openkm.api.OKMFolder.createMissingFolders(OKMFolder.java:200) ~[classes/:6.3.9]
	at com.openkm.util.MailUtils.importMessages(MailUtils.java:665) [classes/:6.3.9]
	at com.openkm.util.MailUtils.importMessages(MailUtils.java:583) [classes/:6.3.9]
	at com.openkm.core.UserMailImporter.runAs(UserMailImporter.java:89) [classes/:6.3.9]
	at com.openkm.core.UserMailImporter.run(UserMailImporter.java:60) [classes/:6.3.9]
	at sun.reflect.GeneratedMethodAccessor847.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_261]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_261]
	at bsh.Reflect.invokeMethod(Reflect.java:166) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.Reflect.invokeObjectMethod(Reflect.java:99) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.BSHPrimarySuffix.doName(BSHPrimarySuffix.java:176) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.BSHPrimarySuffix.doSuffix(BSHPrimarySuffix.java:120) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:80) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.Interpreter.eval(Interpreter.java:664) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.Interpreter.eval(Interpreter.java:758) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at bsh.Interpreter.eval(Interpreter.java:747) [beanshell2-2.1.8.jar:2.1.8 2014-02-20 03:56:17]
	at com.openkm.util.ExecutionUtils.runScript(ExecutionUtils.java:106) [classes/:6.3.9]
	at com.openkm.core.Cron$RunnerBsh.run(Cron.java:99) [classes/:6.3.9]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_261]


Any thoughts and help will be greatly appreciated!

Cheers!

Re: UserMailImporter.bsh Cron not working

PostPosted:Sun Dec 06, 2020 4:06 pm
by jllort
Should check the current email configuration looking for path what does not exists. Go to database query and check
Code: Select all
SELECT MA_ID, MA_MFOLDER FROM OKM_MAIL_ACCOUNT;