Che: Che UI is buggy after loading workspace with Devfile via factory

Created on 23 May 2019  路  10Comments  路  Source: eclipse/che

Description

I have a simple Devfile referencing two projects on Github and a Theia editor of version next.

---
specVersion: 0.0.1
name: my-plugin-env
projects:
  - name: microproj
    source:
      type: git
      location: 'https://github.com/rajivnathan/microproj.git'
  - name: nodeTemplate
    source:
      type: git
      location: 'https://github.com/microclimate-dev2ops/nodeExpressTemplate'
components:
  - alias: theia-ide
    type: cheEditor
    id: eclipse/che-theia/next

When I load a workspace with this devfile (such as via a factory), the Che dashboard becomes very buggy. I can't select the workspace that was just loaded, nor can I interact with it.

What the sidebar looks like. It's also preventing me from loading the Theia editor via the dashboard:
Screen Shot 2019-05-23 at 11 33 54 AM

What happens when I try to select a workspace:
Screen Shot 2019-05-23 at 11 34 31 AM

However, despite this, the workspace loads fine and if I access the workspace IDE directly (such as with http://che-che.10.100.41.160.nip.io/dashboard/#/ide/che/my-plugin-env_1) I can use it just fine.

Reproduction Steps

Load a workspace using my devfile I referenced above. The workspace should load successfully. Navigate back to the Che dashboard and you should see the UI bugs from the screenshots above.

OS and version:
Che latest

I've been able to reproduce on:
OKD 3.11
OpenShift 3.11
ICP 3.2.0
ICP 3.1.2
Docker Desktop

Diagnostics:
Javascript Console Logs: che_js_console_logs.txt

kinbug severitP1 teaeditors

Most helpful comment

I am almost done with the fix, but need to wait for tests to pass :(

All 10 comments

cc @ashumilova

I see this on the Browser Developer Console for the same issue:

Error: [$interpolate:interr] Can't interpolate: {{navbarRecentWorkspacesController.getLink(workspace)}}
TypeError: Cannot convert undefined or null to object
http://errors.angularjs.org/1.4.8/$interpolate/interr?p0=%7B%7BnavbarRecentWorkspacesController.getLink(workspace)%7D%7D&p1=TypeError%3A%20Cannot%20convert%20undefined%20or%20null%20to%20object
    at app-63659480c2.js:34036
    at Function.qi.interr (app-63659480c2.js:44806)
    at d.exp (app-63659480c2.js:45081)
    at pre (app-63659480c2.js:42692)
    at ie (app-63659480c2.js:42809)
    at g (app-63659480c2.js:42282)
    at s (app-63659480c2.js:41699)
    at app-63659480c2.js:41579
    at r (app-63659480c2.js:41717)
    at c (app-63659480c2.js:42330)

Looks like a recent change to this file https://github.com/eclipse/che/blob/master/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.html

@maysunfaisal Do you have the recent changes? I mean this PR - https://github.com/eclipse/che/pull/13418, whether it fixes the bug you are mentioning?
When workspace is created via factory - does it contain workspace config or workspace devfile attribute of the workspace instance?

On my side - I tried to reproduce the issue, but did not manage - it works.

@ashumilova I tried it again yesterday with the eclipse/che-server:nightly image but to no avail.

I am creating the workspace via factory like http://<che ingress domain>/f?url=<hosted devfile URL>

My devfile contains the workspace name and my devfile looks something like:

---
specVersion: 0.0.1
name: test-plugin-env
projects:
  - name: goproj
    source:
      type: git
      location: '<MY GIT REPO URL>'
components:
  - alias: theia-ide
    type: cheEditor
    id: eclipse/che-theia/next
  - alias: exec-plugin
    type: chePlugin
    id: eclipse/che-machine-exec-plugin/0.0.1
  - alias: test-plugin
    type: chePlugin
    id: <hosted URL>
  - alias: test-theia
    type: chePlugin
    id: <hosted URL>

@ashumilova I can also still reproduce with the following devfile:

---
specVersion: 0.0.1
name: my-plugin-env
projects:
  - name: microproj
    source:
      type: git
      location: 'https://github.com/rajivnathan/microproj.git'
  - name: nodeTemplate
    source:
      type: git
      location: 'https://github.com/microclimate-dev2ops/nodeExpressTemplate'
components:
  - alias: theia-ide
    type: cheEditor
    id: eclipse/che-theia/next

Hosted here: https://raw.githubusercontent.com/johnmcollier/devfiles/master/devfile_test.yaml

I'm on Docker Desktop with Kubernetes using eclipse/che-server:nightly

@ashumilova I confirm that it is reproducible on eclipse/che-server:nightly if create a workspace with POST -> /api//devfile/ and devfile shared by @johnmcollier https://github.com/eclipse/che/issues/13413#issuecomment-496990583

Screenshot_20190530_091230

The same devfile but posted to /api/workspace/devfile
Screenshot_20190530_091348

Now scope of this issue is more clear: UD handles incorrectly workspaces with WSConfigs without environment. From devfile perspective, it means: devfile does not have any component with dockerimage/kubernetes/openshift type.

Note that workspaces created with api/workspace/devfile (for time being available only on swagger) work fine.

@johnmcollier @maysunfaisal If you are blocked with this issue - you can add dummy dockerimage component until this bug is not fixed.

---
specVersion: 0.0.1
name: my-plugin-env
projects:
  - name: microproj
    source:
      type: git
      location: 'https://github.com/rajivnathan/microproj.git'
  - name: nodeTemplate
    source:
      type: git
      location: 'https://github.com/microclimate-dev2ops/nodeExpressTemplate'
components:
  - alias: theia-ide
    type: cheEditor
    id: eclipse/che-theia/next
  - type: dockerimage
    image: centos:centos7
    command: ["tail"]
    args: ["-f", "/dev/null"]
    memoryLimit: 50Mi

I am almost done with the fix, but need to wait for tests to pass :(

Thank you, guys, for detailed hints how to reproduce the issue.

@ashumilova I just got around to using the new Che image, all fixed for me. Thanks!!!

Was this page helpful?
0 / 5 - 0 ratings