NPE Exception when trying to deploy metadata field relationship

Issue #1959 resolved
Justin Julicher created an issue

Got the following when trying to deploy a metadata field (a copy of another) relationship and the relationship name/label existed already.

5,033 [ 165460]   INFO - r.ForceComSfdxMetadataDeployer - Package.xml file found at C:/Users/justinj/Workspace/GRE Salesforce Phase One/manifest/package.xml 
2021-08-13 09:58:28,522 [ 168949]   INFO - r.ForceComSfdxMetadataDeployer - Deployment status = FAILED 
2021-08-13 09:58:28,522 [ 168949]   WARN - r.ForceComSfdxMetadataDeployer -   Found ERROR for CustomField objects/ApprovalProcess__mdt/fields/ParentApprovalTrackedField__c.field-meta.xml: null 
2021-08-13 09:58:28,522 [ 168949]   WARN - .IlluminatedCloudExceptionUtil -  
    at java.base/java.util.regex.Matcher.getTextLength(
    at java.base/java.util.regex.Matcher.reset(
    at java.base/java.util.regex.Matcher.<init>(
    at java.base/java.util.regex.Pattern.matcher(
    at com.illuminatedcloud.intellij.lightning.LightningWebComponentsUtil.handleLightningWebComponentError(SourceFile:1160)
    at com.illuminatedcloud.intellij.builder.AbstractForceComMetadataDeployer.processDeploymentResult(SourceFile:802)
    at com.illuminatedcloud.intellij.builder.AbstractForceComMetadataDeployer.access$100(SourceFile:91)
    at com.illuminatedcloud.intellij.builder.AbstractForceComMetadataDeployer$
    at com.intellij.openapi.progress.impl.CoreProgressManager$
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(
    at java.base/java.util.concurrent.CompletableFuture$
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.base/java.util.concurrent.ThreadPoolExecutor$
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$
    at java.base/ Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$
    at java.base/
2021-08-13 09:58:33,882 [ 174309]   INFO - rationStore.ComponentStoreIm

TBH the sfdx cli reported

Deploy ID: 0Af8r000000ZVXBCA4
SOURCE PROGRESS | ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | 0/2 Components

=== Component Failures [1]
Type  Name                                                Problem
────  ──────────────────────────────────────────────────  ────────────────
      CustomMetadata__mdt.RelationshipField__c  undefined (7:61)

So I think the deployment result is slightly different when this is deployed.

Steps to reproduce:

Create custommetadata with SObject relationship.

Create related field to above SOBject.

Retrieve into IntelliJ/webstorm IC.

copy & paste xml of field to another field - update everything except the relationshipName etc.


With my Issue I just incremented the suffix by 1 (but that already existed).

Let me know if you can’t reproduce the issue.

Comments (5)

  1. Justin Julicher reporter

    Looking at the log it looks like it was trying to deploy a LWC at the same time - I don’t know why because I hadn’t selected any and there were no changed LWC components.

  2. Scott Wells repo owner

    Okay. I'm traveling today but will take a look early next week. Minimally I'll fix the NPE, but if you're getting an undesired deployment, I'll need to figure out why as well.

  3. Scott Wells repo owner

    Justin, in order to fix this properly, I'd need to see the exact JSON output of that deployment. You can either enable debug logging for metadata deployment in IC2 which will ensure that it's in the log, or you can just run the same deployment with the --json flag. Once I have that I can look at why IC2's pattern matcher doesn't handle the deployment result properly.

  4. Scott Wells repo owner

    This shouldn't NPE as of, but the reported error message may not be great. Basically there are some error messages reported from CLI-based deployments of LWC components that mangle important information such as line/column numbers into the message itself. IC2 tries to extract that info, and in this case it looks like the error message is just the line/column and nothing else. So that's how it's going to be reported, and that problem won't be hyperlinked to that code location. But it also won't error anymore.

  5. Log in to comment