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

Persistent ID already exists. Removing old entity #1308

Open
olkornii opened this issue Jan 22, 2024 · 6 comments
Open

Persistent ID already exists. Removing old entity #1308

olkornii opened this issue Jan 22, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@olkornii
Copy link
Contributor

olkornii commented Jan 22, 2024

IDE internal Error after create Quarkus Gradle project. I haven't noticed any negative effects, but the "IDE error occurred" popup appears every time I create a new Quarkus Gradle project.

Steps to reproduce:

  1. git clone intellij-quarkus repo
  2. ./gradlew clean runIde
  3. New project -> Quarkus -> Next
  4. Change Tool: to "Gradle" -> Next -> Next -> Create
  5. Open IDE Internal Errors

Stacktrace:

Version: v31
Saving store content at: /git/intellij-quarkus/build/idea-sandbox/system/log/workspaceModel/storeDump-20240122-104954

com.intellij.workspaceModel.storage.impl.exceptions.AddDiffException: Persistent ID already exists. Removing old entity
Persistent ID: ModuleId(name=code-with-quarkus)
Existing entity data: ModuleEntityData(name=code-with-quarkus, type=JAVA_MODULE, dependencies=[com.intellij.workspaceModel.storage.bridgeEntities.api.ModuleDependencyItem$ModuleSourceDependency@35dhtrt], entitySource=JpsImportedEntitySource(internalFile=FileInDirectory(directory=file://<home>/IdeaProjects/code-with-quarkus/.idea/modules, fileNameId=1, projectLocation=DirectoryBased(projectDir=file://<home>/IdeaProjects/code-with-quarkus, ideaFolder=file://<home>/IdeaProjects/code-with-quarkus/.idea)), externalSystemId=GRADLE, storedExternally=true), id=0, id=0)
New entity data: ModuleEntityData(name=code-with-quarkus, type=JAVA_MODULE, dependencies=[com.intellij.workspaceModel.storage.bridgeEntities.api.ModuleDependencyItem$InheritedSdkDependency@5c311586, com.intellij.workspaceModel.storage.bridgeEntities.api.ModuleDependencyItem$ModuleSourceDependency@35dhtrt], entitySource=FileInDirectory(directory=file://<home>/IdeaProjects/code-with-quarkus, fileNameId=0, projectLocation=DirectoryBased(projectDir=file://<home>/IdeaProjects/code-with-quarkus, ideaFolder=file://<home>/IdeaProjects/code-with-quarkus/.idea)), id=0, id=0)
	at com.intellij.workspaceModel.storage.impl.MutableEntityStorageImpl.addDiffAndReport$intellij_platform_workspaceModel_storage(EntityStorageSnapshotImpl.kt:397)
	at com.intellij.workspaceModel.storage.impl.AddDiffOperation.checkPersistentId(AddDiffOperation.kt:373)
	at com.intellij.workspaceModel.storage.impl.AddDiffOperation.addDiff(AddDiffOperation.kt:33)
	at com.intellij.workspaceModel.storage.impl.MutableEntityStorageImpl.addDiff(EntityStorageSnapshotImpl.kt:363)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModifiableModuleModelBridgeImpl$commit$1.invoke(ModifiableModuleModelBridgeImpl.kt:242)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModifiableModuleModelBridgeImpl$commit$1.invoke(ModifiableModuleModelBridgeImpl.kt:38)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.updateProjectModel(WorkspaceModelImpl.kt:73)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModifiableModuleModelBridgeImpl.commit(ModifiableModuleModelBridgeImpl.kt:241)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.createAndCommitIfNeeded(ModuleBuilder.java:313)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.lambda$commitModule$4(ModuleBuilder.java:356)
	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.ide.util.projectWizard.ModuleBuilder.commitModule(ModuleBuilder.java:355)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.commit(ModuleBuilder.java:342)
	at com.intellij.ide.util.projectWizard.JavaModuleBuilder.commit(JavaModuleBuilder.java:175)
	at com.intellij.ide.impl.NewProjectUtil.doCreate(NewProjectUtil.java:184)
	at com.intellij.ide.impl.NewProjectUtil.createFromWizard(NewProjectUtil.java:92)
	at com.intellij.ide.impl.NewProjectUtil.createFromWizard(NewProjectUtil.java:87)
	at com.intellij.ide.impl.NewProjectUtil.createNewProject(NewProjectUtil.java:74)
	at com.intellij.ide.actions.NewProjectAction.actionPerformed(NewProjectAction.java:25)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:315)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:294)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:337)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:294)
	at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenActionsUtil.performAnActionForComponent(WelcomeScreenActionsUtil.java:96)
	at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenActionsUtil$LargeIconWithTextWrapper.lambda$new$0(WelcomeScreenActionsUtil.java:125)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
	at java.desktop/java.awt.Component.processEvent(Component.java:6422)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4969)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4583)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4524)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
	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:763)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:840)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:763)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
	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)

Intellij: 2022.2.3
jdk: openjdk-17
Gradle: 8.4

@fbricon
Copy link
Contributor

fbricon commented Jan 22, 2024

Persistent ID: ModuleId(name=code-with-quarkus)

the module Id seems to be the module name. Do you have the same issue if you create several projects from other IJ wizards, with the same name?

@fbricon
Copy link
Contributor

fbricon commented Jan 22, 2024

@olkornii
Copy link
Contributor Author

See https://youtrack.jetbrains.com/issue/IDEA-264052/Workspace-model-exceptions-AddDiffException-addDiff-persistent-id-already-exists.-Removing-old-entity-and-others

