exomiser / Exomiser

A Tool to Annotate and Prioritize Exome Variants
https://exomiser.readthedocs.io
GNU Affero General Public License v3.0
190 stars 54 forks source link

Issue encountered while running exomiser through Docker #416

Open wowwish opened 2 years ago

wowwish commented 2 years ago

Hi,

I basically create the yml file using a python parser. I am trying to run exomiser through Docker. All the data dependencies are copied into the docker container. I have set up the application.properties file for hg38 analysis and phenotype analysis. I checked the paths for the data within the docker and everything seems to be correct. But I get the following error when running through Docker:

Welcome to:


| | | _ | __| ____ _ ()__ _ | | | ' \ / \ | | \ \/ / | ' ` | / |/ _ \ '| | | | | | | / | | > < () | | | | | | __ \ _/ | || || ||_| |__//__/|| || |||/\|_|

A Tool to Annotate and Prioritize Exome Variants v13.0.1

2022-01-07 05:59:25.587 INFO 27 --- [ main] org.monarchinitiative.exomiser.cli.Main : Starting Main using Java 17.0.1 on 0ef72ce46511 with PID 27 (/usr/share/applications/exomiser-cli-13.0.1/exomiser-cli-13.0.1.jar started by root in /home/ec2-user/work/f9/6f6fa27a507e26dbc681eed8534337) 2022-01-07 05:59:25.590 INFO 27 --- [ main] org.monarchinitiative.exomiser.cli.Main : No active profile set, falling back to default profiles: default 2022-01-07 05:59:26.472 WARN 27 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exomiserCommandLineRunner' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/exomiser-cli-13.0.1.jar!/org/monarchinitiative/exomiser/cli/ExomiserCommandLineRunner.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exomiser' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/Exomiser.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'analysisFactory' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/analysis/AnalysisFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genomeAnalysisServiceProvider' defined in class path resource [org/monarchinitiative/exomiser/autoconfigure/genome/GenomeAnalysisServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider]: Factory method 'genomeAnalysisServiceProvider' threw exception; nested exception is java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. 2022-01-07 05:59:26.486 INFO 27 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-01-07 05:59:26.511 ERROR 27 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exomiserCommandLineRunner' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/exomiser-cli-13.0.1.jar!/org/monarchinitiative/exomiser/cli/ExomiserCommandLineRunner.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exomiser' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/Exomiser.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'analysisFactory' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/analysis/AnalysisFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genomeAnalysisServiceProvider' defined in class path resource [org/monarchinitiative/exomiser/autoconfigure/genome/GenomeAnalysisServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider]: Factory method 'genomeAnalysisServiceProvider' threw exception; nested exception is java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) at org.monarchinitiative.exomiser.cli.Main.main(Main.java:53) Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'exomiser' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/Exomiser.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'analysisFactory' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/analysis/AnalysisFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genomeAnalysisServiceProvider' defined in class path resource [org/monarchinitiative/exomiser/autoconfigure/genome/GenomeAnalysisServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider]: Factory method 'genomeAnalysisServiceProvider' threw exception; nested exception is java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 18 common frames omitted Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'analysisFactory' defined in URL [jar:file:/usr/share/applications/exomiser-cli-13.0.1/lib/exomiser-core-13.0.1.jar!/org/monarchinitiative/exomiser/core/analysis/AnalysisFactory.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genomeAnalysisServiceProvider' defined in class path resource [org/monarchinitiative/exomiser/autoconfigure/genome/GenomeAnalysisServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider]: Factory method 'genomeAnalysisServiceProvider' threw exception; nested exception is java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 32 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genomeAnalysisServiceProvider' defined in class path resource [org/monarchinitiative/exomiser/autoconfigure/genome/GenomeAnalysisServiceAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider]: Factory method 'genomeAnalysisServiceProvider' threw exception; nested exception is java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:887) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:791) ... 46 common frames omitted Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider]: Factory method 'genomeAnalysisServiceProvider' threw exception; nested exception is java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653) ... 60 common frames omitted Caused by: java.lang.IllegalArgumentException: genomeAnalysisServices cannot be empty. at org.monarchinitiative.exomiser.core.genome.GenomeAnalysisServiceProvider.(GenomeAnalysisServiceProvider.java:41) at org.monarchinitiative.exomiser.autoconfigure.genome.GenomeAnalysisServiceAutoConfiguration.genomeAnalysisServiceProvider(GenomeAnalysisServiceAutoConfiguration.java:51) at org.monarchinitiative.exomiser.autoconfigure.genome.GenomeAnalysisServiceAutoConfiguration$$EnhancerBySpringCGLIB$$3a80e511.CGLIB$genomeAnalysisServiceProvider$0() at org.monarchinitiative.exomiser.autoconfigure.genome.GenomeAnalysisServiceAutoConfiguration$$EnhancerBySpringCGLIB$$3a80e511$$FastClassBySpringCGLIB$$cc91f926.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) at org.monarchinitiative.exomiser.autoconfigure.genome.GenomeAnalysisServiceAutoConfiguration$$EnhancerBySpringCGLIB$$3a80e511.genomeAnalysisServiceProvider() at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ... 61 common frames omitted

wowwish commented 2 years ago

To Add on Further Details, This Error happened in Java version 17

julesjacobsen commented 2 years ago

What exactly was your Docker command and the contents of the application.properties? Exomiser runs exceptionally well with Java 17 so this is nothing to do with it. What Docker image were you using?

wowwish commented 2 years ago

I dont run it directly as a docker command, I use the docker container through nextflow. The nextflow script has two processes, the first process creates a yml file for the given vcf file, inheritance mode and hpo IDs. The next process initiates exomiser with the yml file that was created.

It would be helpful to know what exactly is breaking exomiser here. In the exomiser output log, it says unsatisfied dependency for constructor parameter for creating bean with name 'exomiserCommandLineRunner'. GenomeAnalysisServices is empty.

Is exomiser not able to locate/read the cache files for hg38 ? or is it not able to read/locate the vcf file ?

command.txt

julesjacobsen commented 2 years ago

The issue stems from the application.properties not specifying the required assembly version. You need to state this like so:

exomiser.hg19.data-version=2109
# You must have at least one of these.
exomiser.hg38.data-version=2109

I've added a new check for this which will rapidly abort the start-up throwing this error message:

Caused by: java.lang.IllegalStateException: No org.monarchinitiative.exomiser.core.genome.GenomeAnalysisService instance provided! You must specify at least one exomiser genome assembly data version in the application.properties file.
    at org.monarchinitiative.exomiser.autoconfigure.genome.GenomeAnalysisServiceAutoConfiguration.genomeAnalysisServiceProvider(GenomeAnalysisServiceAutoConfiguration.java:52)
wowwish commented 2 years ago

Sorry to bother again, I am attaching the application.properties file from my docker container along with the Dockerfile and nextflow script used to run it. The application.properties seems fine to me. application.properties.txt Dockerfile.txt run_exomiser.txt

logust79 commented 2 years ago

I've encountered a similar issue. It was because I initiated the command from another path, and it didn't find the application.properties file. Soft linking the property file to the working path solves the issue.

julesjacobsen commented 2 years ago

Yes, this would also cause the issue. There is an example command on the docker-hub README: https://hub.docker.com/r/exomiser/exomiser-cli

docker run -v "/data/exomiser-data:/exomiser-data" \
 -v "/opt/exomiser/exomiser-config/:/exomiser"  \
 -v "/opt/exomiser/results:/results"  \
 exomiser/exomiser-cli:${project.version}  \
 --analysis /exomiser/test-analysis-exome.yml  \
 --vcf /exomiser/Pfeiffer.vcf.gz  \
 --spring.config.location=/exomiser/application.properties

The --spring.config.location=/exomiser/application.properties is important.

logust79 commented 2 years ago

Yes, this would also cause the issue. There is an example command on the docker-hub README: https://hub.docker.com/r/exomiser/exomiser-cli

docker run -v "/data/exomiser-data:/exomiser-data" \
 -v "/opt/exomiser/exomiser-config/:/exomiser"  \
 -v "/opt/exomiser/results:/results"  \
 exomiser/exomiser-cli:${project.version}  \
 --analysis /exomiser/test-analysis-exome.yml  \
 --vcf /exomiser/Pfeiffer.vcf.gz  \
 --spring.config.location=/exomiser/application.properties

The --spring.config.location=/exomiser/application.properties is important.

This would be a much better solution. Thank you!

julesjacobsen commented 1 year ago

@wowwish @logust79 is this issue resolved now? We have a new release out which also includes a bash shell which seems required for Nextflow to work correctly with a docker image. See https://github.com/exomiser/Exomiser/blob/master/exomiser-cli/README.md#running-exomiser-with-docker for details.