Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes "single-host" configuration fails to run new workspaces #12971

Closed
geiseri opened this issue Mar 25, 2019 · 28 comments
Closed

kubernetes "single-host" configuration fails to run new workspaces #12971

geiseri opened this issue Mar 25, 2019 · 28 comments
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@geiseri
Copy link

geiseri commented Mar 25, 2019

I am running a 3 node kubernets cluster running single-host mode with 6.19.0 and it works fine for normal projects. I updated to rc this weekend and found that trying to use the che-7 IDEs did not correctly load the workspace. I see the following error:

Error: Workspace doesn't have a server which matches with URL: http://che.geekcentral.local/?uid=978289

This is the stacktrace from the console:

che.geekcentral.local-1553541995836.log

This is the HAR of the loading the workspace:

che.geekcentral.local.zip

If you need any other logs I can try to extract/clean up the logs from the containers, but I was unsure of what ones to post. I did try the old style projects specificly the "Default Node 8 Stack" and it did work as it did in 6.19.0.

@sleshchenko sleshchenko added the kind/question Questions that haven't been identified as being feature requests or bugs. label Mar 26, 2019
@sleshchenko
Copy link
Member

The issue you faced is related to secure servers behind JWTProxy. I think it does not work with single-host mode. Are you able to use multi-host mode?

If no - then as workaround you can disable JWTProxy based secure servers for your workspace by specifying che.server.secure_exposer attribute with default value in workspace config. Note that it is potentially dangerous since Theia IDE does not support legacy default workspace auth mechanism and workspace servers may be called without any token if URL is known.

@sleshchenko sleshchenko added kind/bug Outline of a bug - must adhere to the bug report template. and removed kind/question Questions that haven't been identified as being feature requests or bugs. labels Mar 26, 2019
@geiseri
Copy link
Author

geiseri commented Mar 26, 2019

The VPN we are behind doesn't support wildcards, and only works with names or ip addresses so it wouldn't work for production but if it helps narrow down the problem I can give logs. One suggestion from our sysadmin was that if we could go behind our nginx server on the edge we could enable wildcard SSL/dns there. We tried that in our testing with 6.19 on docker, but it didn't work at all.

@geiseri
Copy link
Author

geiseri commented Mar 26, 2019

Also, we are using http, not https. Would this work if we used https instead?

@garagatyi
Copy link

Thanks for providing HAR of requests.
I found in HAR next request that when gets redirected looses path to a server https://gist.github.com/garagatyi/0fb187810cd1c0145ed93af0584d4ad8
Which is probably a bug in our JWT proxy implementation

@geiseri
Copy link
Author

geiseri commented Apr 22, 2019

Any progress on this? It sounds like we could set up multihost on our edge ingress. It is running nginx, so I am not sure if che will like being behind two reverse proxies. Do you know if that would mess stuff up? They have a wildcard cert on that domain, so I think this also has a problem with che using external SSL.

@akervern
Copy link
Contributor

I encountered the same issue with a fresh Helm installation on GKE.
I configured the chart to enable TLS (with letsencrypt), so single-host seems to be the only viable server strategy.

@slemeur
Copy link
Contributor

slemeur commented May 29, 2019

@skabashnyuk : Are you aware of this issue ?

@skabashnyuk
Copy link
Contributor

yes #12988

@slemeur
Copy link
Contributor

slemeur commented Jun 20, 2019

@skabashnyuk : Do you have a workaround for this? Are you planning to take this issue in your sprint soon?

@skabashnyuk
Copy link
Contributor

Not in the plan at this moment. Planned "After GA" stage

@slemeur
Copy link
Contributor

slemeur commented Jun 20, 2019

Is there a workaround for this?

@skabashnyuk
Copy link
Contributor

I don't know. We don't know the cause of #12988 yet.

@slemeur slemeur added this to the 7.1.0 milestone Jul 2, 2019
@slemeur slemeur added the severity/P1 Has a major impact to usage or development of the system. label Jul 2, 2019
@slemeur slemeur modified the milestones: 7.1.0, 7.0.0 Jul 16, 2019
@slemeur
Copy link
Contributor

slemeur commented Jul 16, 2019

Switching the milestone to 7.0.0 as this is a must have.

@l0rd l0rd mentioned this issue Jul 16, 2019
85 tasks
@sleshchenko sleshchenko self-assigned this Jul 18, 2019
@sleshchenko sleshchenko added the status/in-progress This issue has been taken by an engineer and is under active development. label Jul 18, 2019
@sleshchenko
Copy link
Member

There are some issues with single-host and default-host servers strategies which use path-based rules for ingresses. It's related to rewrite-target to /, and I assume that it worked somehow with GWT IDE when it was hosted on Che Master but it does not work with Theia in a sidecar.
A brief explanation of the issue with rewrite-target and path-based rules:

  1. Theia has Ingress that is configured to path rule like server3421-theia-idesmd/server-4400. So, user should use http://{HOST}/server3421-theia-idesmd/server-4400 to access Theia.
  2. When a user opens Theia server the main script tries to download like cdn-resource.js, but Ingress rewrote target and Theia thinks that it is located at /, so it tries to download script from http://{HOST}/cdn-resource.js instead of right URL http://{HOST}/server3421-theia-idesmd/server-4400/cdn-resource.js

