Rh-che: Che 7 devfile import via factory does not work

Created on 19 Jul 2019  Â·  22Comments  Â·  Source: redhat-developer/rh-che

Issue problem:

This might be a dupe of #1347, but I tried to do:

https://che.openshift.io/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-web-spring/devfile.yaml

and instead of a new workspace, I get:

Error occurred during creation a workspace from devfile located at `https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-web-spring/devfile.yaml`. 
Cause: Devfile schema validation failed. 
Error: (/apiVersion):
The object must not have a property whose name is "apiVersion".
(/metadata):
The object must not have a property whose name is "metadata".
The object must have a property whose name is "specVersion".
The object must have a property whose name is "name".

Meanwhile in my local minishift, I can do this:

http://che-che.192.168.99.112.nip.io/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-web-spring/devfile.yaml

and voom, I get a workspace:

image

So it's not the devfile that's at fault. Perhaps the https curl is failing to follow any http redirects (eg., http 302 code) or can't handle the ssl?

Similar experiment fails the same way:

devfile: http://paste.awesom.eu/raw/DN7J (pasted from https://github.com/eclipse/che-devfile-registry/blob/master/devfiles/java-web-spring/devfile.yaml as a raw / non-html paste)
factory load: https://che.openshift.io/dashboard/#/load-factory?url=http:%2F%2Fpaste.awesom.eu%2Fraw%2FDN7J

result:

Error occurred during creation a workspace from devfile located at `http://paste.awesom.eu/raw/DN7J`.
Cause: Devfile schema validation failed. 
Error: (/apiVersion):
The object must not have a property whose name is "apiVersion".
(/metadata):
The object must not have a property whose name is "metadata".
The object must have a property whose name is "specVersion".
The object must have a property whose name is "name".

So it's not https or curl.

Could it be that you've still got the old factory runtime in rh-che? I think this might have been fixed in RC2 or RC3... ?

Red Hat Che version:

version: 7.0.0-RC-1.1 (latest as of 2019-07-19 11:30 GMT-4)

  • [x] I can reproduce it on latest official image

Reproduction Steps:

see above.

Runtime:

runtime used:

  • [x] minishift (include output of minishift version)
  • [x] OpenShift.io
  • [ ] Openshift Container Platform (include output of oc version)

The minishift I'm using is v1.34.1+c2ff9cb. But I only see the factory failure on che.openshift.io.

kinbug

All 22 comments

You are likely right that it's something fixed in RC2/3; which version are you running on local minishift?

The error message is in line with that; we changed devfile specVersion -> apiVersion and name -> metadata.name.

My Che version in minishift is pretty fresh:

$âž” docker images | grep che | sort
eclipse/che-init-plugin-broker                 v0.19.0             025796f92e1a        4 weeks ago         5.78MB
eclipse/che-machine-exec                       latest              2279c8d5a39b        7 weeks ago         25.5MB
eclipse/che-remote-plugin-runner-java11        <none>              2d533d2c5bab        2 days ago          758MB
eclipse/che-remote-plugin-runner-java11        7.0.0-next          9a2e2cc6b47e        27 hours ago        758MB
eclipse/che-remote-plugin-runner-java11        7.0.0-rc-3.0        c41b21150f78        7 days ago          758MB
eclipse/che-remote-plugin-runner-java8         <none>              78834df290a0        2 days ago          584MB
eclipse/che-remote-plugin-runner-java8         7.0.0-next          0b91c2c2756f        27 hours ago        584MB
eclipse/che-server                             nightly             f895d15ed0b1        47 hours ago        362MB <<
eclipse/che-theia                              <none>              9d907efebb67        2 days ago          271MB
eclipse/che-theia                              7.0.0-next          0215fdf3d598        27 hours ago        271MB
eclipse/che-theia                              7.0.0-rc-3.0        300e1c38c28d        3 days ago          271MB
eclipse/che-theia-endpoint-runtime             <none>              49d1484fad6b        2 days ago          483MB
eclipse/che-theia-endpoint-runtime             7.0.0-next          bcc2a5d11a65        27 hours ago        483MB
eclipse/che-unified-plugin-broker              v0.19.0             605ae7d02d62        4 weeks ago         12.2MB
quay.io/nickboldt/che-devfile-registry         ubi8-2              0e7bdfd331ff        2 weeks ago         354MB
registry.centos.org/che-stacks/centos-jdk8     latest              be135adba2ff        2 weeks ago         845MB

I'm predicting fixed by https://github.com/redhat-developer/rh-che/pull/1474 rolling out to prod.

