-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Plugin cache prevents vscode extension install #12757
Comments
Here's what happens in the console log:
|
Note that the correct path to that file is |
The strange this it that the install sometimes works. |
Removing the exploded vsix from |
I have been trying to get gitlens to install as well. Are you using theia git or vscode git? |
If you don't use vscode-git, gitlens will not find any repositories, ever. And no, I don't know where that folder is on Linux. |
I assume the folder can be found at |
@tsmaeder I cannot reproduce this, can you reproduce this on a "fresh" Blueprint? |
@JonasHelming you have to have gitlens installed before the error occurs. Not sure what the repro scenario is, just reporting what happened in a dog-fooding env. |
I trying to find the repro scenario. Just to make sure: You assume it was an update case, i.e. Gitlens has already been installed and you installed it again? (Which I guess it shouldn't actually even allow) |
I ran into a similar issue using Acquia's Cloud IDE (which is Theia with some additional PHP and Drupal built in extensions). @tsmaeder 's comment about needing vscode-git triggered the solution for me. For some reason, vscode-git was no longer installed. It shows with a "(built in)" label now, but still under my "installed" extensions. That makes me think the vscode git is no longer built into Theia (or at least was lost from the version of Theia in Acquia Cloud IDE). Getting the "no respository found" issue solved allowed me to reinstall gitlens. Hopefully this unblocks someone else. |
@marcdumais-work Did you change anything relevant in the built-ins configuration that could explain this? |
Hey Mark,
It's usually |
@JonasHelming I don't think so, but now my curiosity is picked. I will investigate this today, first trying to reproduce the issue. @joshuami It's a long shot, but around 1.63.0, vscode split their git extension into two, adding extension cc: @vince-fugnitto |
@marcdumais-work I think it's worth looking at the stack trace: #12757 (comment) |
@tsmaeder I think I managed to reproduce your stack trace:
|
@tsmaeder The way I did it was to go under This reproduces even the strangest part of your trace, the mysteriously missing "extensions" folder, when trying to open the extension's The way that we handle the plugins under I do not have a good theory how your folder might have gotten corrupted. Alternatively, maybe we have a code flow where we create the directory under Also, on Linux, |
Note that the directory where the plugins are uncompressed to is share among all installations of theia in the system. It might well be that an uninstall of the plugin from one instance may corrupt the uncompressed directory in /tmp when it's still used somewhere else. |
The plugins "deployment" is a bit of a mess, IMO: it confounds plugin installation, plugin deployment (uncompress to a suitable location) and discovery of plugins metadata. That makes it hard to understand and therefore prone to error. It also consumes considerable resources at startup: #9868. If we had a more static view of the installed plugins, we could cache the parsed plugin metadata in a file and only reread the metadata from the uncompressed metadata when the set of installed plugins changes, for example. The set of plugins might also be fixed in some application cases and maybe only changes through an installer. There are opportunities here! |
Maybe this one is related, as well: #12485 |
I think one relatively easy way to avoid this issue and contribute to keeping the start time shorter, would be to unzip extensions downloaded by the user, from the extension's view, that end-up in <user's home>/.theia/extensions/ on Linux, saved there in vscode unzips the extension in that same case, in folder <user's home>/.vscode/extensions/ |
Some background: I think the main reason we have this global |
I have recently noticed it's not the case on at least some Windows machines, where the temp folder is per-user, and apparently never cleaned :) update: here's the folder: |
@marcdumais-work Thank you for the analysis. Would you by any chance be able to provide a fix? Fixing the issue and potentially imporving the start-up time would be a win-win! (@planger ) |
Yes, it's per user, but it's shared among all installations of Theia-based products for that user. |
I just got into a state where gitlens shows as uninstalled and I have two versions of the folder: |
@tsmaeder Looking locally I think I see similar presence of the two types of folders under ~/theia$ ll ~/.theia/extensions/
total 244
drwxr-xr-x 2 user eusers 4096 Aug 16 15:25 ./
drwxr-xr-x 8 user eusers 4096 Aug 16 15:25 ../
-rw-r--r-- 1 user eusers 240803 Aug 16 15:25 dbaeumer.vscode-eslint-2.4.2.vsix
~/theia$ ll ~/.theia-blueprint/extensions/
total 7008
drwxr-xr-x 2 user eusers 4096 Aug 10 14:00 ./
drwxr-xr-x 8 user eusers 4096 Jun 2 11:30 ../
-rw-r--r-- 1 user eusers 240240 Jun 2 11:30 dbaeumer.vscode-eslint-2.4.0.vsix
-rw-r--r-- 1 user eusers 6922979 Aug 10 14:00 eamodio.gitlens-14.2.0.vsix |
@marcdumais-work do you think there could be a fix for this in the near future? It would be a candidate to backport to the community release. |
I will take a look. |
FYI, I've renamed the issue, because the issue is not specifically related to the gitlens extension but can happen with any extension. |
I installed Is my problem related to this issue? |
@goekce No it's unrelated. Theia isn't designed for multi-tenancy, see also this discussion. There are way more security related issues when you start to allow multiple users on a single system. |
I opened a draft PR that attempts to resolve our issues and that implements the suggestion by @marcdumais-work to unpack the extensions to As @msujew mentioned, there are likely plenty more problems we face when using Theia on multi-user systems (even if they are not working in parallel, but just use the system exclusively at a time). However, I would assume that at least this particular permission-related issue mentioned by @goekce is also resolved by this patch, as the only temporary directory used during the vscode extension download/deployment process now includes the username and, therefore, avoids the mentioned ownership conflict. |
I got into a state where I cannot install the gitlens extension. Here's what I do:
The text was updated successfully, but these errors were encountered: