Unable to Create File (Permission Denied)
Indications
Output similar to the following when running software manually or when started automatically:
$ cd /opt/terma/jobtrac-connector $ java -jar jobtrac-connector-1.0.0.jar 2019-05-29 06:38:40,374 main ERROR Unable to create file /var/logs/jobtrac-connector/remoteConnector.log java.io.IOException: Permission denied at java.io.UnixFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:1012) at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:628) [...]
Significance
A log directory readable and writable by the user running the software is required in order for the software to work (see Installed Defaults for location).
This error indicates one of the following:
-
The log directory exists but is not readable or writable.
-
The log directory does not exist.
Resolution
Attempt all of the following tasks:
-
If the log directory exists in the expected place but is not readable or writable, correct directory permissions.
-
If the log directory does not exist in the expected place, create it and ensure it is readable and writable by the user running the software.
Re-run the software normally, once complete.