Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Marathon 1.3.0 - can't modify configuration in UI #4340

Closed
liquid-sky opened this issue Sep 9, 2016 · 16 comments · Fixed by mesosphere/marathon-ui#777
Closed

Marathon 1.3.0 - can't modify configuration in UI #4340

liquid-sky opened this issue Sep 9, 2016 · 16 comments · Fixed by mesosphere/marathon-ui#777
Assignees

Comments

@liquid-sky
Copy link
Contributor

Getting TypeError: e is null when trying to edit App in Marathon UI. Clicking on Edit and nothing happens, except for:

screen shot 2016-09-09 at 11 39 34

URL:
http://MESOS_HOSTNAME:8080/ui/#/apps/%2Fspark-history-server/configuration?modal=edit-app--%2Fspark-history-server--2016-09-08T07%3A55%3A02.283Z

@orlandohohmeier
Copy link
Contributor

Hi @liquid-sky thanks for reporting this! I've tried to reproduce this without any luck. Could you please provide the respective app config, as it might be related to your configuration?

@liquid-sky
Copy link
Contributor Author

liquid-sky commented Sep 9, 2016

Hi @orlandohohmeier,
I've noticed that it works with some of the apps (MySQL and Postgres example containers from Persistent Volume doc page), while it doesn't work with others.

