OK spanking new Debian 10 system I loaded openmrs.war (17-May) into tomcat
log here https://pastebin.com/AQ7dWyej
On both loading the .war and running the wizard openmrs looks for:
the tomcat directory is in /var/lib:
rwxr-xr-x 5 root root 4096 May 20 18:41 tomcat9
/var/lib/OpenMRS/ does not exist
wizard UI complains it cannot create /var/lib/OpenMRS/openmrs-runtime.properties
What is the exact error message in the browser?
**Error!** A runtime properties file is needed for OpenMRS to start up consistently. OpenMRS is unable to create this file : /var/lib/OpenMRS/openmrs-runtime.properties Because of this error : Read-only file system
You must correct this before continuing.
If I drop a openmrs-properties files into the first dir - /var/lib/tomcat9/ and chown it to tomcat:tomcat, then restart tomcat, openmrs sees it.
And does OpenMRS then start successfully?
No (I think) because I have not yet configured mySQL on the new instance, but it seems to get past being upset about the profile file and no more errors are logged in catalina.out
In the browser I see:
**The following error occurred at startup:**
Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set
java.lang.Exception: Unable to get a connection to the database. Please check your openmrs runtime properties file and make sure you have the correct connection.username and connection.password set at org.openmrs.util.DatabaseUpdater.getLiquibase(DatabaseUpdater.java:398) at org.openmrs.util.DatabaseUpdater.getLiquibase(DatabaseUpdater.java:378)
Hey is this profile file OK? I gabbed it out of the wiki.
# OpenMRS Runtime Properties file
# (comments starting with a pound sign "#" are ignored)
### Database connection properties
## If set to true, allows automatic database updates
# Allow/Disallow uploading of a module via the web
# If set to true, all patients will be names will be displayed as below
### Debugging options
### Customization Options
## If the custom setting is a folder, only files contained in the customization will be overwritten
## Set the directory that OpenMRS uses for its application data
## Will be used as base dir for modules, generated reports, etc
## Defaults to C:/Docs&Settings/username/Application Data/OpenMRS for windows
## Defaults to ~/.OpenMRS for *nix
## (As of build 184.108.40.20626)
## Displays optional extra data in the Legacy UI admin screens footer,
## alongside OpenMRS version... etc.
## (As of Legacy UI module 1.7.0)
#legacyui.footer.extradata=Docker Image 45f156d
### Encryption Settings
## WARNING! Changing these values will cause all encrypted data to be invalidated!
## Randomly set upon fresh installation but not during upgrade process.
## OpenMRS built-in defaults are:
# These properties are deprecated as of 1.7.0
In the setup wizard, the first screen should be about selecting a language. The second screen is where you choose the setup type. Go for the first option which will only ask you for the mysql root password. The rest will be next, next …
I see that screen and select English, after that I get the error about not being able to create the profile.
Daniel I think the distillation is:
- openmrs wakes up on new Debian system
- when installed by tomcat looks for /var/lib/tomcat9/, dir exists but tomcat can’t write to it, noted in log, “falls back /var/lib”
- looks for profile in /var/lib/OpenMRS/, directory does not exist
all’s cool still because wizard was not yet run, run wizard, answer prompt about language
- logs show openmrs looking in same two places for profile file, tries to create it in non-existent /var/lib/OpenMRS/, tells the user it can’t proceed
Do you think you can get some time and we pair up through this at? https://www.uberconference.com/openmrs
yes, thanks Daniel, I’ll slack you to set up
@dkayiwa @carty, how did you folks resolve this , I am getting a similar error
A runtime properties file is needed for OpenMRS to start up consistently.
OpenMRS is unable to create this file : /var/lib/OpenMRS/openmrs-runtime.properties
Because of this error : Read-only file system
tomcat9 ( username tomcat)
OpenMRS reference application 2.10
mysql server 8.0.21
I cant get past the initialsetup screen due to the above message, permissions on all directories /usr/share/tomcat9 /var/lib/tomcat9 are all tomcat : tomcat
Hi Yomi! Welcome.
In my Debian install which I suspect is similar to your Ubuntu OpenMRS tried to create the profile file at /var/lib/OpenMRS/openmrs-runtime.properties which failed like yours, then in the log file I could see it trying to fall back to /home/tomcat/openmrs-runtime.properties.
I tried creating a user tomcat writable directory /var/lib/OpenMRS/ prior to running the install, that did not work. I created a tomcat writable directory in /home and that did work, profile file created is /home/tomcat/openmrs-runtime.properties.
This bug is super disruptive to linux installs, I would love to someday fix it, with the time I have available I am trying to learn enough about the implementation to be qualified to do so.
I am fairly certain the “Read-only file system” message is relevant, /var/lib is not a typical place top write “user” stuff. /home/tomcat should work but I suspect no one tries to create the directory if it’s not there.
Let me know if this works.
I had same problem as Yomi on Ubuntu install. Tried many of the steps Carty listed.
Here is what worked:
- create /var/lib/OpenMRS/ with tomcat7 owner
- create file openmrs-runtime.properties with tomcat7 owner [I copied the sample file in above post
- bounce tomcat
- reload website/openmrs page …
- installation crashed because db connection is bogus. [changed user and pswd on db and re-tried, still crashing]
- deleted openmrs-runtime.properties.
- bounced tomcat
- reload website/openmrs page.
- choose language … setup db … success
I can’t explain why the creation and subsequent deletion of openmrs-runtime.properties cleared the logjam.
BTW my new openmrs-runtime.properties file looks nothing like the example in above.
Thanks @tonys for sharing what worked for you.
So I bumped into this exact issue today on an Ubuntu 20.10 install. I tried all of the suggestions above (and quite a few others!) to no avail. In my install, the openmrs.war is in /var/lib/tomcat9/webapps run by a tomcat user (whose home directory is /opt/tomcat but that doesn’t matter for this).
What finally worked for me was that I needed to:
sudo nano /etc/systemd/system/tomcat9.service.d/logging-allow.conf
and then add:
write out that file, and then:
sudo systemctl daemon-reload
sudo systemctl restart tomcat9
That did the trick and allowed the OpenMRS installer to create:
where the new openmrs-runtime.properties file, modules directory, etc were created via the install process.
Thanks @dvreeman for sharing what worked for you!
I still can’t get past the error. I am running tomcat9
I have followed @dvreeman and had to make the file content look like below.
You can get more info from debian/README.Debian · master · Debian Java Maintainers / tomcat9 · GitLab
Tomcat9 on ubuntu 20.04 LTS, solution by @dvreeman and @aojwang worked for me.