miso-lims / runscanner

Monitors directories on the file system containing the output from sequencing instruments (e.g. Illumina) and reports their status and metrics
https://miso-lims.github.io/runscanner/
GNU General Public License v3.0
2 stars 1 forks source link

runscanner-illumina not in PATH for tomcat8 user on Ubuntu 18.04 LTS #106

Closed peterk87 closed 4 years ago

peterk87 commented 4 years ago

Hello, I encountered an issue where none of my Illumina sequencing runs were being scanned by runscanner even though the troubleshooting scripts worked just fine as well as the runscanner-illumina tool as the tomcat8 user (sudo -u tomcat8 runscanner-illumina /path/to/run).

I got the following error message in /var/log/tomcat8/runscanner.log:

ERROR   2020-06-09 07:28:50,426 [ForkJoinPool-1-worker-1] ca.on.oicr.gsi.runscanner.scanner.Scheduler  - Failed to process run: /path/to/run
com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
 at [Source: (ProcessPipeInputStream); line: 1, column: 0]
        at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
        at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4344)
        at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4189)
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3242)
        at ca.on.oicr.gsi.runscanner.scanner.processor.DefaultIllumina.process(DefaultIllumina.java:271)
        at ca.on.oicr.gsi.runscanner.scanner.Scheduler.lambda$queueDirectory$4(Scheduler.java:379)
        at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Solution

Eventually I found that the tomcat8 user could not just run runscanner-illumina since it wasn't in the tomcat8 user's PATH env var and I needed to specify the full path to runscanner-illumina by changing: https://github.com/miso-lims/runscanner/blob/0f40eee69a6ad1fc5b173839253b66ad7ed9262f/scanner/src/main/java/ca/on/oicr/gsi/runscanner/scanner/processor/DefaultIllumina.java#L258

to

new ProcessBuilder("nice", "/usr/local/bin/runscanner-illumina", runDirectory.getAbsolutePath())

I'm sure there's a way to set the PATH env variable for the tomcat8 user, but I wasn't able to find the proper way for Apache Tomcat 8 so I had to resort to the above fix.

apmasell commented 4 years ago

How did you install Tomcat8 and what OS are you using? On Debian stretch, there's a /etc/init.d/tomcat8 that sets the PATH; it should be there in most Debian and Ubuntu releases.

peterk87 commented 4 years ago

Thanks! Adding /usr/local/bin to PATH in /etc/init.d/tomcat8 worked!

OS is Ubuntu 18.04.4 LTS (bionic)

Installed Tomcat with apt install tomcat8.

apmasell commented 4 years ago

Great. I'll add some notes to the readme and close this issue.