If we disable rewrite-target then we will have another issue when a client will try to download cdn-resource.js from right http://{HOST}/server3421-theia-idesmd/server-4400/cdn-resource.js BUT Theia server is not able to handle server3421-theia-idesmd/server-4400 prefix path.

The possible solutions for single-host and default-host should be investigated.

@sleshchenko sleshchenko removed the status/in-progress This issue has been taken by an engineer and is under active development. label Jul 19, 2019
@l0rd
Copy link
Contributor

l0rd commented Jul 19, 2019

@sleshchenko the problem is only cdn-resource.js? Maybe a workaround would be to copy the static resource in the che-server container so that tomcat is able to serve it?

@l0rd
Copy link
Contributor

l0rd commented Jul 19, 2019

cc @davidfestal

@benoitf
Copy link
Contributor

benoitf commented Jul 19, 2019

it's every resources

you can ask /w/h/a/t/e/v/e/r it will redirect to /

cdn.js is listed just because it's the first resource loaded

@l0rd
Copy link
Contributor

l0rd commented Jul 19, 2019

@benoitf got it

@skabashnyuk
Copy link
Contributor

@geiseri your original bug related to Che7 workspaces or Che6. Can you clarify the scope of your request? As far as I can see single-host more for Che7(Theia based) workspace never worked before.

@bmangaraj
Copy link

bmangaraj commented Jul 23, 2019

@skabashnyuk
I am also facing the same issue while loading the workspace.
Error: Workspace doesn't have a server which matches with URL: http://ip-address/?uid=645886

I am using Che7 and below command for installation:
sudo helm upgrade --install che --namespace che -f ./values/default-host.yaml --set global.ingressDomain=abc.com ./

Though I am giving the domain name in ingressDomain, I am not sure why the ip address is coming in that url in the above error.

I am able to see the dashboard, but after workspace creation, workspace loading fails by giving the above error

Please help if anyone have resolved this issue.

@skabashnyuk
Copy link
Contributor

skabashnyuk commented Jul 23, 2019

@bmangaraj at this moment for Che 7 the only one available workaround is to use multi-host #13869 (comment)

@slemeur
Copy link
Contributor

slemeur commented Jul 23, 2019

@bmangaraj : Could you please explain the reason why you would like to deploy in single-host mode? Would the multi-host be convenient for you?

The solution for single-host might get tricky to get, so while we are looking for a solution and get this fixed, I'd recommend a deployment with multi-host mode for the time being.

@l0rd
Copy link
Contributor

l0rd commented Jul 23, 2019

@slemeur I think the main problem is that when a user enable TLS, single-host and multi-user are enabled as well. So even if a user doesn't have any particular preference, single-host is automatically enabled.

@bmangaraj
Copy link

bmangaraj commented Jul 24, 2019

@slemeur
I tried multi user with Keycloak mode using nip.io

sudo helm upgrade --install che --force --namespace che -f ./values/multi-user.yaml --set global.ingressDomain=10.9.2.65.nip.io --set cheImage=eclipse/che-server:7.0.0-RC-2.0 ./

==> v1beta1/Ingress
NAME HOSTS ADDRESS PORTS AGE
che-ingress che-che.10.9.2.65.nip.io 80 0s
keycloak-ingress keycloak-che.10.9.2.65.nip.io 80 0s

Our corporate policy blocks nip.io url,
So I had to add nip.io urls into the exception list so that my network is allowing now, then che is starting.
Also I am able to load the workspace.

But Can't I use domain name or my IP address instead of nip.io in multi user keycloak mode So that I can run the che in http:// domain name or IP_ Address?
I don't want che-che or che-keycloak to be prefixed with the domain name.
For this I tried below approach. But using IP address instead of .nip.io by setting isHostBased = false does not work

sudo helm upgrade --install che --force --namespace che -f ./values/multi-user.yaml --set global.ingressDomain=<ip_address> --set isHostBased=false --set cheImage=eclipse/che-server:7.0.0-RC-2.0 ./

==> v1beta1/Ingress
NAME HOSTS ADDRESS PORTS AGE
che-ingress che-che.<ip_address> 80 1s
keycloak-ingress keycloak-che.<ip_address> 80 1s

Error:(Che is not starting)
Caused by: java.lang.RuntimeException: Exception while retrieving OpenId configuration
from endpoint: http://keycloak-che.<ip_address>/auth/realms/che/.well-known/openid-configuration

@slemeur
Copy link
Contributor

slemeur commented Jul 24, 2019

Moving to 7.1.0 milestone, as for 7.0.0 we will prioritize to address multi-host with TLS.

@slemeur slemeur modified the milestones: 7.0.0, 7.1.0 Jul 24, 2019
@slemeur
Copy link
Contributor

slemeur commented Jul 24, 2019

Linking to: #13986

@metlos
Copy link
Contributor

metlos commented Sep 10, 2019

So the fix for this has just been merged into che server master branch. It would be great if you could take it for a spin on your side @geiseri to make sure all is working as it should. The fix should be included in the next nightly build of the che server.

Please re-open this issue or file a new one if you find any further problems.

Thanks for reporting the issue!

@metlos metlos closed this as completed Sep 10, 2019
@leader-us
Copy link

7.2.snapshort not resolved this problem yet ,I tried latest 7.2 snapshort ,also this problem
#14496

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests