io.dropwizard.configuration.UndefinedEnvironmentVariableException: The environment variable 'TOKEN_SECRET' is not defined; could not substitute the expression '${TOKEN_SECRET}'.

  1. 0

    Issue in overriding config with env variables in dropwizard

    Stack Overflow | 2 months ago | Omkar Prabhu Gaonkar
    io.dropwizard.configuration.UndefinedEnvironmentVariableException: The environment variable 'TOKEN_SECRET' is not defined; could not substitute the expression '${TOKEN_SECRET}'.

    Root Cause Analysis

    1. io.dropwizard.configuration.UndefinedEnvironmentVariableException

      The environment variable 'TOKEN_SECRET' is not defined; could not substitute the expression '${TOKEN_SECRET}'.

      at io.dropwizard.configuration.EnvironmentVariableLookup.lookup()
    2. Dropwizard Configuration Support
      EnvironmentVariableLookup.lookup
      1. io.dropwizard.configuration.EnvironmentVariableLookup.lookup(EnvironmentVariableLookup.java:41)
      1 frame
    3. Commons Lang
      StrSubstitutor.replace
      1. org.apache.commons.lang3.text.StrSubstitutor.resolveVariable(StrSubstitutor.java:726)
      2. org.apache.commons.lang3.text.StrSubstitutor.substitute(StrSubstitutor.java:649)
      3. org.apache.commons.lang3.text.StrSubstitutor.substitute(StrSubstitutor.java:563)
      4. org.apache.commons.lang3.text.StrSubstitutor.replace(StrSubstitutor.java:305)
      4 frames
    4. Dropwizard Configuration Support
      YamlConfigurationFactory.build
      1. io.dropwizard.configuration.SubstitutingSourceProvider.open(SubstitutingSourceProvider.java:39)
      2. io.dropwizard.configuration.YamlConfigurationFactory.build(YamlConfigurationFactory.java:80)
      2 frames
    5. Dropwizard
      Application.run
      1. io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:124)
      2. io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:72)
      3. io.dropwizard.cli.Cli.run(Cli.java:75)
      4. io.dropwizard.Application.run(Application.java:79)
      4 frames