Skip to content

Mantis cannot be launched except from its install dir #851

@shemnon

Description

@shemnon

Describe the bug
I tried to launch mantis from a directory other than where it was installed. It woulnd't start.

To Reproduce

$ unzip mantis-3.2.1.zip
[ ... lots of inflating text]
$ mantis-3.2.1/bin/mantis
14:37:57,952 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [./conf/logback.xml]
14:37:57,953 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
14:37:57,953 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
14:37:57,954 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/dannoferrin/besu/mantis/mantis-3.2.1/lib/mantis.mantis-3.2.1.jar!/logback.xml]
14:37:57,969 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@75d2da2d - URL [jar:file:/Users/dannoferrin/besu/mantis/mantis-3.2.1/lib/mantis.mantis-3.2.1.jar!/logback.xml] is not of type file
14:37:58,023 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
14:37:58,027 |-INFO in ch.qos.logback.core.joran.action.NewRuleAction - About to add new Joran parsing rule [*/load,io.iohk.ethereum.utils.LoadFromApplicationConfiguration].
14:37:58,055 |-ERROR in SimpleRuleStore ( rules = {[configuration][logger]=[ch.qos.logback.classic.joran.action.LoggerAction], [configuration]=[ch.qos.logback.classic.joran.action.ConfigurationAction], [configuration][contextProperty]=[ch.qos.logback.core.joran.action.ContextPropertyAction], [configuration][appender][appender-ref]=[ch.qos.logback.core.joran.action.AppenderRefAction], [*][if][else][*]=[ch.qos.logback.core.joran.action.NOPAction], [configuration][newRule]=[ch.qos.logback.core.joran.action.NewRuleAction], [configuration][contextListener]=[ch.qos.logback.classic.joran.action.LoggerContextListenerAction], [configuration][root]=[ch.qos.logback.classic.joran.action.RootLoggerAction], [configuration][appender][sift][*]=[ch.qos.logback.core.joran.action.NOPAction], [configuration][contextName]=[ch.qos.logback.classic.joran.action.ContextNameAction], [configuration][timestamp]=[ch.qos.logback.core.joran.action.TimestampAction], [configuration][evaluator]=[ch.qos.logback.classic.joran.action.EvaluatorAction], [configuration][substitutionProperty]=[ch.qos.logback.core.joran.action.PropertyAction], [*][if][then]=[ch.qos.logback.core.joran.conditional.ThenAction], [configuration][property]=[ch.qos.logback.core.joran.action.PropertyAction], [configuration][shutdownHook]=[ch.qos.logback.core.joran.action.ShutdownHookAction], [configuration][define]=[ch.qos.logback.core.joran.action.DefinePropertyAction], [configuration][conversionRule]=[ch.qos.logback.core.joran.action.ConversionRuleAction], [configuration][statusListener]=[ch.qos.logback.core.joran.action.StatusListenerAction], [*][if][else]=[ch.qos.logback.core.joran.conditional.ElseAction], [configuration][receiver]=[ch.qos.logback.classic.joran.action.ReceiverAction], [configuration][include]=[ch.qos.logback.core.joran.action.IncludeAction], [configuration][logger][level]=[ch.qos.logback.classic.joran.action.LevelAction], [configuration][logger][appender-ref]=[ch.qos.logback.core.joran.action.AppenderRefAction], [configuration][appender]=[ch.qos.logback.core.joran.action.AppenderAction], [configuration][consolePlugin]=[ch.qos.logback.classic.joran.action.ConsolePluginAction], [configuration][insertFromJNDI]=[ch.qos.logback.classic.joran.action.InsertFromJNDIAction], [configuration][jmxConfigurator]=[ch.qos.logback.classic.joran.action.JMXConfiguratorAction], [*][if][then][*]=[ch.qos.logback.core.joran.action.NOPAction], [configuration][root][level]=[ch.qos.logback.classic.joran.action.LevelAction], [*][if]=[ch.qos.logback.core.joran.conditional.IfAction], [configuration][root][appender-ref]=[ch.qos.logback.core.joran.action.AppenderRefAction], [configuration][variable]=[ch.qos.logback.core.joran.action.PropertyAction], [configuration][appender][sift]=[ch.qos.logback.classic.sift.SiftAction], [*][param]=[ch.qos.logback.core.joran.action.ParamAction]}   ) - Could not instantiate class [io.iohk.ethereum.utils.LoadFromApplicationConfiguration] ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type io.iohk.ethereum.utils.LoadFromApplicationConfiguration
	at ch.qos.logback.core.util.DynamicClassLoadingException: Failed to instantiate type io.iohk.ethereum.utils.LoadFromApplicationConfiguration
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:69)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:45)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassName(OptionHelper.java:34)
	at 	at ch.qos.logback.core.joran.spi.SimpleRuleStore.addRule(SimpleRuleStore.java:67)
	at 	at ch.qos.logback.core.joran.action.NewRuleAction.begin(NewRuleAction.java:51)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:269)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
	at 	at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:128)
	at 	at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:165)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:152)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:110)
	at 	at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
	at 	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
	at 	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at 	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at 	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at 	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at 	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at 	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
	at 	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
	at 	at io.iohk.ethereum.utils.Logger.$init$(Logger.scala:7)
	at 	at io.iohk.ethereum.App$.<init>(App.scala:10)
	at 	at io.iohk.ethereum.App$.<clinit>(App.scala)
	at 	at io.iohk.ethereum.App.main(App.scala)
