NiclasvanEyk / jetbrains-laravel-make-integration

🛠 A set of integration points that connect your Laravel application to PhpStorm
https://plugins.jetbrains.com/plugin/14612-make-for-laravel
37 stars 5 forks source link

Error/Exception reported in PhpStorm log: `node.parent must not be null` #22

Closed marsvin closed 3 years ago

marsvin commented 3 years ago

I found the below error log in PhpStorm. I did not use the Laravel Make plugin at the time. Not sure what triggered the error. I was editing Laravel model files and factories and I was also using Datagrip. Not sure if I was pulling up any context menus where Laravel Make was included.

I also ran the 'php artisan ide-helper:models' command to re-generate the IDE helper files for the models. Maybe this was triggering it. I also ran 'php artisan migrate:fresh' a few times.

As I'm not sure how the Laravel Make plugin works under the hood I'm not sure what it depends upon.

I'm running PhpStorm 2020.3 on Ubuntu 20.04. Edit: I'm running 2.3.1 of the Laravel Make plugin.


update failed for ActionGroup: Cast (Create a new Laravel Cast)[Cast]

java.lang.IllegalStateException: node.parent must not be null at com.niclas_van_eyk.laravel_make_integration.filesystem.FindArtisanBinaryKt.findArtisanBinaryDirectory(findArtisanBinary.kt:11) at com.niclas_van_eyk.laravel_make_integration.UtilsKt.resolveLaravelProject(utils.kt:23) at com.niclas_van_eyk.laravel_make_integration.actions.ArtisanMakeSubCommandAction.update(ArtisanMakeSubCommandAction.kt:83) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:178) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:465) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$1(ActionUpdater.java:94) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:134) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$2(ActionUpdater.java:95) at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:447) at com.intellij.openapi.actionSystem.impl.ActionUpdater.hasChildrenWithState(ActionUpdater.java:401) at com.intellij.openapi.actionSystem.impl.ActionUpdater.hasVisibleChildren(ActionUpdater.java:378) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:311) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$19(ActionUpdater.java:276) at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1599) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:276) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:186) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:160) at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:67) at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:57) at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:49) at com.intellij.ide.actions.WeighingActionGroup.getChildren(WeighingActionGroup.java:49) at com.intellij.ide.actions.WeighingNewActionGroup.getChildren(WeighingNewActionGroup.java:24) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$3(ActionUpdater.java:98) at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:134) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$4(ActionUpdater.java:98) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$getGroupChildren$20(ActionUpdater.java:286) at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705) at com.intellij.openapi.actionSystem.impl.ActionUpdater.getGroupChildren(ActionUpdater.java:285) at com.intellij.openapi.actionSystem.impl.ActionUpdater.hasChildrenWithState(ActionUpdater.java:391) at com.intellij.openapi.actionSystem.impl.ActionUpdater.hasVisibleChildren(ActionUpdater.java:378) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:311) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$19(ActionUpdater.java:276) at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1599) at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:276) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:186) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:160) at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupWithTimeout$11(ActionUpdater.java:202) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:59) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:59) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.withTimeout(ProgressIndicatorUtils.java:306) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroupWithTimeout(ActionUpdater.java:202) at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroupWithTimeout(ActionUpdater.java:194) at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:107) at com.intellij.openapi.actionSystem.impl.ActionPopupMenuImpl$MyMenu.show(ActionPopupMenuImpl.java:129) at com.intellij.ui.PopupHandler$2.invokePopup(PopupHandler.java:87) at com.intellij.ui.PopupHandler.mousePressed(PopupHandler.java:36) at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287) at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:287) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6649) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345) at java.desktop/java.awt.Component.processEvent(Component.java:6417) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859) at com.intellij.ide.actions.ShowPopupMenuAction.actionPerformed(ShowPopupMenuAction.java:47) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:281) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:615) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:675) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:674) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:625) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:522) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:476) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:225) at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:892) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:837) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:507) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

NiclasvanEyk commented 3 years ago

Hi, thanks for reporting this!

Even though you are not actively using the plugin in the foreground, PHPStorm still triggers verstein Lifecycle methods on components of this plugin. It looks like one of them (update) failed.

I will try to look into this when I find the time. Just so I get a feeling for the impact of this bug, did it crash your IDE or otherwise hinder your ability to use the plugin?

marsvin commented 3 years ago

Nothing crashed and I could later use the plugin without problems and without restarting PhpStorm. So no major problem (in my case at least). Just wanted to report it while it was easily accessible in the PhpStorm log. Thanks for a great plugin!

bfinlay commented 3 years ago

I have started experiencing this bug more frequently. Just upgraded to PHPStorm 2021.1.2.

I think this is relevant: I am doing more work on the react side of the application, which is opened as a project "attached" to the same window as the PHP project. The PHP project has an artisan binary. The react project does not.

It raises a red alert indicator in the lower right which is distracting. Otherwise it does not interfere with the IDE.

update failed for ActionGroup: Cast (Create a new Laravel Cast)[Cast]

java.lang.IllegalStateException: node.parent must not be null
    at com.niclas_van_eyk.laravel_make_integration.filesystem.FindArtisanBinaryKt.findArtisanBinaryDirectory(findArtisanBinary.kt:11)
    at com.niclas_van_eyk.laravel_make_integration.UtilsKt.resolveLaravelProject(utils.kt:23)
    at com.niclas_van_eyk.laravel_make_integration.actions.ArtisanMakeSubCommandAction.update(ArtisanMakeSubCommandAction.kt:83)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$1(ActionUtil.java:170)
    at com.intellij.util.SlowOperations.lambda$allowSlowOperations$0(SlowOperations.java:77)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:64)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:76)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:176)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:510)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$1(ActionUpdater.java:104)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:147)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$2(ActionUpdater.java:105)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:492)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:352)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:308)
    at com.intellij.util.TimeoutUtil.compute(TimeoutUtil.java:134)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$22(ActionUpdater.java:307)
    at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1511)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:307)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:199)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:173)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupWithTimeout$11(ActionUpdater.java:215)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:57)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:688)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:634)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:64)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:57)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.withTimeout(ProgressIndicatorUtils.java:310)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroupWithTimeout(ActionUpdater.java:215)
    at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroupWithTimeout(ActionUpdater.java:207)
    at com.intellij.openapi.actionSystem.impl.Utils.expandActionGroup(Utils.java:105)
    at com.intellij.openapi.actionSystem.impl.Utils.fillMenu(Utils.java:117)
    at com.intellij.openapi.actionSystem.impl.ActionMenu.fillMenu(ActionMenu.java:381)
    at com.intellij.openapi.actionSystem.impl.ActionMenu$MenuListenerImpl.menuSelected(ActionMenu.java:337)
    at com.intellij.openapi.actionSystem.impl.ActionMenu$MenuListenerImpl.stateChanged(ActionMenu.java:261)
    at java.desktop/javax.swing.DefaultButtonModel.fireStateChanged(DefaultButtonModel.java:352)
    at java.desktop/javax.swing.DefaultButtonModel.setSelected(DefaultButtonModel.java:234)
    at java.desktop/javax.swing.JMenu.setSelected(JMenu.java:291)
    at java.desktop/javax.swing.JMenu.menuSelectionChanged(JMenu.java:1187)
    at com.intellij.openapi.actionSystem.impl.ActionMenu.menuSelectionChanged(ActionMenu.java:233)
    at java.desktop/javax.swing.MenuSelectionManager.setSelectedPath(MenuSelectionManager.java:129)
    at java.desktop/javax.swing.plaf.basic.BasicMenuUI$Handler.mouseEntered(BasicMenuUI.java:569)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6661)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at java.desktop/java.awt.Component.processEvent(Component.java:6417)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEnterExit(Container.java:4698)
    at java.desktop/java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4676)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4527)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:906)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
NiclasvanEyk commented 3 years ago

@bfinlay thanks for bumping this issue, I will look if I can reproduce and try to fix it. I suspect the search just iterates up to the root directory and then fails.

Unfortunately I am quite busy at the moment so it may take a while to fix the issue. PRs are welcome though.

NiclasvanEyk commented 3 years ago

Fixed in https://github.com/NiclasvanEyk/jetbrains-laravel-make-integration/releases/tag/v2.3.5 which should get published somewhere in the next 7 days or so

bfinlay commented 3 years ago

Thanks for the quick work!

I've been running with the plugin v2.3.5 enabled while working in the react project for at least a couple days now with no notifications about the node.parent must not be null.

Switched over to the PHP side (which per above is "attached to the same window" in PHPStorm terminology - ie both the react and php sides of the project are open in the same window) and created a service provider which worked great.

It seems like this issue is fixed 👍