• Migrating existing OKM setup to new server

  • 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.
 #52963  by lpallard
 
Hello!

I have an existing OKM setup (6.3.0) currently running on an old Centos 7 VPS which needs to migrate to a new Rocky Linux 8 VPS (replacement for Centos 8 ). The current OKM setup uses a remote DB server and has its datastore mounted locally via NFS (if its relevant at all).

The current OKM setup works flawlessly. The new server is ready to have OpenKM installed.

Following the general instructions of https://docs.openkm.com/kcenter/view/ok ... entos.html, so far I have installed Java 1.8.0 and downloaded the "OKMInstaller.jar".

This is how I was thinking of proceeding. I dont want to start from scratch but reuse my existing database and datastore!!

I was thinking to clone (using rsync) the current datastore to the new VPS, then make a backup of the SQL database (dump) just in case something goes awfully wrong... Then I would simply point to the cloned datastore and existing SQL database.... Would that work?

Another question: Do I need Apache at all? On this new VPS, only OpenKM will run. No websites or anything else other than OKM.

Looking forward to your replies!

Thanks
 #52967  by lpallard
 
Okay I proceeded by doing a full clone of the datastore, and duplicate the SQL DB. Tried to install OKM using the OKMInstaller.jar but hit a brick wall.

Ticket opened: https://github.com/openkm/document-mana ... issues/313

Meanwhile, I installed OKM manually by following the instructions of https://docs.openkm.com/kcenter/view/ok ... entos.html by more or less:

- Downloading the OpenKM.war file (6.3.11), Tomcat 8.5.34
- Unzipping them in /var/www/html/openkm
- Moving OpenKM.war to the tomcat/webapps folder
- Creating /etc/init.d/tomcat ==> The tomcat service starts & stops perfectly.
- Installing dependencies (tesseract, libreoffice, etc)
- Configuring OpenKM.cfg as such (notice the update instead of create or none):
Code: Select all
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.hbm2ddl=update
Restarted the tomcat service
Code: Select all
29-Oct-2021 12:08:47.932 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/www/html/openkm/tomcat/webapps/ROOT] has finished in [684] ms
29-Oct-2021 12:08:47.978 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-0.0.0.0-8080"]
29-Oct-2021 12:08:48.024 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-127.0.0.1-8009"]
29-Oct-2021 12:08:48.042 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 47535 ms
Configured server.xml as such:
Code: Select all
         <Resource name="jdbc/OpenKMDS" auth="Container" type="javax.sql.DataSource"
          maxActive="100" maxIdle="30" maxWait="10000" validationQuery="select 1"
          username="xxxxxxxx" password="xxxxxxxxxxxxxx" driverClassName="org.mariadb.jdbc.Driver"
          url="jdbc:mariadb://database:3306/openkmuser?useSSL=false&amp;autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"/>
-Trying to access the webUI at port 8080 ==> It works!

-I did not perform the "Configure the default extensions" section of the installation instructions thinking it may cause major problems. Is it required?

But when I try to login as ADMIN, I observe three type of major problems:

1. I am immediately presented with a popup saying:
Code: Select all
The system generated an error

Error when communicating with server (getLastMonthTopModifiedDocuments)
Error when communicating with server (getLastWeekTopDownloadedDocuments)
Error when communicating with server (getLastWeekTopModifiedDocuments)
Error when communicating with server (getLastModifiedDocuments)
Error when communicating with server (getLastMonthTopDownloadedDocuments)
Error when communicating with server (callbackGetLastUploadedDocuments)
2. Every time I click on a folder, I get another popup saying:
Code: Select all
The system generated an error

OKM-002006(GetDocumentChilds): Application internal error
String index out of range: 0
3. I can see the folder structure, but there are no files anywhere. Its like OKM can use the folder structure from the database but cannot see the actual files on the hard drive.

4. If I login as a normal user, its even worst, I get the error of no. 1 above, and additionally, the entire folder structure is empty!

Java
Code: Select all
openjdk version "1.8.0_312"
OpenJDK Runtime Environment (build 1.8.0_312-b07)
OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)
hostnamectl
Code: Select all
   Static hostname: openkm.localdomain
         Icon name: computer-vm
           Chassis: vm
        Machine ID: xxxxxxxxxxxxxxxxxxxxxxxxx
           Boot ID: xxxxxxxxxxxxxxxxxxxxxxxxx
    Virtualization: kvm
  Operating System: Rocky Linux 8.4 (Green Obsidian)
       CPE OS Name: cpe:/o:rocky:rocky:8.4:GA
            Kernel: Linux 4.18.0-305.19.1.el8_4.x86_64
      Architecture: x86-64