Caused by: com.typesafe.config.ConfigException$IO: ./conf/app.conf: java.io.FileNotFoundException: ./conf/app.conf (No such file or directory)
	at 	at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:190)
	at 	at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
	at 	at com.typesafe.config.impl.Parseable.parse(Parseable.java:301)
	at 	at com.typesafe.config.ConfigFactory.parseFile(ConfigFactory.java:790)
	at 	at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:51)
	at 	at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:529)
	at 	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:261)
	at 	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:258)
	at 	at com.typesafe.config.impl.ConfigImpl$LoaderCache.getOrElseUpdate(ConfigImpl.java:66)
	at 	at com.typesafe.config.impl.ConfigImpl.computeCachedConfig(ConfigImpl.java:93)
	at 	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:258)
	at 	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:234)
	at 	at io.iohk.ethereum.utils.LoadFromApplicationConfiguration.<init>(LoadFromApplicationConfiguration.scala:13)
	at 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at 	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:124)
	at 	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:346)
	at 	at java.base/java.lang.Class.newInstance(Class.java:604)
	at 	at ch.qos.logback.core.util.OptionHelper.instantiateByClassNameAndParameter(OptionHelper.java:61)
	at 	... 25 common frames omitted
Caused by: java.io.FileNotFoundException: ./conf/app.conf (No such file or directory)
	at 	at java.base/java.io.FileInputStream.open0(Native Method)
	at 	at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
	at 	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154)
	at 	at com.typesafe.config.impl.Parseable$ParseableFile.reader(Parseable.java:629)
	at 	at com.typesafe.config.impl.Parseable.reader(Parseable.java:99)
	at 	at com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:233)
	at 	at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180)
	at 	... 45 common frames omitted
14:37:58,059 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@8:50 - no applicable action for [load], current ElementPath  is [[configuration][load]]
14:37:58,059 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@9:48 - no applicable action for [load], current ElementPath  is [[configuration][load]]
14:37:58,059 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@10:54 - no applicable action for [load], current ElementPath  is [[configuration][load]]
14:37:58,059 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:37:58,062 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
14:37:58,066 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:37:58,117 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
14:37:58,117 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STASH]
14:37:58,162 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [net.logstash.logback.fieldnames.LogstashFieldNames] for [fieldNames] property
14:37:58,275 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
14:37:58,278 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
14:37:58,282 |-INFO in ch.qos.logback.core.rolling.FixedWindowRollingPolicy@63eef88a - Will use zip compression
14:37:58,284 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
14:37:58,285 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: LOGSDIR_IS_UNDEFINED/LOGSFILENAME_IS_UNDEFINED.log
14:37:58,285 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [LOGSDIR_IS_UNDEFINED/LOGSFILENAME_IS_UNDEFINED.log]
14:37:58,286 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [io.prometheus.client.logback.InstrumentedAppender]
14:37:58,292 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [METRICS]
14:37:58,292 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to DEBUG
14:37:58,502 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
14:37:58,503 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
14:37:58,503 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [METRICS] to Logger[ROOT]
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [io.netty] to WARN
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [io.iohk.scalanet] to INFO
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [io.iohk.ethereum.network.rlpx.RLPxConnectionHandler] to DEBUG
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [io.iohk.ethereum.blockchain.sync.SyncController] to INFO
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [io.iohk.ethereum.network.PeerActor] to DEBUG
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.LoggerAction - Setting level of logger [io.iohk.ethereum.vm.VM] to OFF
14:37:58,503 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
14:37:58,504 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@53251a66 - Registering current configuration as safe fallback point

Exception in thread "main" java.lang.ExceptionInInitializerError
	at io.iohk.ethereum.Mantis$.main(Mantis.scala:9)
	at io.iohk.ethereum.App$.main(App.scala:25)
	at io.iohk.ethereum.App.main(App.scala)
Caused by: com.typesafe.config.ConfigException$IO: ./conf/app.conf: java.io.FileNotFoundException: ./conf/app.conf (No such file or directory)
	at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:190)
	at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:174)
	at com.typesafe.config.impl.Parseable.parse(Parseable.java:301)
	at com.typesafe.config.ConfigFactory.parseFile(ConfigFactory.java:790)
	at com.typesafe.config.DefaultConfigLoadingStrategy.parseApplicationConfig(DefaultConfigLoadingStrategy.java:51)
	at com.typesafe.config.ConfigFactory.defaultApplication(ConfigFactory.java:529)
	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:261)
	at com.typesafe.config.ConfigFactory$1.call(ConfigFactory.java:258)
	at com.typesafe.config.impl.ConfigImpl$LoaderCache.getOrElseUpdate(ConfigImpl.java:66)
	at com.typesafe.config.impl.ConfigImpl.computeCachedConfig(ConfigImpl.java:93)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:258)
	at com.typesafe.config.ConfigFactory.load(ConfigFactory.java:234)
	at io.iohk.ethereum.utils.Config$.<init>(Config.scala:22)
	at io.iohk.ethereum.utils.Config$.<clinit>(Config.scala)
	... 3 more
Caused by: java.io.FileNotFoundException: ./conf/app.conf (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:212)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:154)
	at com.typesafe.config.impl.Parseable$ParseableFile.reader(Parseable.java:629)
	at com.typesafe.config.impl.Parseable.reader(Parseable.java:99)
	at com.typesafe.config.impl.Parseable.rawParseValue(Parseable.java:233)
	at com.typesafe.config.impl.Parseable.parseValue(Parseable.java:180)
	... 16 more

Expected behavior
Mantis starts up and doesn't throw a bunch of stack traces because I'm in the wrong directory.

Desktop (please complete the following information):

  • OS: MacOS 10.15.7

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions