- edited description
NPE during retrieval in module with multiple content roots containing source roots
Got this error when I’ve tried to retrieve Report from scratch org (using mdapi Retrieve Metadata):
The report was not in the src folder at that time, I’ve had “Subscribed Only” unchecked. This seems to happen when retrieving any metadata.
I’ve attached idea.log where you can find stack trace. I hope you will find it helpful.
Kind Regards,
Piotr
IntelliJ IDEA 2019.1.3 (Ultimate Edition)
Build #IU-191.7479.19, built on May 28, 2019
Licensed to Piotr Kożuchowski
Subscription is active until January 30, 2020
JRE: 1.8.0_202-release-1483-b58 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Comments (12)
-
reporter -
repo owner Piotr, do you mind enabling debug logging for metadata retrieval (http://www.illuminatedcloud.com/support/debuglogging), reproducing the issue, and providing the resulting
idea.log
? That should show me the exact parameter values being passed into this method so I can understand it better. Thanks! -
reporter - attached idea.log
Idea.log with debug flags
-
reporter - attached more error examples.log
A few more error examples - retrieved Account object which was not in the src folder and AccountTrigger which is already there.
-
repo owner Thanks, Piotr. Here's the issue:
2019-07-15 16:23:02,323 [16229957] DEBUG - .ForceComSfdxMetadataRetriever - projectRoot = C:/Users/piotr/IdeaProjects/DevToolkit 2019-07-15 16:23:02,323 [16229957] DEBUG - .ForceComSfdxMetadataRetriever - defaultSourceRoot = null 2019-07-15 16:23:02,323 [16229957] DEBUG - .ForceComSfdxMetadataRetriever - testSourceRoot = null
Notice that the value for
defaultSourceRoot
isnull
. Do you mind providing the bottom portion of your.iml
file that looks like:<component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/force-app/main/default" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/config" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/manifest" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/force-app/test/default" isTestSource="true" /> </content> <orderEntry type="jdk" jdkName="IlluminatedCloud (df17-manifest-testing/df17)" jdkType="IlluminatedCloud" /> <orderEntry type="sourceFolder" forTests="false" /> </component>
I'd like to see how your content roots and source roots are configured. Hopefully this is just a simple matter of configuration, though if not it should let me know more about the nature of the underlying bug if it goes that direction.
-
reporter <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/config" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/force-app/pkozuchowskiLibrary/test" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/force-app" isTestSource="false" /> </content> <content url="file://$MODULE_DIR$/force-app"> <sourceFolder url="file://$MODULE_DIR$/force-app/pkozuchowskiLibrary/default" isTestSource="false" /> </content> <orderEntry type="jdk" jdkName="IlluminatedCloud (DevToolkit/SandboxScratch)" jdkType="IlluminatedCloud" /> <orderEntry type="sourceFolder" forTests="false" /> </component>
Now that you mention it, this part may be messy here… I have 2x default folder, maybe that’s why it fails.
I will see what happens if I clean it up. -
repo owner Yes, I think that's the issue. Try consolidating into a single content root with the same source roots and I bet it works properly. Please let me know either way.
-
reporter Once I’ve removed one of “default” folders, the issue disappeared. I thought it’s more of general problem than issue with configuration of my project
-
reporter - marked as minor
-
repo owner Thanks for letting me know. I'll see if there's anything I can do to detect this type of configuration and handle it better.
-
repo owner -
repo owner - changed status to resolved
Issue tracker grooming. If this is still an issue, please feel free to reopen, ideally with a concrete reproduction scenario.
- Log in to comment