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

Deleting project in CLI while Pycharm is open produces error #525

Closed
chbndrhnns opened this issue Aug 3, 2022 · 1 comment
Closed

Deleting project in CLI while Pycharm is open produces error #525

chbndrhnns opened this issue Aug 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@chbndrhnns
Copy link

Describe the bug
Deleting project in CLI while Pycharm is open produces error. Even if pydantic is not even part of the codebase.

To Reproduce
Steps to reproduce the behavior:
0. `mkdir my-project; cd my-project'

  1. python -m venv .venv
  2. source .venv/bin/activate
  3. Start PyCharm in that project
  4. On the CLI, run `cd ..; rm -rf my-project'
java.lang.Throwable: Invalid root file:///Users/cleancoder/dev/scratch/pycharm-all/.venv/lib/python3.9/site-packages (invalid) in com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.InheritedSdkOrderEntryBridge@aad2d2f
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:184)
	at com.intellij.openapi.roots.impl.RootFileSupplier.ensureValid(RootFileSupplier.java:124)
	at com.intellij.openapi.roots.impl.RootIndex.ensureValid(RootIndex.java:359)
	at com.intellij.openapi.roots.impl.RootIndex.fillIndexWithLibraryRoots(RootIndex.java:350)
	at com.intellij.openapi.roots.impl.RootIndex.buildRootInfo(RootIndex.java:225)
	at com.intellij.openapi.roots.impl.RootIndex.<init>(RootIndex.java:73)
	at com.intellij.openapi.roots.impl.RootIndex.<init>(RootIndex.java:56)
	at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getRootIndex(DirectoryIndexImpl.java:160)
	at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getRootIndex(DirectoryIndexImpl.java:142)
	at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getInfoForFile(DirectoryIndexImpl.java:170)
	at com.intellij.openapi.roots.impl.FileIndexBase.getInfoForFileOrDirectory(FileIndexBase.java:96)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getInfoForFileOrDirectory(ProjectFileIndexImpl.java:27)
	at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.isInContent(ProjectFileIndexImpl.java:196)
	at com.koxudaxi.pydantic.PydanticInitializer$initializeFileLoader$2$1$afterVfsChange$projectFiles$3.invoke(PydanticInitializer.kt:66)
	at com.koxudaxi.pydantic.PydanticInitializer$initializeFileLoader$2$1$afterVfsChange$projectFiles$3.invoke(PydanticInitializer.kt:64)
	at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:171)
	at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
	at kotlin.sequences.SequencesKt___SequencesKt.count(_Sequences.kt:1235)
	at com.koxudaxi.pydantic.PydanticInitializer$initializeFileLoader$2$1.afterVfsChange(PydanticInitializer.kt:71)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.afterVfsChange(AsyncEventSupport.java:133)
	at com.intellij.openapi.vfs.newvfs.AsyncEventSupport.processEventsFromRefresh(AsyncEventSupport.java:156)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEventsInWriteAction(RefreshSessionImpl.java:224)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.lambda$fireEvents$1(RefreshSessionImpl.java:205)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$9(ApplicationImpl.java:987)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.util.PotemkinProgress.runInSwingThread(PotemkinProgress.java:150)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$10(ApplicationImpl.java:987)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1011)
	at com.intellij.openapi.application.impl.ApplicationImpl.runEdtProgressWriteAction(ApplicationImpl.java:985)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread(ApplicationImpl.java:966)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.lambda$fireEvents$2(RefreshSessionImpl.java:200)
	at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:86)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:1011)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1037)
	at com.intellij.openapi.application.WriteAction.run(WriteAction.java:85)
	at com.intellij.openapi.vfs.newvfs.RefreshSessionImpl.fireEvents(RefreshSessionImpl.java:199)
	at com.intellij.openapi.vfs.newvfs.RefreshQueueImpl.lambda$queueSession$2(RefreshQueueImpl.java:103)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$6(NonBlockingReadActionImpl.java:596)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:749)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Expected behavior
The plugin does not cause an exception

Screenshots
If applicable, add screenshots to help explain your problem.
Also, gif movies are recommended.

Environments (please complete the following information):

  • IDE: 2022.2
  • OS: macOS 12.5
  • Pydantic Version: not installed in that project
  • Plugin version: 0.13.3

Additional context
Add any other context about the problem here.

@koxudaxi koxudaxi added the bug Something isn't working label Aug 8, 2022
@koxudaxi
Copy link
Owner

I hope I fixed the error by the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants