• Problems upgrading from OpenKM 6.3.2-DEV (build: 8237)

  • Problems with installing OpenKM? No problemo, the solution is closer than you think.
Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #41670  by redink
 
Hello,

first of all my appreciations to the OpenKM team for developing a great DMS and sharing it via OpenSource - thanks for the fantastic job!

I started to use OpenKM in 2014 and upgraded from 6.3.1 to 6.3.2 using the migration guide. Everything worked as expected. Last year (I think) I downloaded build 8237 and upgraded by stopping Tomcat, deleting the old OpenKM.war and the OpenKM directory in /tomcat/webapps/ and localhost directory in /tomcat/work/Catalina and starting Tomcat again. Everything worked as expected, no issues.

Now, if I try to upgrade to a newer build (like the current 8250) by using exactly the same method as described above I can start Tomcat and can log in to OpenKM. If I am viewing documents (PDF, LibreOffice) - no issues. However, if I try to access emails I get an error (path not found) - regardless they have been imported manually our automated via IMAP email backup. The error only occurs if the email subject contains something different than numbers or English characters (i.e. '[', ']', full stops or commas). catalina.out says:
Code: Select all
2016-04-25 19:01:21,243 [http-bio-0.0.0.0-8080-exec-2] WARN  com.openkm.servlet.frontend.PropertyGroupServlet- /okm:mail/XXX/2016/4/19/87933-idw  Jenseits der Farben des Regenbogens
com.openkm.core.PathNotFoundException: /okm:mail/XXX/2016/4/19/87933-idw  Jenseits der Farben des Regenbogens
        at com.openkm.dao.NodeBaseDAO.calculateUuidFromPath(NodeBaseDAO.java:264)
        at com.openkm.dao.NodeBaseDAO.calculateUuidFromPath(NodeBaseDAO.java:232)
        at com.openkm.dao.NodeBaseDAO.getUuidFromPath(NodeBaseDAO.java:122)
        at com.openkm.module.db.DbPropertyGroupModule.getGroups(DbPropertyGroupModule.java:170)
        at com.openkm.api.OKMPropertyGroup.getGroups(OKMPropertyGroup.java:94)
        at com.openkm.servlet.frontend.PropertyGroupServlet.getGroups(PropertyGroupServlet.java:175)
        at com.openkm.servlet.frontend.PropertyGroupServlet.getAllGroups(PropertyGroupServlet.java:96)
        at sun.reflect.GeneratedMethodAccessor293.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
I do not see any errors in the logs during startup. Same error when using Firefox or Chromium (both latest versions). Reversion to the older build with the same method works fine, no issues with build 8237.

Configuration:
- Platform: OpenSUSE Leap 42.1
- Tomcat 7.0.53 (as provided with OpenKM)
- OpenJDK Runtime 1.8.0_77-b03
- MariaDB 10.0.22

I assume that something has changed building the path using Uuid with build 8250. Do I need to upgrade the database? Can someone please give me a hint how to upgrade? Any thoughts are welcome.

Thanks!
 #41700  by jllort
 
I see two consecutive white spaces as part of the name "87933-idw Jenseits der Farben des Regenbogens", see between idw and Jenseits. Interanlly we are optimizing these names with a single white space transformation between characters, that could be the problem.

Try executing this script from Administration > Script
Code: Select all
import org.hibernate.*;
import com.openkm.dao.*;
import com.openkm.dao.bean.*;

Session session = null;
Transaction tx = null;

try {
  session = HibernateUtil.getSessionFactory().openSession();
  tx = session.beginTransaction();
  Query q = session.createQuery("from NodeBase nb where nb.name like '%  %'"); // Two spaces

  for (NodeBase nBase : q.list()) {
    print(nBase.uuid + "</br>");
    nBase.name = nBase.name.replaceAll("\\s+", " ").trim();
    session.update(nBase);
  }

  HibernateUtil.commit(tx);
} catch (HibernateException e) {
  HibernateUtil.rollback(tx);
} finally {
  HibernateUtil.close(session);
}
 #41717  by redink
 
Hi,

thanks for your feedback. The script did the trick for me - problem solved.

Below a quick summary for all who are interested in what exactly was done:
Problem: Upgrade from OpenKM 6.3.2-DEV build 8237 to build 8250 as described in OP failed.
Reason: Any special characters like '[', ']', '{', '}', etc. are removed in document titles (also emails) from the path but still appear in the overview and document details. This causes sometimes a double space (' '). In build 8250 this double space is replaced with a single space (' '). Thus newly imported documents are ok, old ones are causing an error ('Path not found').
Solution: After upgrade as described in OP run the script provided in the OP reply. Ensure you log in with OpenKM admin rights.
Steps:
  • Stop Tomcat
  • Backup your database (SQL and OpenKM database)
  • Delete file OpenKM.war in /tomcat/webapps/
  • Delete directory OpenKM in /tomcat/webapps/
  • Delete directory localhost in /tomcat/work/Catalina
  • Copy new file OpenKM.war in /tomcat/webapps/
  • Start Tomcat
  • Login to OpenKM with admin rights
  • Execute script provided in reply of OP (copy to script window in Administration > Scripting and hit 'Evaluate')
  • Wait :D
  • Wait :)
  • Wait :(
  • After script is finished restart Tomcat
  • Check if double space removal was successful.
  • Done!
Thank you again for the support.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.