git4idea plugin deletes my Run Configurations in .run/
I'm a little stumped here. This didn't used to be a problem, but in a recent update to IntelliJ (or the git4idea plugin, maybe) it will periodically delete my Run Configuration templates I have stored in my project in the `.run/` directory. These are XML files that share run configurations across the team (which is why they're committed to the project in the first place). When I look at IntelliJ logs I see:
2025-01-17 12:16:04,815 [ 21238] WARN - #c.i.e.i.RCInArbitraryFileManager - It's unexpected that the file doesn't exist at this point (/Users/sglover/hopper/vi-platform/.run/Template Application.run.xml)
2025-01-20 13:25:10,503 [263366926] INFO - #git4idea.commands.GitHandler - [vi-platform] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false rm --ignore-unmatch --cached -r -- ".run/Template Application.run.xml" ".run/Template Specs2.run.xml"
Does anyone know why this is happening?
请先登录再写评论。
Hi Sean,
This definitely is issued by ide. But unfortunately, without full logs and actions that preceded I cannot pin-point what might the issue.
Can you upload full logs to https://uploads.jetbrains.com/?
Also, can you right-click on the folder and check local history? What entries can be seen there?
Hey Sean,
I agree with the suggestion to upload the full logs; that should help in identifying the issue more accurately. As for the local history, checking those entries might give you some clues about the changes that led up to this problem.
In case you’re still stuck, I'd recommend checking the IDE settings too—sometimes the issue could be linked to an unnoticed setting or preference. It might be worth looking through the configuration options just to rule that out.
Hope this helps! Let me know if you need any more assistance.
Dino Letic Thanks for the reply. I uploaded a log with the log statements included in my original message. There's no useful information in the git log for the .run directory (`git log – .run/`) I can reliably reproduce the issue though by restoring the file in my local branch.
Upload id: 2025_01_30_JGixjPgmk62uo8DtZyKZ7t (file: idea.1.log)
BTW user Matlldacooper7465 who also replied to this post looks like an AI bot, or scammer, or both.
And just to confirm, right clicking and checking local history for this file, what are the entries?
Dino Letic The local history shows a cycle of Delete App/Specs 2 run templates, external change (me restoring the files). The latest revert I did from within the Local history tool.
Logs are definitely not helping. How does it reproduce btw? Do you perform any specific action?
If you go to Plugins -→ Disable downloaded plugins, does it occur?
Dino Letic I tried disabling all downloaded plugins except for Scala. When the IDE restarted it immediately deleted the files again when I expanded the .run directory.
I tried disabling Scala too and after restart it only deleted .run/Template Application.run.xml, but left .run/Template Specs2.run.xml . I also got a little toaster notifcation asking if I wanted to enable the Specs2 plugin.
I can recreate it pretty consistently on startup or when I run run configurations. Can I get more verbose logging to help troubleshoot?
Hi Sean,
Talked to my colleague about it. Our suspicion is that there could be some code in his project/build scripts which cleans XML files in
.run
folder.Can you open a yt ticket with a sample project where it can be reproduced?
Another thing: Can you try to make the files read-only? This way if IDE is indeed trying to modify it, maybe some exception will occur in the log.
Hi Dino Letic . I made the file read only. I also removed it from source control, but I still experience the issue. Upon looking at the logs I do see a different log line referencing the files though.
```
2025-03-26 18:41:40,966 [177108955] WARN - #com.github.copilot.lang.agent.lsp.VirtualFileUri - Unable to parse as compliant URI, using fallback: mock://Template Application.run.xml
2025-03-26 18:41:42,652 [177110641] WARN - #com.github.copilot.lang.agent.lsp.VirtualFileUri - Unable to parse as compliant URI, using fallback: mock://Template Specs2.run.xml
2025-03-26 18:41:43,705 [177111694] WARN - #com.github.copilot.lang.agent.lsp.VirtualFileUri - Unable to parse as compliant URI, using fallback: mock://Template Specs2.run.xml
```
Upload id: 2025_03_31_LZV9FHjuZvgsdmc6f86LRa (file: idea.1.log)
Unfortunately, I don't see any clues from the log.
@Sean Did you made the file read-only using the below way (see the attached picture):
If not, could you please right-click these run configuration files, choose the “ Properties ” menu, make it as read-only, and reproduce this issue, share the log again?
Hi Lejia Chen . I run macOS so I set the files read only with `chmod -wx`
-r--r--r--@ 1 sglover staff 495 Apr 9 15:13 Template Application.run.xml
-r--r--r--@ 1 sglover staff 754 Apr 9 15:13 Template Specs2.run.xml
Could you share your `Template_Application.run.xml` and `Template_Specs2.run.xml` files?
From the log, it looks like IntelliJ failed to parse these files. It's possible that the files are not valid XML files and caused this issue.
> 2025-03-26 18:41:40,588 [177108577] WARN - #c.i.e.i.RCInArbitraryFileManager - Failed to parse file xxxx/.idea_run_config/Template Application.run.xml
org.jdom.JDOMException: Unexpected End-of-input in prolog
at [row,col {unknown-source}]: [1,1]
at com.intellij.openapi.util.JDOMUtil.loadUsingStaX(JDOMUtil.java:239)
at com.intellij.openapi.util.JDOMUtil.load(JDOMUtil.java:300)
at com.intellij.execution.impl.RCInArbitraryFileManager.loadChangedRunConfigsFromFile$intellij_platform_execution_impl(RCInArbitraryFileManager.kt:140)
at com.intellij.execution.impl.RunManagerImpl.updateRunConfigsFromArbitraryFiles$lambda$22(RunManagerImpl.kt:414)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction$lambda$4(AnyThreadWriteThreadingSupport.kt:260)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:272)