Yet another case of "unable to edit openmrs-runtime.properties"

I’ve done my best read all all the previous cases of “unable to edit openmrs-runtime.properties”, but I have not found any solution. I thank you in advance if you can follow me with the next facts. (Since new user can’t post too many urls, I also had to modify them hereinafter)

My aim:

  • test and evaluate OpenMRS

Software stack:

  • Ubuntu 22.04.3 LTS (VM under kvm/libvirt) with standard software on this version of distro
  • tomcat9 9.0.58
  • openjdk-8-jre 8u392
  • mysql 8.0.36

I have tested the first installation with:

  • openmrs-2.0.5.war
  • openmrs-2.1.5.war
  • openmrs-2.3.6.war
  • openmrs-2.5.0.war
  • openmrs-2.6.1.war

I’ve been using this guide at openmrs wiki /display/docs/Installing+OpenMRS and tomcat has “SECURITY_MANAGER=false” flag set.

Also “cat /etc/passwd | grep tomcat” says that home directory is “/var/lib/tomcat”.

When opening deployment url hostname:8080/openmrs the first 4 war-packages end up with error straight after language selection (example from 2.5.0): “OpenMRS Core 2.5.0 Installation Wizard” OpenMRS cannot edit the file: /var/lib/OpenMRS/openmrs-runtime.properties You must correct this before continuing.

The last version does not get that far and ends up with 404 status code with different messages in error logs. So I focused on versions 2.0.5 until 2.5.0.

Similar errors from forum are described here:

  • openmrs talk /t/unable-to-create-openmrs-runtime-properties-file-after-redeploying-openmrs/33247
  • openmrs talk /t/install-wizard-cant-create-profile-file/28562
  • openmrs talk /t/whats-the-recommended-openmrs-application-directory/3461/6

So as per standard suggestions:

  • /usr/share/tomcat9/.OpenMRS/ is available and is owned by user and group tomcat
  • /var/lib/tomcat9/webapps/openmrs is available and is owned by user and group tomcat (also the deployment files therein)

Just for the sake of testing I’ve made (and they are owned by user and group tomcat):

  • /var/lib/OpenMRS/openmrs-runtime.properties
  • /var/lib/tomcat/.OpenMRS/openmrs-runtime.properties
  • /var/lib/tomcat/OpenMRS/openmrs-runtime.properties
  • /usr/share/tomcat7/.OpenMRS (as a symlink to /usr/share/tomcat9/.OpenMRS/)

But no changes and the error message still persists. It is also strange that /var/lib/OpenMRS is a directory where tomcat should not be allowed to write anything (maybe even to read from it).

Actually I’ve tested both with openmrs-runtime.properties ready-made and empty directories. The error is still the same.

Can anyone advise what to try next?

1 Like

Can you share your server side logs via pastebin.com

Thanks, here are the logs of clean deployment session: unable to edit openmrs-runtime.properties - Pastebin.com

Does this file exist on your file system?

Well, yes.

Can you list the file permissions for /var/lib/tomcat9/webapps/openmrs/WEB-INF/lib/lucene-analyzers-phonetic-5.5.5.jar?

As before opening deployment url I always do (and mask is already correct in .war):

chown -R tomcat:tomcat /var/lib/tomcat9/webapps/openmrs

then everything in that folder is owned by tomcat:tomcat with 664 mask (fragment of ls -l output):

-rw-rw-r-- 1 tomcat tomcat    24258 Dec 22  2021 log4j-slf4j-impl-2.16.0.jar
-rw-rw-r-- 1 tomcat tomcat  1576592 Dec 22  2021 lucene-analyzers-common-5.5.5.jar
-rw-rw-r-- 1 tomcat tomcat    26126 Dec 22  2021 lucene-analyzers-phonetic-5.5.5.jar
-rw-rw-r-- 1 tomcat tomcat   430600 Dec 22  2021 lucene-backward-codecs-5.5.5.jar
-rw-rw-r-- 1 tomcat tomcat  2370237 Dec 22  2021 lucene-core-5.5.5.jar

Can you try this? chown -R tomcat9:tomcat9 /var/lib/tomcat9

Since Ubuntu has user tomcat, I can do this:

chown -R tomcat:tomcat /var/lib/tomcat9

But no change, the error persists:

OpenMRS cannot edit the file: /var/lib/OpenMRS/openmrs-runtime.properties
You must correct this before continuing.

Just in case… also double-checked this - removed again everything under /var/lib/tomcat9/webapps/openmrs, applied correct ownership and attempted again from deployment from /opemnrs url. But still the same error.

Can you also run the chown command for /var/lib/OpenMRS?

I have already done this:

Are you able to jump onto tomorrow’s platform team call such that we go through it together?

Platform Team

When : 8:30pm IST | 6:00pm Nairobi | 5:00pm Cape Town | 3:00pm UTC |10:00am Boston | 7:00am Seattle

Where: https://om.rs/zoomplatform

1 Like

Thanks for invitation, but I cant’t attend.