Here's the app I'm unable to edit, as exported via API (I've cleared tasks array and lastTaskFailure information):

{
  "app": {
    "id": "/spark-history-server",
    "cmd": "/usr/local/spark/bin/run-history-server.sh",
    "args": null,
    "user": null,
    "env": {
      "SPARK_DAEMON_MEMORY": "2g"
    },
    "instances": 1,
    "cpus": 1,
    "mem": 2048,
    "disk": 0,
    "gpus": 0,
    "executor": "",
    "constraints": [
      [
        "role",
        "CLUSTER",
        "driver"
      ]
    ],
    "uris": [
      "file:///root/.dockercfg"
    ],
    "fetch": [
      {
        "uri": "file:///root/.dockercfg",
        "extract": false,
        "executable": false,
        "cache": false
      }
    ],
    "storeUrls": [],
    "backoffSeconds": 1,
    "backoffFactor": 1.15,
    "maxLaunchDelaySeconds": 3600,
    "container": {
      "type": "DOCKER",
      "volumes": [],
      "docker": {
        "image": "<INSERT_DOCKER_IMAGE_NAME_HERE>",
        "network": "HOST",
        "portMappings": null,
        "privileged": false,
        "parameters": [],
        "forcePullImage": true
      }
    },
    "healthChecks": [],
    "readinessChecks": [],
    "dependencies": [],
    "upgradeStrategy": {
      "minimumHealthCapacity": 1,
      "maximumOverCapacity": 1
    },
    "labels": {},
    "acceptedResourceRoles": null,
    "ipAddress": null,
    "version": "2016-09-08T07:55:02.283Z",
    "residency": null,
    "secrets": {},
    "taskKillGracePeriodSeconds": null,
    "ports": [
      10003
    ],
    "portDefinitions": [
      {
        "port": 10003,
        "protocol": "tcp",
        "labels": {}
      }
    ],
    "requirePorts": false,
    "versionInfo": {
      "lastScalingAt": "2016-09-08T07:55:02.283Z",
      "lastConfigChangeAt": "2016-09-07T07:16:53.840Z"
    },
    "tasksStaged": 0,
    "tasksRunning": 1,
    "tasksHealthy": 0,
    "tasksUnhealthy": 0,
    "deployments": [],
  }
}

and the task I'm able to edit:

{
  "app": {
    "id": "/postgres",
    "cmd": null,
    "args": null,
    "user": null,
    "env": {
      "POSTGRES_PASSWORD": "password",
      "PGDATA": "pgdata"
    },
    "instances": 0,
    "cpus": 0.25,
    "mem": 512,
    "disk": 0,
    "gpus": 0,
    "executor": "",
    "constraints": [],
    "uris": [],
    "fetch": [],
    "storeUrls": [],
    "backoffSeconds": 1,
    "backoffFactor": 1.15,
    "maxLaunchDelaySeconds": 3600,
    "container": {
      "type": "DOCKER",
      "volumes": [
        {
          "containerPath": "pgdata",
          "mode": "RW",
          "persistent": {
            "size": 10
          }
        }
      ],
      "docker": {
        "image": "postgres:latest",
        "network": "BRIDGE",
        "portMappings": [
          {
            "containerPort": 5432,
            "hostPort": 0,
            "servicePort": 10002,
            "protocol": "tcp",
            "name": "postgres",
            "labels": {}
          }
        ],
        "privileged": false,
        "parameters": [],
        "forcePullImage": false
      }
    },
    "healthChecks": [],
    "readinessChecks": [],
    "dependencies": [],
    "upgradeStrategy": {
      "minimumHealthCapacity": 0,
      "maximumOverCapacity": 0
    },
    "labels": {},
    "acceptedResourceRoles": null,
    "ipAddress": null,
    "version": "2016-08-16T15:13:46.733Z",
    "residency": {
      "relaunchEscalationTimeoutSeconds": 10,
      "taskLostBehavior": "WAIT_FOREVER"
    },
    "secrets": {},
    "taskKillGracePeriodSeconds": null,
    "ports": [
      10002
    ],
    "portDefinitions": [
      {
        "port": 10002,
        "protocol": "tcp",
        "labels": {}
      }
    ],
    "requirePorts": false,
    "versionInfo": {
      "lastScalingAt": "2016-08-16T15:13:46.733Z",
      "lastConfigChangeAt": "2016-08-16T14:58:33.921Z"
    },
    "tasksStaged": 0,
    "tasksRunning": 0,
    "tasksHealthy": 0,
    "tasksUnhealthy": 0,
    "deployments": [],
    "tasks": []
  }
}

@liquid-sky
Copy link
Contributor Author

hi @orlandohohmeier, any luck reproducing the issue? Do you need any more information?

@orlandohohmeier
Copy link
Contributor

@liquid-sky I wasn't able to reproduce it but had a similar issue with a different config. I'm not in the office this week but I'll have another look first thing next week.

@liquid-sky
Copy link
Contributor Author

liquid-sky commented Sep 19, 2016

Just deployed 1.3.0 and the problem remains, but the error message is more verbose now:

Seems like "portMappings": null is causing this, however it's not a part of our json files and gets added by Marathon itself.

main.js:45 Uncaught (in promise) TypeError: Cannot read property 'map' of null(…)
    i @ main.js:45
    dockerPortMappings @ main.js:45
    (anonymous function) @ main.js:44
    (anonymous function) @ main.js:44
    h @ main.js:44
    populateFieldsFromAppDefinition @ main.js:44
    AppConfigEditFormComponent_getInitialState @ main.js:44
    AppConfigEditFormComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountChildren @ main.js:12
    _createContentMarkup @ main.js:12
    mountComponent @ main.js:12
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountChildren @ main.js:12
    _createContentMarkup @ main.js:12
    mountComponent @ main.js:12
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountChildren @ main.js:12
    _createContentMarkup @ main.js:12
    mountComponent @ main.js:12
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountChildren @ main.js:12
    _createContentMarkup @ main.js:12
    mountComponent @ main.js:12
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountChildren @ main.js:12
    _createContentMarkup @ main.js:12
    mountComponent @ main.js:12
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountChildren @ main.js:12
    _createContentMarkup @ main.js:12
    mountComponent @ main.js:12
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    mountComponent @ main.js:12
    ReactCompositeComponent_mountComponent @ main.js:10
    mountComponent @ main.js:10
    _updateRenderedComponent @ main.js:12
    _performComponentUpdate @ main.js:12
    updateComponent @ main.js:12
    ReactCompositeComponent_updateComponent @ main.js:10
    performUpdateIfNecessary @ main.js:12
    performUpdateIfNecessary @ main.js:10
    s @ main.js:10
    perform @ main.js:10
    perform @ main.js:10
    perform @ main.js:10
    T @ main.js:10
    ReactUpdates_flushBatchedUpdates @ main.js:10
    closeAll @ main.js:10
    perform @ main.js:10
    batchedUpdates @ main.js:13
    l @ main.js:10
    r @ main.js:10
    enqueueSetState @ main.js:10
    r.setState @ main.js:10
    onRequestAppVersion @ main.js:59
    n.emit @ main.js:17
    (anonymous function) @ main.js:25
    e._invokeCallback @ main.js:17
    e.dispatch @ main.js:17
    (anonymous function) @ main.js:24
    (anonymous function) @ main.js:18
    (anonymous function) @ main.js:18

@liquid-sky
Copy link
Contributor Author

This is a json that gets submitted to Marathon:

{
  "id": "/spark-history-server",
  "cmd": "/usr/local/spark/bin/run-history-server.sh",
  "cpus": 1,
  "mem": 1024,
  "disk": 0,
  "instances": 1,
  "constraints": [
    [
      "role",
      "CLUSTER",
      "driver"
    ]
  ],
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "<INSERT_VALID_DOCKER_IMAGE_HERE>",
      "network": "HOST",
      "privileged": false,
      "parameters": [],
      "forcePullImage": true
    }
  },
  "portDefinitions": [
    {
      "port": 10003,
      "protocol": "tcp",
      "labels": {}
    }
  ],
  "uris": [
    "file:///root/.dockercfg"
  ],
  "fetch": [
    {
      "uri": "file:///root/.dockercfg",
      "extract": false,
      "executable": false,
      "cache": false
    }
  ]
}