This line from catalina.out struck me: the address shown and port are from a very old setup I made a while ago (around 2014) and never used it but I kept using the same DB for the existing working setup. Obviously this information is still stored in the database but I find it strange that it is still referenced because the setup that I want to migrate from is running on port 8070 (not 8055)...
Code: Select all
2021-10-29 12:48:11,803 [localhost-startStop-1] INFO  com.openkm.core.Config - RELOAD - application.url=http://192.168.0.101:8055/OpenKM/index.jsp
Same line from openkm.log
Code: Select all
2021-10-29 12:48:11,803 [localhost-startStop-1] [] INFO  com.openkm.core.Config - RELOAD - application.url=http://192.168.0.101:8055/OpenKM/index.jsp
Logs
(17.97 KiB) Downloaded 172 times
 #52973  by lpallard
 
Ok if I understand, one need to go through the entire migration chain (from my 6.3.0 release to latest 6.3.12) which is extraordinarly tedious but anyways.

I moved the entire 6.3.12 setup to a temporaty name and i stalled 6.3.0 alongside 6.3.12 (separate folders) thinking I could start the long migration process from 6.3.0, then upgrade to 6.3.1, etc...

Problem: 6.3.0 doesnt function. The mysql server (or client?) is too recent for 6.3.0 and I get
Class: org.apache.jasper.JasperException
Message: javax.servlet.ServletException: com.openkm.core.DatabaseException: Cannot open connection
Date: Mon Nov 01 18:27:38 EDT 2021
According to https://docs.openkm.com/kcenter/view/ok ... JDBCdriver, the logs show
Code: Select all
2021-11-01 18:27:38,716 [http-bio-0.0.0.0-8080-exec-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/OpenKM].[jsp]- Servlet.service() for servlet [jsp] in context with path [/OpenKM] threw exception [org.apache.jasper.JasperException: javax.servlet.ServletException: com.openkm.core.DatabaseException: Cannot open connection] with root cause
java.lang.UnsupportedClassVersionError: com/mysql/cj/jdbc/Driver : Unsupported major.minor version 52.0
This is probably because the system versions are too recent for 6.3.0? I tried changing driverClassName to "com.mysql.cj.jdbc.Driver" and copied the mysql java connector from 6.3.12 to 6.3.0 to no avail.

Do I really need to do the migration starting all the way at 6.3.0 until I get to 6.3.12?
 #52983  by jllort
 
Large post ... It seems you are trying to move one OpenKM application to a new server. You should plan it like a backup and restore. Do not install a fresh OpenKM in the new server, better backup and restore in the new environment.

Usually:
* database dump and restore in the destination server ( create same users, database name, passwords etc... )
* copy entire tomcat folder at the same location in the new server ( check permissions, should be the same you have in your old server )
* install the same version of java you have in your old server in the destination server ( because depending your tomcat version maybe the application will not start up )
* try to run from command line ./bin/catalina.sh run

If it works then should install thirdparty software like ( if you look in Administration > configuration > will see all the thirdparty application are you using ):
* libreoffice
* imagemagick
* tesseract

Arrived at this point then must upgrade, version by version until the last OpenKM version.
 #52989  by lpallard
 
Hello jllort, thanks for the reply!

So I decided to reinstall 6.3.0 on new server, and after a few tweaks and config settings, I have an instance of 6.3.0 that works on new server!

Then I started the migration from 6.3.0 to 6.3.1, then 6.3.1 to 6.3.2 , all OK so far!!

However, I am unsure how to run the database queries required for migration of 6.3.2 to 6.3.3. From https://docs.openkm.com/kcenter/view/ok ... o-633.html it is required to run some queries on the DB.

I am using MariaDB (mysql). When I go to Administration > Database query, there is a dropdown at the bottom of the window with some choices (JDBC, Hibernate and Metadata).

Which one do I need to choose? Then, do I simply copy and paste the following block in the window and hit "Execute" or do I enter line by line?
Code: Select all
-- ADD COLUMN NDC_ENCRYPTION
ALTER TABLE OKM_NODE_DOCUMENT ADD COLUMN NDC_ENCRYPTION CHAR(1);
UPDATE OKM_NODE_DOCUMENT SET NDC_ENCRYPTION='F';
ALTER TABLE OKM_NODE_DOCUMENT MODIFY COLUMN NDC_ENCRYPTION CHAR(1) NOT NULL;
-- ADD COLUMN NDC_SIGNED
ALTER TABLE OKM_NODE_DOCUMENT ADD COLUMN NDC_SIGNED CHAR(1);
UPDATE OKM_NODE_DOCUMENT SET NDC_SIGNED='F';
ALTER TABLE OKM_NODE_DOCUMENT MODIFY COLUMN NDC_SIGNED CHAR(1) NOT NULL;
 #53004  by jllort
 