@nickboldt going to close this one since devfile schema on prod-preview (rc3) and prod (rc1.1) are different and not compatible. Could you please verify that the flow with devfile works correctly on https://che.prod-preview.openshift.io/dashboard/ ?

Regarding https://che.prod-preview.openshift.io/dashboard/, there is issue #1491

@ibuziuk I can't seem to log in...

image

... but if you open this link you can see if it loads or not:

https://che.prod-preview.openshift.io/f?url=http://paste.awesom.eu/raw/DN7J

@nickboldt You're probably logged in with your prod account. If you have a preview account as well, you could try logging in in an private browsing session.

Testing your link, however, gives me the error

This factory is using old workspace definition format which is not compatible anymore. Please follow the documentation to update the definition of the workspace and benefits from the latest capabilities.

What about https://che.prod-preview.openshift.io/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-web-spring/devfile.yaml ?

@nickboldt Same issue. I pulled the stacktrace out of the logs:

java.lang.NullPointerException: null
    at com.redhat.che.plugin.analytics.wsmaster.FactoryUrlSetterInterceptor.invoke(FactoryUrlSetterInterceptor.java:35)
    at org.eclipse.che.api.factory.server.FactoryService.resolveFactory(FactoryService.java:344)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)

I'm still optimistic that it's an rc-3 issue; I'm working on getting ready for rc-4 today.

@amisevsk hm... it is pretty weird - I would expect that the same devfiles would work correctly on both rc-3 and rc-4 (it is expected that they would not work on rc 1.1). Does it mean that there were some incompatible changes in devfile schema recently ? cc @skabashnyuk

yes. rc.1.1 and rc-4 are not compatible. because of https://github.com/eclipse/che/pull/13490 in this commit https://github.com/eclipse/che/commit/caae00e21b2fd316560a406f2e1d8ad98edf1dad provided devfile not working on rc1 but working on rc-4

@skabashnyuk sure it is expected that rc.1.1 and rc-4 are incompatible, but it looks like we having an issue with the https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-web-spring/devfile.yaml on rc3 (che.prod-preview.openshift.io)

PR with a hotfix - https://github.com/redhat-developer/rh-che/pull/1494
In general, I believe it might make sense to remove the telemetry 'che-plugin-analitics' plugin before updating prod to Che 7 GA since it only supports Che 6 workspaces - https://github.com/redhat-developer/rh-che/issues/1493

Tested against dev cluster and now the workspace created from the devfile [1] fails with quota issue

image

I believe this is a separate issue that I have already raised in the upstream in the context of https://github.com/eclipse/che/issues/13832#issuecomment-510864845

[1] https://github.com/eclipse/che-devfile-registry/tree/master/devfiles/java-web-spring

FWIW I just tested @nickboldt's devfile links on the rc-4.0-SNAPSHOT PR check, and the devfile is handled correctly but I also see the quota issue;

Error: Failed to run the workspace: "Unrecoverable event occurred: 'FailedCreate', 'Error creating: pods "workspacexeq73u1u8uhvntyq.tools-7d9688559f-xp9rf" is forbidden: [maximum cpu usage per Pod is 6, but limit is 6174m., maximum memory usage per Pod is 3Gi, but limit is 3315892224.]', 'workspacexeq73u1u8uhvntyq.tools-7d9688559f'"

I updated the https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-web-spring/devfile.yaml devfile to use 600Mi on the main container and the workspace started without issue.

Currently, the allocations are 1024Mi (main container) + 512Mi (theia) + 1500Mi (java LS) + 128Mi (machine-exec)

(To be clear, the same issue will occur with the devfile in our current registry)

@amisevsk I have created a separate issue for quota related issue in the upstream - https://github.com/eclipse/che/issues/13969

@amisevsk if you want to test a lower-footprint devfile, try https://raw.githubusercontent.com/eclipse/che/master/devfile.yaml for the "che-in, che-out" experience. :D

@nickboldt "lower-footprint" is subjective, I suppose -- the Che-in-Che devfile requests 5Gi memory for the dev-machine :)

rc-4.0-SNAPSHOT does at least create the resources (they don't start due to quota)

@nickboldt Both of those worked, even though I accidentally used rc-3.0. So, good news I guess, even though I'm confused as to what's going on here.

@amisevsk I guess it failed due to NPE on our end - https://github.com/redhat-developer/rh-che/pull/1494
Should be fixed now on prod-preview. Moving to Done pipeline - should be closed once we update prod to Che 7 GA

Was this page helpful?
0 / 5 - 0 ratings