Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Che 7 devfile import via factory does not work #1488

Closed
3 of 4 tasks
nickboldt opened this issue Jul 19, 2019 · 22 comments
Closed
3 of 4 tasks

Che 7 devfile import via factory does not work #1488

nickboldt opened this issue Jul 19, 2019 · 22 comments
Assignees
Labels
Milestone

Comments

@nickboldt
Copy link
Member

nickboldt commented Jul 19, 2019

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)

  • I can reproduce it on latest official image

Reproduction Steps:

see above.

Runtime:

runtime used:

  • minishift (include output of minishift version)
  • 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.

@amisevsk
Copy link
Collaborator

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.

@nickboldt
Copy link
Member Author

nickboldt commented Jul 19, 2019

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

@amisevsk
Copy link
Collaborator

I'm predicting fixed by #1474 rolling out to prod.

@ibuziuk
Copy link
Member

ibuziuk commented Jul 22, 2019

@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/ ?

@ibuziuk ibuziuk self-assigned this Jul 22, 2019
@amisevsk
Copy link
Collaborator

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

@nickboldt
Copy link
Member Author

nickboldt commented Jul 22, 2019

@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

@amisevsk
Copy link
Collaborator

@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.

@amisevsk
Copy link
Collaborator

@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.

@ibuziuk
Copy link
Member

ibuziuk commented Jul 23, 2019

@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

@skabashnyuk
Copy link
Collaborator

yes. rc.1.1 and rc-4 are not compatible. because of eclipse-che/che#13490 in this commit eclipse-che/che@caae00e provided devfile not working on rc1 but working on rc-4

@ibuziuk
Copy link
Member

ibuziuk commented Jul 23, 2019

@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)

ibuziuk added a commit to ibuziuk/rh-che that referenced this issue Jul 23, 2019
…erInterceptor' to avoid failures of workspaces started from devfile

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
@ibuziuk
Copy link
Member

ibuziuk commented Jul 23, 2019

PR with a hotfix - #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 - #1493

@ibuziuk
Copy link
Member

ibuziuk commented Jul 23, 2019

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 eclipse-che/che#13832 (comment)

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

ibuziuk added a commit that referenced this issue Jul 23, 2019
…o avoid failures of workspaces started from devfile

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
@amisevsk
Copy link
Collaborator

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)

@amisevsk
Copy link
Collaborator

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

@ibuziuk
Copy link
Member

ibuziuk commented Jul 23, 2019

@amisevsk I have created a separate issue for quota related issue in the upstream - eclipse-che/che#13969

@nickboldt
Copy link
Member Author

@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

@amisevsk
Copy link
Collaborator

amisevsk commented Jul 23, 2019

@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)

@amisevsk
Copy link
Collaborator

@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.

@ibuziuk
Copy link
Member

ibuziuk commented Jul 24, 2019

@amisevsk I guess it failed due to NPE on our end - #1494
Should be fixed now on prod-preview. Moving to Done pipeline - should be closed once we update prod to Che 7 GA

@ibuziuk ibuziuk added this to the Sprint #170 (Che OSIO) milestone Jul 29, 2019
@ibuziuk ibuziuk closed this as completed Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants