avast / marathon-vault-plugin

Marathon plugin which injects Vault secrets via environment variables
MIT License
30 stars 9 forks source link

Exception when starting marathon #14

Closed maxio89 closed 5 years ago

maxio89 commented 5 years ago

I tried run this plugin with Marathon 1.6 and 1.7, but with no luck. Any idea?

[2019-06-10` 22:12:19,570] INFO  Started TaskTrackerUpdateStepsProcessorImpl with steps:
* continueOnError(notifyHealthCheckManager)
* continueOnError(notifyRateLimiter)
* continueOnError(notifyLaunchQueue)
* continueOnError(postTaskStatusEvent)
* continueOnError(scaleApp) (mesosphere.marathon.core.task.tracker.impl.InstanceTrackerUpdateStepProcessorImpl:JMX exporting thread)
[2019-06-10 22:12:19,622] ERROR Terminating due to uncaught exception in thread JMX exporting thread:1 (mesosphere.marathon.MarathonApp:JMX exporting thread)
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Error injecting constructor, com.fasterxml.jackson.core.JsonParseException: Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)
 at [Source: [B@288ca5f0; line: 12, column: 31]
  at mesosphere.marathon.core.CoreModuleImpl.<init>(CoreModuleImpl.scala:51)
  while locating mesosphere.marathon.core.CoreModuleImpl
  at mesosphere.marathon.core.CoreGuiceModule.configure(CoreGuiceModule.scala:191)
  while locating mesosphere.marathon.core.CoreModule
    for the 1st parameter of mesosphere.marathon.core.CoreGuiceModule.taskTracker(CoreGuiceModule.scala:59)
  at mesosphere.marathon.core.CoreGuiceModule.taskTracker(CoreGuiceModule.scala:59)
  while locating mesosphere.marathon.core.task.tracker.InstanceTracker
    for the 2nd parameter of mesosphere.marathon.core.task.update.impl.TaskStatusUpdateProcessorImpl.<init>(TaskStatusUpdateProcessorImpl.scala:26)
  while locating mesosphere.marathon.core.task.update.impl.TaskStatusUpdateProcessorImpl
  at mesosphere.marathon.core.CoreGuiceModule.configure(CoreGuiceModule.scala:194)
  while locating mesosphere.marathon.core.task.update.TaskStatusUpdateProcessor annotated with @com.google.inject.name.Named(value=ThrottlingTaskStatusUpdateProcessor)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)
 at [Source: [B@288ca5f0; line: 12, column: 31]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:558)
...
Caused by: akka.actor.InvalidActorNameException: actor name [instanceTracker] is not unique!
    at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer.reserve(ChildrenContainer.scala:129)
    at akka.actor.dungeon.Children.reserveChild(Children.scala:134)
    at akka.actor.dungeon.Children.reserveChild$(Children.scala:132)
    at akka.actor.ActorCell.reserveChild(ActorCell.scala:370)
    at akka.actor.dungeon.Children.makeChild(Children.scala:272)
    at akka.actor.dungeon.Children.attachChild(Children.scala:48)
    at akka.actor.dungeon.Children.attachChild$(Children.scala:47)
    at akka.actor.ActorCell.attachChild(ActorCell.scala:370)
    at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:717)
    at mesosphere.marathon.core.leadership.LeadershipModuleImpl.startWhenLeader(LeadershipModule.scala:45)
    at mesosphere.marathon.core.task.tracker.InstanceTrackerModule.instanceTrackerActorRef$lzycompute(InstanceTrackerModule.scala:41)
    at mesosphere.marathon.core.task.tracker.InstanceTrackerModule.instanceTrackerActorRef(InstanceTrackerModule.scala:40)
    at mesosphere.marathon.core.task.tracker.InstanceTrackerModule.instanceTracker$lzycompute(InstanceTrackerModule.scala:25)
    at mesosphere.marathon.core.task.tracker.InstanceTrackerModule.instanceTracker(InstanceTrackerModule.scala:24)
petr-k commented 5 years ago

Make sure your plugin configuration file is valid JSON. Note that the example from README.md contains a comment in the JSON (on the line saying "verify": "false"), which you need to get rid of:

{
  "plugins": {
    "marathon-vault-plugin": {
      "plugin": "mesosphere.marathon.plugin.task.RunSpecTaskProcessor",
      "implementation": "com.avast.marathon.plugin.vault.VaultPlugin",
      "configuration": {
        "address": "http://address_to_your_vault_instance:port",
        "token": "access_token",
        "sharedPathRoot": "secret/shared/",
        "privatePathRoot": "secret/private/",
        "ssl": {
            "verify": "false", // don't use in production
            "trustStoreFile": "/path/to/truststore/file",
            "keyStoreFile": "/path/to/keystore/file",
            "keyStorePassword": "keystore_passw0rd",
            "pemFile": "/path/to/pem/file",
            "pemUTF8": "string contents extracted from the PEM file",
            "clientPemFile": "/path/to/client/pem/file",
            "clientKeyPemFile": "/path/to/client/pem/file"
        }
      }
    }
  }
}
maxio89 commented 5 years ago

You right, thanks, but this error with: InvalidActorNameException: actor name [instanceTracker] is not unique! was confusing.