might be caused by running tests against an old version of IJ

I didn't run the tests, I just created the project manually.

@olkornii
Copy link
Contributor Author

olkornii commented Jan 22, 2024

Persistent ID: ModuleId(name=code-with-quarkus)

the module Id seems to be the module name. Do you have the same issue if you create several projects from other IJ wizards, with the same name?

I don't know how to start 2 instances of IJ with "gradlew runIde". Any ideas?

@olkornii
Copy link
Contributor Author

See https://youtrack.jetbrains.com/issue/IDEA-264052/Workspace-model-exceptions-AddDiffException-addDiff-persistent-id-already-exists.-Removing-old-entity-and-others

might be caused by running tests against an old version of IJ

Tried to create a project with 2023.1. Same.

@olkornii
Copy link
Contributor Author

olkornii commented Feb 1, 2024

Also tried with 2022.3, not exactly the same but very similar problem:

Version: v42
Saving store content at: /git/intellij-quarkus/build/idea-sandbox/system/log/workspaceModel/storeDump-20240201-114640

com.intellij.workspaceModel.storage.impl.exceptions.AddDiffException: Symbolic ID already exists. Removing old entity
Symbolic ID: ModuleId(name=code-with-quarkus-test)
Existing entity data: ModuleEntityData(name=code-with-quarkus-test, type=JAVA_MODULE, dependencies=[com.intellij.workspaceModel.storage.bridgeEntities.ModuleDependencyItem$ModuleSourceDependency@79c5d3k5], entitySource=JpsImportedEntitySource(internalFile=FileInDirectory(directory=file://<home>/IdeaProjects/code-with-quarkus-test/.idea/modules, fileNameId=1, projectLocation=DirectoryBased(projectDir=file://<home>/IdeaProjects/code-with-quarkus-test, ideaFolder=file://<home>/IdeaProjects/code-with-quarkus-test/.idea)), externalSystemId=GRADLE, storedExternally=true), id=0, id=0)
New entity data: ModuleEntityData(name=code-with-quarkus-test, type=JAVA_MODULE, dependencies=[com.intellij.workspaceModel.storage.bridgeEntities.ModuleDependencyItem$InheritedSdkDependency@3c631779, com.intellij.workspaceModel.storage.bridgeEntities.ModuleDependencyItem$ModuleSourceDependency@79c5d3k5], entitySource=FileInDirectory(directory=file://<home>/IdeaProjects/code-with-quarkus-test, fileNameId=0, projectLocation=DirectoryBased(projectDir=file://<home>/IdeaProjects/code-with-quarkus-test, ideaFolder=file://<home>/IdeaProjects/code-with-quarkus-test/.idea)), id=0, id=0)
	at com.intellij.workspaceModel.storage.impl.MutableEntityStorageImpl.addDiffAndReport$intellij_platform_workspaceModel_storage(EntityStorageSnapshotImpl.kt:548)
	at com.intellij.workspaceModel.storage.impl.AddDiffOperation.checkSymbolicId(AddDiffOperation.kt:381)
	at com.intellij.workspaceModel.storage.impl.AddDiffOperation.addDiff(AddDiffOperation.kt:44)
	at com.intellij.workspaceModel.storage.impl.MutableEntityStorageImpl.addDiff(EntityStorageSnapshotImpl.kt:514)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModifiableModuleModelBridgeImpl$commit$1.invoke(ModifiableModuleModelBridgeImpl.kt:243)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModifiableModuleModelBridgeImpl$commit$1.invoke(ModifiableModuleModelBridgeImpl.kt:242)
	at com.intellij.workspaceModel.ide.impl.WorkspaceModelImpl.updateProjectModel(WorkspaceModelImpl.kt:108)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.ModifiableModuleModelBridgeImpl.commit(ModifiableModuleModelBridgeImpl.kt:242)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.createAndCommitIfNeeded(ModuleBuilder.java:313)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.lambda$commitModule$4(ModuleBuilder.java:356)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:943)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:969)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.commitModule(ModuleBuilder.java:355)
	at com.intellij.ide.util.projectWizard.ModuleBuilder.commit(ModuleBuilder.java:342)
	at com.intellij.ide.util.projectWizard.JavaModuleBuilder.commit(JavaModuleBuilder.java:175)
	at com.intellij.ide.impl.NewProjectUtil.doCreate(NewProjectUtil.java:185)
	at com.intellij.ide.impl.NewProjectUtil.createFromWizard(NewProjectUtil.java:92)
	at com.intellij.ide.impl.NewProjectUtil.createFromWizard(NewProjectUtil.java:87)
	at com.intellij.ide.impl.NewProjectUtil.createNewProject(NewProjectUtil.java:74)
	at com.intellij.ide.actions.NewProjectAction.actionPerformed(NewProjectAction.java:25)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:323)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:302)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:346)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:302)
	at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenActionsUtil.performAnActionForComponent(WelcomeScreenActionsUtil.java:101)
	at com.intellij.openapi.wm.impl.welcomeScreen.WelcomeScreenActionsUtil$LargeIconWithTextWrapper.lambda$new$0(WelcomeScreenActionsUtil.java:130)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
	at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6657)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3385)
	at java.desktop/java.awt.Component.processEvent(Component.java:6422)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4969)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4583)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4524)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2809)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4855)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:794)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
	at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:766)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:764)
	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:763)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:831)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:774)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:813)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
	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)

@angelozerr angelozerr added the bug Something isn't working label Jun 26, 2024
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

3 participants