@christianparpart
Copy link

christianparpart commented Sep 19, 2016

we're getting this issue, too.

a simple shell test is working:

{
  "id": "/developer/trapni/shelltest1",
  "cmd": "while true; do echo $(hostname) $(date); sleep 3; done",
  "cpus": 0.01,
  "mem": 256,
  "disk": 0,
  "instances": 0,
  "portDefinitions": [
    {
      "port": 10039,
      "protocol": "tcp",
      "labels": {}
    }
  ]
}

What is NOT working is:

{
  "id": "/developer/trapni/memcached2",
  "cmd": "exec memcached -p $PORT0 -U $PORT0 -m ${MARATHON_APP_RESOURCE_MEM%.*} -c 2048",
  "args": null,
  "user": null,
  "env": {},
  "instances": 0,
  "cpus": 0.1,
  "mem": 256,
  "disk": 0,
  "gpus": 0,
  "executor": "",
  "constraints": [],
  "uris": [],
  "fetch": [],
  "storeUrls": [],
  "backoffSeconds": 1,
  "backoffFactor": 1.15,
  "maxLaunchDelaySeconds": 3600,
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "memcached",
      "network": "HOST",
      "portMappings": null,
      "privileged": false,
      "parameters": [],
      "forcePullImage": false
    }
  },
  "healthChecks": [
    {
      "protocol": "TCP",
      "portIndex": 0,
      "gracePeriodSeconds": 300,
      "intervalSeconds": 10,
      "timeoutSeconds": 8,
      "maxConsecutiveFailures": 3,
      "ignoreHttp1xx": false
    }
  ],
  "readinessChecks": [],
  "dependencies": [],
  "upgradeStrategy": {
    "minimumHealthCapacity": 1,
    "maximumOverCapacity": 1
  },
  "labels": {},
  "secrets": {},
  "taskKillGracePeriodSeconds": 10,
  "ports": [
    10059
  ],
  "portDefinitions": [
    {
      "port": 10059,
      "protocol": "tcp",
      "labels": {}
    }
  ],
  "requirePorts": false,
}

The latter was meant to be a simple docker based app I spawned for testing, some time ago.

@liquid-sky liquid-sky changed the title Marathon 1.3.0RC6 - can't modify configuration in UI Marathon 1.3.0 - can't modify configuration in UI Sep 19, 2016
@rhruiz
Copy link
Contributor

rhruiz commented Sep 19, 2016

same issue here using marathon from the debian package: 1.3.0-1.0.506.debian81

@UnclaimedPants
Copy link
Contributor

same issue here using 1.3.0

@christianparpart
Copy link

anyone tested whether it is possible to downgrade again?

@orlandohohmeier
Copy link
Contributor

orlandohohmeier commented Sep 20, 2016

I've finally found the time to investigate this, and it's happening due to an issue in one of the utils to map the app data to the form fields, which is expecting portMappings.containerPort to be defined.

I like to thank all of you for providing all the respective informations; that was really helpful in tracking down the bug.

I'll try to provide a fix later today, should be an easy fix.

orlandohohmeier pushed a commit to mesosphere/marathon-ui that referenced this issue Sep 20, 2016
Adjust the portDefinition transform util to handle undefined port
definitions; this fixes an issue wich prevented users from editing app
configurations if `portMappings.containerPort` is undefined.

Closes d2iq-archive/marathon#4340
@orlandohohmeier orlandohohmeier self-assigned this Sep 20, 2016
@blbradley
Copy link

@christianparpart Looks like this is not in v1.1.3 on Debian. I downgraded without issue in a development environment.

@christianparpart
Copy link

@orlandohohmeier Hey. Thanks for the fix you supplied. Would you mind bumping 1.3.0 to 1.3.1 (+ docker hub tag), so we can start using it?

Alternatively, is it easy to just build it ourself? Thanks a lot. ;-)

@christianparpart
Copy link

Hey guys. Thanks for releasing Marathon v1.3.1, unfortunately, the bug is still there, please re-open the bug ticket until verified to be fixed.

Thanks in advance

@rhruiz
Copy link
Contributor

rhruiz commented Oct 1, 2016

it seems that 1.3.1 was still packaged with marathon-ui 1.1.3 and not 1.1.4 that includes the fix

@orlandohohmeier
Copy link
Contributor

@christianparpart Unfortunately, Marathon UI 1.1.4 didn't make it into that release as @rhruiz pointed out. We now have merged #4533 and @aquamatthias is about to release another Marathon version including the respective fix.

@d2iq-archive d2iq-archive locked and limited conversation to collaborators Mar 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants