mesosphere / marathon-autoscale

Simple Proof-of-Concept for Scaling Application running on Marathon based on Utilization
110 stars 70 forks source link

Caught exception: undefined method `[]' for nil:NilClass #2

Closed akamalov closed 7 years ago

akamalov commented 8 years ago

Deployed marathon-autoscale, as a container. Here is my JSON file:

{
  "id": "marathon-lb-internal-autoscale",
  "args":[
    "--marathon", "http://leader.mesos:8080",
    "--haproxy", "http://marathon-lb.marathon.mesos:9090",
    "--target-rps", "100",
    "--interval", "3",
    "--apps", "nginx-internal"
  ],
  "cpus": 0.1,
  "mem": 16.0,
  "instances": 1,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "mesosphere/marathon-lb-autoscale",
      "network": "BRIDGE",
      "forcePullImage": true
    }
  }
}

However, when issued docker logs command against the container, I get the following:

[2016-02-19T16:21:57] Starting autoscale controller
[2016-02-19T16:21:57] Options: #<OpenStruct marathon=#<URI::HTTP http://leader.mesos:8080>, haproxy=[#<URI::HTTP http://marathon-lb-internal2.marathon.mesos:9090>], interval=3.0, samples=10, cooldown=5, target_rps=100, apps=#<Set: {"nginx-internal"}>, threshold_percent=0.5, threshold_instances=3, intervals_past_threshold=3>
[2016-02-19T16:21:57] E: Caught exception: undefined method `[]' for nil:NilClass
[2016-02-19T16:21:57] E: ["/marathon-lb-autoscale/autoscale.rb:252:in `block in update_current_marathon_instances'", "/marathon-lb-autoscale/autoscale.rb:251:in `each'", "/marathon-lb-autoscale/autoscale.rb:251:in `update_current_marathon_instances'", "/marathon-lb-autoscale/autoscale.rb:149:in `run'", "/marathon-lb-autoscale/autoscale.rb:322:in `<main>'"]
[2016-02-19T16:22:00] E: Caught exception: undefined method `[]' for nil:NilClass
[2016-02-19T16:22:00] E: ["/marathon-lb-autoscale/autoscale.rb:252:in `block in update_current_marathon_instances'", "/marathon-lb-autoscale/autoscale.rb:251:in `each'", "/marathon-lb-autoscale/autoscale.rb:251:in `update_current_marathon_instances'", "/marathon-lb-autoscale/autoscale.rb:149:in `run'", "/marathon-lb-autoscale/autoscale.rb:322:in `<main>'"]
[2016-02-19T16:22:03] E: Caught exception: undefined method `[]' for nil:NilClass
denisbetsi commented 8 years ago

try changing this "--marathon", "http://leader.mesos:8080",

to "--marathon", "http://marathon.mesos:8080",

jgarcia-mesosphere commented 8 years ago

This issue is actually for marathon-lb-autoscale