odoo-ide/pycharm-odoo

java.lang.IllegalStateException errors

AntoineVDV opened this issue · 3 comments

Hello, I've been getting plenty of such exceptions caused by the Odoo plugin over several versions of both PyCharm and the plugin. Currently, I'm running PyCharm 2024.1 with Odoo 2024.3.4.241.

java.lang.IllegalStateException: removeContentEntry: removed content entry url 'file:///home/antoine/.local/share/JetBrains/PyCharm2024.1/Odoo/stubs/odoo-stubs' still exists after removing
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ModifiableRootModelBridgeImpl.removeContentEntry(ModifiableRootModelBridgeImpl.kt:251)
	at dev.ngocta.pycharm.odoo.python.stubs.OdooStubsUpdater.lambda$updateModule$3(OdooStubsUpdater.java:91)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.modifyModel(ModuleRootModificationUtil.java:160)
	at dev.ngocta.pycharm.odoo.python.stubs.OdooStubsUpdater.updateModule(OdooStubsUpdater.java:85)
	at dev.ngocta.pycharm.odoo.python.stubs.OdooStubsUpdater.lambda$updateProject$0(OdooStubsUpdater.java:51)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:244)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:222)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:840)

Hello @AntoineVDV ,

How does your project structure look when these errors occur?

image

Like this

image

The main differences seem to be that I have a single worktree for all Odoo versions (I git checkout often) and that odoo-stubs has a duplicate entry.

I removed the duplicate entry now and will check if the problem occurs again. I think that it will because I've had these tracebacks since before odoo-stubs were bundled in the plugin.

It indeed solved the problem :)