eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Terminal opened by default on a machine with no terminal agent #10459

Closed mjshashank closed 5 years ago

mjshashank commented 6 years ago

Description

I have deployed Che on Kubernetes and I'm creating a workspace as defined by the config below. It has two containers (Machine names: helper-machine and dev-machine) described by the recipe which is a kubernetes pod specification. The helper-machine has ws-agent and dev-machine has terminal agent and exec agent.

While everything boots properly, on reopening the workspace from the dashboard or otherwise it appears that Che for some reason attempts to start a terminal by default on the helper-machine (maybe because it is the one with ws-agent?). But this obviously fails since helper-machine does not have terminal agent but I now have a continuous stream of error notifications in the event log with a non functional terminal tab that need to be closed manually.

che errors

che errors another

I've tried rearranging the machines in the config and changing names just in case it was alphabetical, but to no effect. My standing assumption is that the default terminal is created on the container with ws-agent installed on it. Is this true? If yes, is there a workaround or is it a bug that needs to be fixed?

Factory Config from which workspace was created.

{
  "v": "4.0",
  "name": "sample",
  "workspace": {
    "defaultEnv": "default",
    "environments": {
      "default": {
        "machines": {
          "helper-machine": {
            "attributes": {
              "memoryLimitBytes": "1073741824"
            },
            "servers": {
              "customAgent": {
                "attributes": {},
                "port": "4000",
                "protocol": "http"
              }
            },
            "volumes": {},
            "installers": [
              "org.eclipse.che.ws-agent"
            ],
            "env": {
              "CHE_MACHINE_NAME": "helper-machine"
            }
          },
          "dev-machine": {
            "attributes": {
              "memoryLimitBytes": "2147483648"
            },
            "servers": {
              "8000/tcp": {
                "attributes": {},
                "port": "8000",
                "protocol": "http"
              }
            },
            "volumes": {
              "projects": {
                "path": "/projects"
              }
            },
            "installers": [
              "org.eclipse.che.exec",
              "org.eclipse.che.terminal"
            ],
            "env": {
              "CHE_MACHINE_NAME": "dev-machine"
            }
          }
        },
        "recipe": {
          "type": "kubernetes",
          "content": "kind: List\nitems:\n-\n  apiVersion: v1\n  kind: Pod\n  metadata:\n    name: chefs\n    annotations:\n      org.eclipse.che.container.hm.machine_name: helper-machine\n      org.eclipse.che.container.main.machine_name: dev-machine\n  spec:\n    containers:\n      -\n        image: CustomHMImage:1.0.0\n        name: hm\n        ports:\n          -\n            containerPort: 8080\n            protocol: TCP\n        resources:\n          limits:\n            memory: 1024Mi\n            cpu: 1\n          requests:\n            memory: 1024Mi\n            cpu: 1\n\n      -\n        image: CustomDMImage:1.0.0\n        name: main\n        ports:\n          -\n            containerPort: 8080\n            protocol: TCP\n        resources:\n          limits:\n            memory: 2048Mi\n            cpu: 2\n          requests:\n            memory: 2048Mi\n            cpu: 2",
          "contentType": "text/x-yaml"
        }
      }
    },
    "projects": [
      {
        "links": [],
        "name": "nodejs-hello-world",
        "attributes": {
          "contribute_to_branch": [
            "master"
          ]
        },
        "type": "node-js",
        "source": {
          "location": "https://github.com/che-samples/web-nodejs-sample.git",
          "type": "git",
          "parameters": {}
        },
        "path": "/nodejs-hello-world",
        "description": "Simple NodeJS Project.",
        "problems": [],
        "mixins": [
          "pullrequest"
        ]
      }
    ],
    "name": "sample",
    "commands": [],
    "links": []
  },
  "id": "factoryv4xiwpii6gzsll4z",
  "creator": {
    "name": "admin",
    "created": 1531802837897,
    "email": "help@example.com",
    "userId": "1dc35897-5fc5-447f-8e2c-f0e39f274603"
  }
}

OS and version:

Che 6.6.0 on Kubernetes (Multi-user setup)

ghost commented 6 years ago

@mjshashank thanks for a detailed analysis. Someone from the IDE team will check.

mjshashank commented 5 years ago

@eivantsov Sorry to be bumping this issue again, but any updates on this?

emo1509 commented 5 years ago

Any update on this topic ? I have the same issue. It works at home (local network), but when I login remotely via browser , I have to same error "Failed to connect to terminal. Can not load term.js script".

vparfonov commented 5 years ago

not actual, at the moment all should works