Must execute the SQL scripts from Database Query or directly from the database before stopping OpenKM and replacing the war file.

In case of choose Database Query, the steps are:
* Paste SQL Script
* Choose jdbc
* Click on execute button
 #53023  by lpallard
 
Hey there,

I just noticed a slight issue with 6.3.2 while uploading documents. Sometimes (it happened 2 times in the last few weeks), OKM says

The system has generator an error
C:\fakepath\[document name]: OKM-005013

catalina.log says:
Code: Select all
2021-11-17 19:33:47,154 [http-bio-0.0.0.0-8080-exec-8] ERROR com.openkm.servlet.frontend.FileUploadServlet- /mnt/data/openkm-datastore/datastore/a4/49/8f/24/a4498f24-7481-4dfe-bcc1-46af17663afc (No such file or directory)
java.io.FileNotFoundException: /mnt/data/openkm-datastore/datastore/a4/49/8f/24/a4498f24-7481-4dfe-bcc1-46af17663afc (No such file or directory)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
	at com.openkm.module.db.stuff.FsDataStore.save(FsDataStore.java:60)
	at com.openkm.module.db.stuff.FsDataStore.persist(FsDataStore.java:111)
	at com.openkm.dao.NodeDocumentDAO.create(NodeDocumentDAO.java:124)
	at com.openkm.module.db.base.BaseDocumentModule.create(BaseDocumentModule.java:161)
	at com.openkm.module.db.DbDocumentModule.create(DbDocumentModule.java:228)
	at com.openkm.servlet.frontend.FileUploadServlet.doPost(FileUploadServlet.java:245)
	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 com.openkm.servlet.frontend.UploadThrottleFilter.doFilter(UploadThrottleFilter.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)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Is it something to be worried about? If I try to upload the document a second time, it usually works. I confirmed that the path indicated in the Java error log (/mnt/data/openkm-datastore/datastore/a4/49/8f/24/a4498f24-7481-4dfe-bcc1-46af17663afc) doesnt exist on the disk. Why is OKM trying to access this?

I need to mention that I upload files by dragging and dropping the actual file in the "Browse" text field of the upload dialog box. Maybe this is a bug associated with this?
 #53033  by jllort
 
When uploading a document it is created in the OpenKM datastore. Does the user who's executing tomcat have enough grants to create a document in that folder? The error is clear, the path does not exist, but why is the question, because when uploading a document, the file should be saved there.

I suggest checking your repository from Administration > tools > repository checker ( to ensure data in the file system is fine )
 #53038  by lpallard
 
EDIT: I have updated this post after I found new information.

Hello Jllort,

I have logged as admin and started the repo checker with the standard options.

The check ran for over 2 hours, and got stuck at 2%. It seems the checker gets stuck at the following file:
Code: Select all
"/okm:root/Documents/Company/Policies &amp; Guides/Procedure for Survey - Appendix.pdf"
  • Notice the path contains the "&" special character but that should not be an issue because there are other files in the same path and the checker works on them.
  • Also, this file name contains a dash "-". This also should not be an issue because this is a character I often use in naming files and the checker works on other files with dashes...
I have discovered that there is a mismatch in the filename. The repo checker log is showing this file name having two spaces between the words "for" and "survey" while the file in OpenKM's desktop is showing only one space...

tail -f /var/www/html/openkm/tomcat/logs/DbRepositoryChecker_20211121.log (truncated to reduce log length)
Code: Select all
2021-11-21 10:49:12,991 INFO  Start repository check for '/okm:root
2021-11-21 10:49:13,015 INFO  Checked folder '/okm:root/BLABLABLA'
2021-11-21 10:49:13,028 INFO  Checked folder '/okm:root/BLABLABLA/BLABLABLA'
2021-11-21 10:49:13,145 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
2021-11-21 10:49:13,245 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
2021-11-21 10:49:13,322 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
[...]
2021-11-21 10:49:26,576 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
2021-11-21 10:49:26,670 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
2021-11-21 10:49:26,763 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
2021-11-21 10:49:26,841 INFO  Checked document '/okm:root/BLABLABLA/BLABLABLA/BLABLABLA/BLABLABLA/BLABLABLA/BLABLABLA.pdf'
2021-11-21 10:49:26,847 ERROR PathNotFoundException '/okm:root/Documents/Company/Policies &amp; Guides/Procedure for  Survey - Appendix.pdf'
However, if I try to rename the file in the Desktop, I see two spaces.

