che: `Annotation key is too long` error when starting workspace, created from devfile

Description

When try to start workspace form some devfiles it fails to start with error message:

Failure executing: POST at: https://172.30.0.1/apis/apps/v1/namespaces/eclipse-che/deployments. Message: Deployment.apps \"workspacet0so790bumywjht3.workspace\" is invalid: spec.template.annotations: Invalid value: \"org.eclipse.che.container.eclipse-che-theia-dev-nightly.machine_name\": name part must be no more than 63 characters. Received status: Status(apiVersion=v1, code=422, details=StatusDetails(causes=[StatusCause(field=spec.template.annotations, message=Invalid value: \"org.eclipse.che.container.eclipse-che-theia-dev-nightly.machine_name\": name part must be no more than 63 characters, reason=FieldValueInvalid, additionalProperties={})], group=apps, kind=Deployment, name=workspacet0so790bumywjht3.workspace, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=Deployment.apps \"workspacet0so790bumywjht3.workspace\" is invalid: spec.template.annotations: Invalid value: \"org.eclipse.che.container.eclipse-che-theia-dev-nightly.machine_name\": name part must be no more than 63 characters, metadata=ListMeta(_continue=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=Invalid, status=Failure, additionalProperties={}).

Reproduction Steps

  1. Create workspace from the following devfile using POST /workspace/devfile API method
{
  "specVersion": "0.0.1",
  "name": "multiple-dockerimages",
  "projects": [
    {
      "name": "nodejs-mongo-app",
      "source": {
        "type": "git",
        "location": "https://github.com/ijason/NodeJS-Sample-App.git"
      }
    }
  ],
  "components": [
    {
      "name": "theia-editor",
      "type": "cheEditor",
      "id": "eclipse/che-theia/next"
    },
    {
      "name": "exec-plugin",
      "type": "chePlugin",
      "id": "eclipse/che-machine-exec-plugin/0.0.1"
    },  
    {
      "name": "mongodb",
      "type": "dockerimage",
      "image": "eclipse/che-theia-dev:nightly",
      "endpoints": [
        {
          "name": "mongo",
          "port": 27017,
          "attributes": {
            "public": "false",
            "discoverable": "true"
          }
        }
      ],
      "mountSources": true,
      "volumes": [
        {
          "name": "mongo-storage",
          "containerPath": "/data/db"
        }
      ],
      "memoryLimit": "2500Mi"
    },
    {
      "name": "nodejs-app",
      "type": "openshift",
      "reference": "node-js.yaml",
      "referenceContent": "apiVersion: v1\nkind: List\nitems:\n-\n  apiVersion: apps/v1\n  kind: Deployment\n  metadata:\n    name: web\n    labels:\n      app: nodejs\n  spec:\n    replicas: 2\n    selector:\n      name: web\n    template:\n      metadata:\n        labels:\n          app: nodejs\n        name: web-controller\n      spec:\n        containers:\n        - image: node:0.10.40\n          command: ['tail', '-f', '/dev/null']\n          args: []\n          name: web\n          ports:\n          - containerPort: 3000\n            name: http-server\n          volumeMounts:\n           - mountPath: /projects\n             name: projects\n        volumes:\n         - name: projects\n           persistentVolumeClaim:\n             claimName: projects\n- apiVersion: v1\n  kind: PersistentVolumeClaim\n  metadata:\n    name: projects\n  spec:\n    accessModes:\n     - ReadWriteOnce\n    resources:\n      requests:\n        storage: 2Gi\n-\n  apiVersion: v1\n  kind: Service\n  metadata:\n    name: web\n    labels:\n      name: web\n  spec:\n    type: LoadBalancer\n    ports:\n      - name: web\n        port: 80\n        targetPort: 3000\n        protocol: TCP\n    selector:\n      app: nodejs\n- apiVersion: v1\n  kind: Route\n  metadata:\n    name: che\n  spec:\n    to:\n      kind: Service\n      name: web\n    port:\n      targetPort: web\n"
    }
  ],
  "commands": [
    {
      "name": "run",
      "actions": [
        {
          "type": "exec",
          "component": "nodejs-app",
          "command": "cd ${CHE_PROJECTS_ROOT}/nodejs-mongo-app/EmployeeDB/ && npm install && node app.js"
        }
      ]
    }
  ]
}

Note, that this problem occurs when replace mongo with something longer, say eclipse/che-theia-dev:nightly.

  1. Try to start the workspace

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (13 by maintainers)

Most upvoted comments

Finally closed 🎉

Ok, that’s a 7.0 for me then. What we ship should at least start up out of the box.