Closed Jose-Matsuda closed 3 months ago
The vim extension is a "web" extension (it downloads to and runs directly in the browser) while regular extensions download to the remote end. But as to why a download would work from the client machine and fail with ECONNRESET
from the remote, I am not sure...are you able to curl
the marketplace from the remote machine?
Maybe we have a bug with vspackage
. ~Just to make sure, do you see the .vsix
in the extension directory? /extensions/ms-toolsai/jupyter/2024.4.0/ms-toolsai.jupyter-2024.4.0.vsix
is where it should be I think.~
Oh wait the vspackage
path looks wrong. We have /publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
but not /api/publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
(no /api
). Makes sense to me since it is a file download and not necessarily an API request, but I need to see if this is our fault or if this path comes from VS Code, in which case we will have no choice but to move the endpoint.
Ah yup unfortunately the path is generated like this by VS Code, I will push up a fix for this in a moment.
v2.2.1 is live with the vspackage fix.
Thank you for the quick response @code-asher ! So your fix does work for the attempt to download manually does work but my initial problem does persist.
I can't install from the Extensions
Tab and when I do try to download manually, at least from the terminal I get;
(base) jovyan@novol-das-marketplace-0:~/workspace$ curl https://chart-example.ca/api/publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
curl: (35) Recv failure: Connection reset by peer
(base) jovyan@novol-das-marketplace-0:~/workspace$ wget https://chart-example.ca/api/publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
--2024-08-15 14:45:15-- https://chart-example.ca/api/publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
Resolving chart-example.ca (chart-example..ca)... .132
Connecting to chart-example.ca (chart-example.ca)|.132|:443... connected.
Unable to establish SSL connection.
Note that of course (as the network flows between the remote machine / code-marketplace are opened and all same cluster), using just the local cluster service url of wget test-code-marketplace.code-marketplace.svc.cluster.local/api/publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
does work, but of course that then uses http
and can't be used.
Again thank you for your help.
Thank you for confirming the download link is fixed!
Hmm yeah that is strange. I have never configured Istio before so unfortunately I am not really sure what could be going wrong.
Ok that's all good thank you for your help thus far! We opened the issue just in case there was some obvious misconfiguration / misunderstanding on our part
Completely understandable! I will close the issue since I think there is nothing to resolve in code-marketplace, since the http calls work.
If you happen to have a way to reproduce locally (maybe with minikube or something, I have not really messed much with Kubernetes though) I would be happy to at least try poking into it, maybe a set of fresh eyes will reveal something.
You might also want to check with the Istio folks!
Thanks @code-asher we did submit a discussion post to Istio. One final possibly whacky question is that is there a way to configure code-server to allow insecure non tls connections to code-marketplace? (since our environment is locked down)
We are able to wget
the package that we want if we use the local cluster url (somewhat similar to this where they use the cluster url of svc.cluster.local. but since that local url is just http code-server rejects getting the list of extensions with a 403.
is there a way to configure code-server to allow insecure non tls connections to code-marketplace
I believe it is controlled by content security policy meta tags (I wish it used headers, would make this easier), so you would have to edit or delete those tags, either by munging the HTML response in a proxy or by actually editing code-server source (could build code-server with the changes or edit the built files).
I think connect-src
is the main one, although you might also want img-src
and maybe some others, just depends what the browser is complaining about: https://github.com/microsoft/vscode/blob/802708dc4945cc108eb0844ed18a1da4734ef9c1/src/vs/server/node/webClientServer.ts#L403
Wait actually they are headers, I could have sworn they were meta tags at some point. You might just be able to override the Content-Security-Policy
header in that case.
Hello! We're trying to leverage code-marketplace so that users can install vetted extensions in our locked down environment but are running into an issue when testing installing extensions from the deployed code-marketplace pod. As the title states, we are oddly able to install vim but nothing else
Setup
Code-Marketplace
Deployed code-marketplace in our internal k8s cluster using the helm chart. For the ingress and TLS, our cluster uses Istio to handle that and as such is secured by mTLS, so in the deployed chart there is no
tls
block in theIngress
CRD. Additionally, to minimize variables we have added the extensions to code-marketplace using by modifying thecode-marketplace
dockerfile toCode-server leveraging code-marketplace
We have code-server v4.17.0 running in a jupyter notebook and have the environment variable of
EXTENSIONS_GALLERY
set to that https ingress host.Network Policies + PeerAuthentication
Just for testing, I have tried adding blanket allow-all ingress and egress network policies on all the related namespaces; which would be the namespaces that have the code-server deployment, the code-marketplace service, as well as our namespace that has the
Istio gateways
as that's how the request is routed when we use the Ingress. We have also addedPeerAuthentication
to the code-marketplace to allow the mTLS traffic.Behaviour
Similar to https://github.com/coder/code-marketplace/issues/39, we are able to view the extensions that exist on our code-marketplace deployment, and see the extension's URL And weirdly enough, we are able to install the vim extension, but only vim The output log gives
Whereas attempting to install anything else gives
and the "attempt to download manually" page of
https://....ca/api/publishers/ms-toolsai/vsextensions/jupyter/2024.4.0/vspackage
leads to a404 Not Found
(vim also leads to 404 if url is changed)When I exec into the
code-marketplace
pod I can see all the extensions under/extensions
.Any insight would be greatly appreciated!