Additionally, if I click on the file in Desktop, I get:
Code: Select all
 OKM-009015(GetAllGroups): Path not exist
/okm:root/Documents/Company/Policies &amp; Guides/Procedure for Survey - Appendix.pdf

OKM-009015(GetGroups): Path not exist
/okm:root/Documents/Company/Policies &amp; Guides/Procedure for Survey - Appendix.pdf
Notice there is only one space between "for" and "Survey". OpenKM throws an error trying to access the file. Notice the filename has two spaces in it.

tail -f /var/www/html/openkm/tomcat/logs/catalina.log
Code: Select all
2021-11-21 14:24:19,707 [http-bio-0.0.0.0-8080-exec-5] WARN  com.openkm.servlet.frontend.PropertyGroupServlet- /okm:root/Documents/Company/Policies &amp; Guides/Procedure for  Survey - Appendix.pdf
com.openkm.core.PathNotFoundException: /okm:root/Documents/Company/Policies &amp; Guides/Procedure for  Survey - Appendix.pdf
	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:187)
	at com.openkm.api.OKMPropertyGroup.getGroups(OKMPropertyGroup.java:94)
	at com.openkm.servlet.frontend.PropertyGroupServlet.getGroups(PropertyGroupServlet.java:175)
	at sun.reflect.GeneratedMethodAccessor2562.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	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)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Somehow, there is a mismatch between the filename of that document. How can I fix this so the checker can continue???

Should the checker simply stop like that and say nothing? The users could think this is working while in reality it is stuck and will never continue....

EDIT: Improvement idea for OpenKM: Repository repair tools -> Sync the filenames between the database and the repository. Another idea: Repo checksum rebuilder. While searching on the forums I found that sometimes the file properties changes on physical drive (perhaps due to SElinux, owner, etc) or after a copy during server migration. Executing the checkum check will say "Checksum failure" while the files are intact (not corrupt). There should be a tool in the Repo utilities to "re-run" the checksum and register the new values to the database for sanity purposes.
 #53054  by jllort
 
Before applying the fix I suggest do a database backup.
The problem with two spaces should be solve with the next script:
Code: Select all
import org.hibernate.*;
import com.openkm.dao.*;
import com.openkm.dao.bean.*;

Session session = null;
Transaction tx = null;

fixNodeName(String sql) {
    try {
        session = HibernateUtil.getSessionFactory().openSession();
        tx = session.beginTransaction();
        Query q = session.createQuery(sql);

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

        HibernateUtil.commit(tx);
    } catch (HibernateException e) {
        HibernateUtil.rollback(tx);
    } finally {
        HibernateUtil.close(session);
    }
}

// Two spaces
fixNodeName("from NodeBase nb where nb.name like '%  %'");

// Tabulation
fixNodeName("from NodeBase nb where nb.name like '%\\t%'");
About & issue I suggest upload a new document with & and check how is saved in the database -> for it use a query like:
Code: Select all
select NBS_NAME FROM OKM_NODE_BASE WHERE NBS_UUID='THE UUID OF THE NODE'
An compare with previous node what have the issue.

Share two screenshots of new and old format in database and we'll try to suggest a solution for it.
 #53071  by lpallard
 
Hello!

First of all, thanks, the script you provided solved the issue with the errors associated with double spaces in filenames and allowed to perform the repository check successfully!

Thanks a lot for this, and perhaps adding the snippet to the Documentation in case of similar errors is a good idea for future users!

I am keeping a copy of it for in case it happens in the future.

Unfortunately, I am still experiencing rare instances where I get the following error when uploading or updating a document:

The system has generator an error
C:\fakepath\[document name]: OKM-005013

User starting OpenKM (tomcat ) is "openkm" and I did a chown on the datastore to make sure all the files and folders were writable by user openkm.

I will investigate if the issue persists and report back.

For now, migration from 6.3.0 to 6.3.11 is successful (outside of the above issue).

Thanks a lot!
 #53079  by jllort
 
Open a new post for the uploading issue and share the openkm.log into a text file, that will help a lot to identify what happens in the background.
 #53117  by lpallard
 
Hello Jllort,

I think my randomly occuring upload error was caused by incoherent permissions on the OpenKM datastore. I ran a "chown" on the root folder and since then, I uploaded over 50 documents (and edited many) all without errors.

I think the migration is complete and this thread can be closed!

Many thanks for your support.
 #53442  by jllort
 
Should working -> basically you need two pieces:
1- entire tomcat folder ( rsync with applicatoin stopped )
2- restore the database dump in the new server ( check user, credentials etc.. )
3- configure server.xml to connect with the new database server
4- configure openkm service

And that's all.

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.