Errors in log due to temp files when starting OpenMRS in Docker

Hi all,

I’ve noticed when I start up my distribution of OpenMRS in a Docker environment (specifically using the docker-openmrs-server image we maintain here), that I get lots of errors in the startup log like this:

ERROR - ModuleUtil.getResourceFromInnerJar(1225) |2020-09-08 12:49:43,653| Unable to get ‘sqldiff.xml’ from ‘lib/legacyui-api-1.7.0-SNAPSHOT.jar’ of ‘/openmrs/data/modules/legacyui-1.7.0-SNAPSHOT.omod’ java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createTempFile(File.java:2024) at java.io.File.createTempFile(File.java:2070) at org.openmrs.module.ModuleUtil.getResourceFromInnerJar(ModuleUtil.java:1209) at org.openmrs.module.ModuleUtil.getResourceFromApi(ModuleUtil.java:1192) at org.openmrs.module.SqlDiffFileParser.getSqlDiffs(SqlDiffFileParser.java:71) at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:703) at org.openmrs.api.context.Daemon$1.run(Daemon.java:80)

ERROR - ModuleUtil.getResourceFromInnerJar(1225) |2020-09-08 12:49:44,054| Unable to get ‘sqldiff.xml’ from ‘lib/reportingcompatibility-api-2.0.6.jar’ of ‘/openmrs/data/modules/reportingcompatibility-2.0.6.omod’ java.io.IOException: No such file or directory at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createTempFile(File.java:2024) at java.io.File.createTempFile(File.java:2070) at org.openmrs.module.ModuleUtil.getResourceFromInnerJar(ModuleUtil.java:1209) at org.openmrs.module.ModuleUtil.getResourceFromApi(ModuleUtil.java:1192) at org.openmrs.module.SqlDiffFileParser.getSqlDiffs(SqlDiffFileParser.java:71) at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:703) at org.openmrs.api.context.Daemon$1.run(Daemon.java:80)

This doesn’t seem to adversely affect things, but I’d like for it not to happen. Seems pretty likely to be some sort of temp filesystem permission issue in Docker. Before I investigate and try to fix, I figured I’d ask here to see if anyone has encountered this and if so, how they addressed it.

Thanks! Mike

1 Like

Just as a note in case anyone runs into this and googles it, the issue was that in the setup script inside the Docker container, we were deleting the /usr/local/tomcat/temp directory at startup, and this was not getting automatically created again, which was the source of this issue. Changing the Docker script to ensure this directory was present and empty fixed this issue. See: Add back in tomcat temp directory to avoid errors in filesystem at st… · PIH/docker-openmrs-server@3eac209 · GitHub