Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marathon provider no longer allows for tasks from different apps within the same backend #2709

Closed
TrevinTeacutter opened this issue Jan 15, 2018 · 6 comments
Assignees
Labels
area/provider/marathon kind/bug/confirmed a confirmed bug (reproducible). priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Milestone

Comments

@TrevinTeacutter
Copy link

Do you want to request a feature or report a bug?

bug

What did you do?

We have the need for new apps to be included within the same backend so that they are added
to the wrr pool of an existing app in order for zero downtime deployments. This was originally
working with Traefik 1.4.0-rc1 and continued to work until 1.4.2. We didn't try to upgrade
until recently and we are pretty sure this template change caused the issue:

02035d4#diff-080894c4c7f765921235ddb2ceb82140

What did you expect to see?

We expect to see multiple tasks belonging to different marathon apps within the same backend.

What did you see instead?

An error due to a backend already being 'configured' within the template

Output of traefik version: (What version of Traefik are you using?)

1.4.1 (This is the last version that worked for this)
1.4.2 (First version that failed for the use-case)
1.4.6
1.5.0.rc5

What is your environment & configuration (arguments, toml, provider, platform, ...)?

################################################################
# Global configuration
################################################################

InsecureSkipVerify = true
defaultEntryPoints = ["http","https"]
email = "test@traefik.io"
storage = "traefik/acme/account"
entryPoint = "https"

[accessLog]

[entryPoints]
  [entryPoints.http]
  address = ":80"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]
      [[entryPoints.https.tls.certificates]]
      CertFile = "/etc/ssl/traefik.crt"
      KeyFile = "/etc/ssl/traefik.key"

[retry]
attempts = -1

[forwardingTimeouts]

# dialTimeout is the amount of time to wait until a connection to a backend server can be established.
#
# Optional
# Default: "30s"
#
dialTimeout = "3s"

################################################################
# Web configuration backend
################################################################

[web]
address = ":9090"

################################################################
# File configuration backend
################################################################
trace = true

################################################################
# Mesos/Marathon configuration backend
################################################################

[marathon]
endpoint = "https://leader.mesos/marathon"
watch = true
domain = "marathon.localhost"
exposedByDefault = true
marathonLBCompatibility = true

[marathon.DCOSCredentials]
UID = "svc-traefik"
PrivateKey = "/etc/ssl/service-account.key"
LoginEndpoint = "https://leader.mesos/acs/api/v1/auth/login"

[marathon.TLS]
InsecureSkipVerify = true

If applicable, please paste the log output in debug mode (--debug switch)

time="2018-01-15T18:51:11Z" level=error msg="Failed to render Marathon configuration template: Near line 66 (last key parsed 'backends'): Key 'backends.foo' has already been defined." 

@ldez
Copy link
Member

ldez commented Jan 16, 2018

Related to #2333

@emilevauge
Copy link
Member

@TrevinTeacutter Could you provide your Marathon application descriptor (json) that produces this error ?

@TrevinTeacutter
Copy link
Author

TrevinTeacutter commented Jan 16, 2018

{
  "id": "/foo-v000",
  "instances": 2,
  "cpus": 0.1,
  "mem": 32,
  "disk": 0,
  "gpus": 0,
  "constraints": [],
  "fetch": [],
  "storeUrls": [],
  "backoffSeconds": 1,
  "backoffFactor": 1.15,
  "maxLaunchDelaySeconds": 3600,
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "docker.io/nginx",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 8080,
          "protocol": "tcp",
          "name": "main",
          "labels": {}
        }
      ],
      "privileged": false,
      "parameters": [],
      "forcePullImage": true
    }
  },
  "healthChecks": [],
  "readinessChecks": [],
  "dependencies": [],
  "upgradeStrategy": {
    "minimumHealthCapacity": 1,
    "maximumOverCapacity": 1
  },
  "secrets": {},
  "unreachableStrategy": {
    "inactiveAfterSeconds": 300,
    "expungeAfterSeconds": 600
  },
  "killSelection": "YOUNGEST_FIRST",
  "requirePorts": false,
  "labels": {
    "traefik.main.backend": "test.foo",
    "traefik.main.protocol": "http",
    "traefik.protocol": "http",
    "traefik.main.portIndex": "0",
    "traefik.enable": "true",
    "traefik.main.frontend.rule": "Host:test.foo.hax"
  },
  "env": {}
}
{
  "id": "/foo-v001",
  "instances": 2,
  "cpus": 0.1,
  "mem": 32,
  "disk": 0,
  "gpus": 0,
  "constraints": [],
  "fetch": [],
  "storeUrls": [],
  "backoffSeconds": 1,
  "backoffFactor": 1.15,
  "maxLaunchDelaySeconds": 3600,
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "docker.io/nginx",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 8080,
          "protocol": "tcp",
          "name": "main",
          "labels": {}
        }
      ],
      "privileged": false,
      "parameters": [],
      "forcePullImage": true
    }
  },
  "healthChecks": [],
  "readinessChecks": [],
  "dependencies": [],
  "upgradeStrategy": {
    "minimumHealthCapacity": 1,
    "maximumOverCapacity": 1
  },
  "secrets": {},
  "unreachableStrategy": {
    "inactiveAfterSeconds": 300,
    "expungeAfterSeconds": 600
  },
  "killSelection": "YOUNGEST_FIRST",
  "requirePorts": false,
  "labels": {
    "traefik.main.backend": "test.foo",
    "traefik.main.protocol": "http",
    "traefik.protocol": "http",
    "traefik.main.portIndex": "0",
    "traefik.enable": "true",
    "traefik.main.frontend.rule": "Host:test.foo.hax"
  },
  "env": {}
}

We should expect to see this in the Web UI for the ones that aren't broken:
screen shot 2018-01-16 at 9 36 40 am
In the ones that are broken, state will never change because the error prevents any updates being made.

@MrMarkW
Copy link

MrMarkW commented Feb 5, 2018

Has any done any investigation of this issue?

@mmatur mmatur added priority/P2 need to be fixed in the future kind/bug/confirmed a confirmed bug (reproducible). and removed status/0-needs-triage labels Feb 6, 2018
@TrevinTeacutter
Copy link
Author

TrevinTeacutter commented Feb 20, 2018

We removed this line in the marathon template in our local fork of 1.5.2 Traefik and this reverted the behavior to that like 1.4.1 but to ensure the issue this was added for is fixed as well there would probably need to be smarter logic to group all apps together by backends defined (if any).

@traefiker traefiker added this to the 1.6 milestone Apr 4, 2018
@traefiker
Copy link
Contributor

Closed by #3109.

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/provider/marathon kind/bug/confirmed a confirmed bug (reproducible). priority/P2 need to be fixed in the future status/5-frozen-due-to-age
Projects
None yet
Development

No branches or pull requests

6 participants