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

Cannot update Intellij on linux: FileAlreadyExistsException #910

Open
hohwille opened this issue Jan 9, 2025 · 1 comment
Open

Cannot update Intellij on linux: FileAlreadyExistsException #910

hohwille opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working intellij IntelliJ IDE from Jet-Brains update related to updating software or the entire ide

Comments

@hohwille
Copy link
Member

hohwille commented Jan 9, 2025

$ ide intellij
Updates are available for the settings repository. If you want to pull the latest changes, call ide update.
Expected folder was not found at /home/hohwille/projects/IDEasy/settings/intellij/workspace/setup
Start: Configuring workspace main for IDE intellij
Successfully ended step 'Configuring workspace main for IDE intellij'.
Trying to download intellij-2024.3.1.1-linux-x64.tar.gz from https://download.jetbrains.com/idea/ideaIC-2024.3.1.1.tar.gz
Downloading 100% │███████████████████████████████████████████████████████████│ 886/886MiB (0:00:35 / 0:00:00) 25.3MiB/s
Checksum b183b126de2cd457475eea184874b5da2fa33ba5ae2ff874bdc8c1d534156428 is correct.
Extracting TAR file /home/hohwille/Downloads/ide/default/intellij-2024.3.1.1-linux-x64.tar.gz to /home/hohwille/projects/_ide/tmp/extract-intellij-2024.3.1.1-linux-x64.tar.gz
Extracting 100% │████████████████████████████████████████████████████████████│ 886/886MiB (0:00:19 / 0:00:00) 46.7MiB/s
Step 'ide (intellij)' failed: java.lang.RuntimeException: java.nio.file.FileAlreadyExistsException: /home/hohwille/projects/IDEasy/software/intellij
 Step 'Install intellij (*)' failed: java.lang.RuntimeException: java.nio.file.FileAlreadyExistsException: /home/hohwille/projects/IDEasy/software/intellij
2 step(s) failed out of 4 steps.
An unexpected error occurred!
We are sorry for the inconvenience.
Please check the error below, resolve it and try again.
If the error is not on your end (network connectivity, lack of permissions, etc.) please file a bug:
https://github.com/devonfw/IDEasy/issues/new?assignees=&labels=bug&projects=&template=bug.md&title=RuntimeException%3A+java.nio.file.FileAlreadyExistsException%3A+%2Fhome%2Fhohwille%2Fprojects%2FIDEasy%2Fsoftware%2Fintellij
java.lang.RuntimeException: java.nio.file.FileAlreadyExistsException: /home/hohwille/projects/IDEasy/software/intellij
        at com.devonfw.tools.ide.io.FileAccessImpl.symlink(FileAccessImpl.java:484)
        at com.devonfw.tools.ide.io.FileAccess.symlink(FileAccess.java:88)
        at com.devonfw.tools.ide.tool.LocalToolCommandlet.install(LocalToolCommandlet.java:95)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:166)
        at com.devonfw.tools.ide.tool.ToolCommandlet.runTool(ToolCommandlet.java:152)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.runTool(IdeToolCommandlet.java:55)
        at com.devonfw.tools.ide.tool.ToolCommandlet.run(ToolCommandlet.java:130)
        at com.devonfw.tools.ide.tool.ide.IdeToolCommandlet.run(IdeToolCommandlet.java:49)
        at com.devonfw.tools.ide.context.AbstractIdeContext.applyAndRun(AbstractIdeContext.java:867)
        at com.devonfw.tools.ide.context.AbstractIdeContext.run(AbstractIdeContext.java:798)
        at com.devonfw.tools.ide.cli.Ideasy.runOrThrow(Ideasy.java:89)
        at com.devonfw.tools.ide.cli.Ideasy.run(Ideasy.java:52)
        at com.devonfw.tools.ide.cli.Ideasy.main(Ideasy.java:29)
        at [email protected]/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.nio.file.FileAlreadyExistsException: /home/hohwille/projects/IDEasy/software/intellij
        at [email protected]/sun.nio.fs.UnixFileSystemProvider.createSymbolicLink(UnixFileSystemProvider.java:513)
        at [email protected]/java.nio.file.Files.createSymbolicLink(Files.java:1069)
        at com.devonfw.tools.ide.io.FileAccessImpl.symlink(FileAccessImpl.java:476)
        ... 13 more


Error: IDEasy failed with exit code 255
@hohwille hohwille added bug Something isn't working update related to updating software or the entire ide intellij IntelliJ IDE from Jet-Brains labels Jan 9, 2025
@hohwille hohwille added this to the release:2025.01.002 milestone Jan 9, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Jan 9, 2025
@hohwille hohwille changed the title Cannot launch/update Intellij on linux Cannot update Intellij on linux: FileAlreadyExistsException Jan 9, 2025
@hohwille
Copy link
Member Author

hohwille commented Jan 9, 2025

Analysis:

if (Files.exists(toolPath)) {
fileAccess.backup(toolPath);
}
fileAccess.mkdirs(toolPath.getParent());
fileAccess.symlink(installation.linkDir(), toolPath);

Seems that we already have a symbolic link here that does not satisfy Files.exists maybe because the symlink is broken...
This code needs to be made more robust.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working intellij IntelliJ IDE from Jet-Brains update related to updating software or the entire ide
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant