Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exomiser logs to /tmp/spring.log, causing clashes in shared user environments #541

Closed
oneillkza opened this issue Feb 23, 2024 · 4 comments

Comments

@oneillkza
Copy link

We've been having the following issue come up. From the exomiser log file:

Logging system failed to initialize using configuration from 'null'
java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/tmp/spring.log,true) call failed. java.io.FileNotFoundException: /tmp/spring.log (Permission denied)

It looks like spring is trying to create and write to /tmp/spring.log, but /tmp is a shared location on our servers, so this creates clashes if multiple users are running it at the same time, or if one user ran it and the file got created with RO permissions for other users.

It sounds like other people have noticed this, and just work around it:

https://www.lbgi.fr/VaRank/Documentation/README.VaRank_latest.pdf

Moreover, the Exomiser module writes in the /tmp/spring.log file that must therefore have write permissions.

Going around and creating /tmp/spring.log on every server and giving it write permissions to everyone is a very hacky solution. The right solution would be to specify this explicitly in logback-spring.xml, ie:

<property name="LOG_PATH" value="./"/>

(Probably "./" would be a reasonable default location.)

Another way to solve this would be to expose the spring logging location as a command-line parameter.

Note that this created a very Byzantine error for us, where a student developed a workflow, but when passed on to a staff member, it just would not run, because on most of our servers the student had already run exomiser, thereby creating /tmp/spring.log, and blocking anyone else from running exomiser on that server.

@julesjacobsen
Copy link
Contributor

julesjacobsen commented Feb 26, 2024

Hi @oneillkza, sorry you're struggling with this. Exomiser uses Spring boot to help with these things, so you can fix it easily. The spring boot logging configuration docs can be found here: https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.logging

I agree that the default writing out of a file to /tmp isn't ideal, so you fix this by changing the logging file to be written to a file of your choice by un-commenting the line at bottom of the application.properties file:

### logging ###
## either uncomment this to write the log to logs/exomiser.log
#logging.file.name=logs/exomiser.log

or add this line to the application.properties

### logging ###
logging.config=logback-spring.xml

and ensure the file logback-spring.xml (or whatever you want to call it) is in the same directory as the exomiser-cli.jar. The logback-spring.xml file should contain the following configuration:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/defaults.xml" />
    <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
    <include resource="org/springframework/boot/logging/logback/file-appender.xml" />
    <root level="INFO">
		<appender-ref ref="CONSOLE" />
		<appender-ref ref="FILE" />
	</root>
    <logger name="com.zaxxer.hikari" level="ERROR"/>
</configuration>

I'll change this so that the xml configuration above is the default in the next release.

@oneillkza
Copy link
Author

Thanks! I think that should allow us to get around this for now.

@oneillkza
Copy link
Author

I'd add that we run this in a containerised workflow, so for us we'd need to add a line in the Dockerfile to edit the application.properties. It would definitely be easiest if it were just an option that could be supplied at runtime.

@julesjacobsen
Copy link
Contributor

You can supply this at runtime too - just add --logging.config=logback-spring.xml to your arguments list after all of the exomiser specific commands.

Actually Spring should automatically pickup the logback-spring.xml from the filesystem first if it's in the same directory as the exomiser-cli-{version}.jar, so you shouldn't need to change any application.properties or commands.

julesjacobsen added a commit that referenced this issue Feb 27, 2024
…oot/logging/logback/defaults.xml rather than org/springframework/boot/logging/logback/base.xml in order to not create the /tmp/spring.log file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants