FIELD_INTEGRITY_EXCEPTION when saving Aura Components(CMP)

Issue #483 resolved
Tony White created an issue

Found that sometimes when saving a component it would result in nothing more than

14:03 Deployment Failed: FIELD_INTEGRITY_EXCEPTION - null

Take the component.cmp code to the developer console and try to save it and you get more of an error eg Failed to save undefined: Cannot mix expression and literal string in attribute value, try rewriting like {!'foo' + v.bar}: Source

So the component.cmp code is trying add a parameter to a url eg src="/myfolder/web?userid={!v.UserId}"

Comments (15)

  1. Scott Wells repo owner

    Thanks, Tony. I'll take a look at how they're reporting the corresponding error and make sure that it's surfaced to the user. Unfortunately error reporting for Lightning is quite different from other metadata types in that it comes back semi-unstructured and I have to parse the response rather than looking in the error message field. This must be a variant of that I haven't found. I'll let you know if I'm unable to reproduce it so that I can work with you to get a reproducible test case.

  2. Scott Wells repo owner

    Yep, this was just another variation on how Lightning error messages are reported. I've just submitted a fix so that these error messages will be displayed properly. The fix will be included in the next build.

  3. Former user Account Deleted

    I've run into this again, using IC 2 (not sure if that matters). I get this from the IDE: 11:42 AM Deployment Failed: FIELD_INTEGRITY_EXCEPTION - Source

    But this from the Developer Console: Failed to save Application.cmp: The attribute "suppressWaiting" was not found on the COMPONENT markup://c:Consents: Source

  4. Former user Account Deleted

    Sure, sorry, I should have done that first! I think the relevant lines are below.

    2017-12-18 12:07:29,082 [3059488] DEBUG - .IlluminatedCloudSaveAllAction - Checking to see if the overridden Save All action is active. 2017-12-18 12:07:29,083 [3059489] DEBUG - .IlluminatedCloudSaveAllAction - Expected exactly one action associated with Ctrl+S but found 2. 2017-12-18 12:07:29,083 [3059489] DEBUG - tellij.builder.ForceComBuilder - Asked to build the following files for buildEventType=SAVE, bulkDeploy=false, forceDeploy=false: {file://C:/github/SMP/src/aura/CAPApplication/CAPApplication.cmp}. 2017-12-18 12:07:29,083 [3059489] DEBUG - tellij.builder.ForceComBuilder - Checking whether this is a single item static resource or Lightning bundle file deployment using the Tooling API. 2017-12-18 12:07:29,083 [3059489] INFO - tellij.builder.ForceComBuilder - Deploying single Lightning bundle file C:/github/SMP/src/aura/CAPApplication/CAPApplication.cmp using the Tooling API. 2017-12-18 12:07:29,083 [3059489] DEBUG - der.ForceComToolingApiDeployer - Deploying CAPApplication.cmp to Dev1 2017-12-18 12:07:30,129 [3060535] INFO - der.ForceComToolingApiDeployer - Using the tooling API to update Lightning bundle file CAPApplication.cmp. 2017-12-18 12:07:30,131 [3060537] DEBUG - der.ForceComToolingApiDeployer - Sending REST request body to https://cs23.salesforce.com/services/data/v41.0/tooling/sobjects/AuraDefinition/0Ad0a0000005GWFCA2?_HttpMethod=PATCH: {"source":"\u003caura:component implements\u003d\"forceCommunity:availableForAllPageTypes\" controller\u003d\"CAPController\" access\u003d\"global\" extends\u003d\"c:CAPParent\"\u003e\n \u003caura:handler name\u003d\"init\" value\u003d\"{!this}\" action\u003d\"{!c.doInit}\" /\u003e\n \u003caura:attribute name\u003d\"leadId\" type\u003d\"String\"/\u003e\n \u003caura:attribute name\u003d\"email\" type\u003d\"String\"/\u003e\n \u003cc:LightningErrorHandler/\u003e\n \u003cc:CAPStart supressWaiting\u003d\"true\" leadId\u003d\"{!v.leadId}\" leadEmail\u003d\"{!v.email}\" page\u003d\"Login\"/\u003e\n \u003cc:CAPPersonalInfo supressWaiting\u003d\"true\"/\u003e\n \u003cc:CAPCreditCheck supressWaiting\u003d\"true\"/\u003e\n \u003cc:CAPIncomeDoc supressWaiting\u003d\"true\"/\u003e\n \u003cc:CAPConsents suppressWaiting\u003d\"true\"/\u003e\n\u003c/aura:component\u003e\n"} 2017-12-18 12:07:30,608 [3061014] DEBUG - der.ForceComToolingApiDeployer - Received unexpected response status code 400 != 204. 2017-12-18 12:07:30,608 [3061014] DEBUG - der.ForceComToolingApiDeployer - Response body: [{"message":"The attribute \"suppressWaiting\" was not found on the COMPONENT markup://c:CAPConsents: Source","errorCode":"FIELD_INTEGRITY_EXCEPTION","fields":["Source"]}] 2017-12-18 12:07:30,911 [3061317] DEBUG - .ForceComBuildFailureAnnotator - Found compile failures for CAPApplication.cmp 2017-12-18 12:07:30,913 [3061319] DEBUG - .ForceComBuildFailureAnnotator - Adding external annotation: Problem type = ERROR Problem message = FIELD_INTEGRITY_EXCEPTION - Source Line number = 0 Column number = 0

  5. Scott Wells repo owner

    Thanks. Yeah, that's pretty bizarre. Does this only occur on one Lightning markup file or does it occur in all of them? Just trying to characterize the issue a little further to figure out where to go next with troubleshooting it (which is most likely directly to Salesforce if it's only happening for a single file and not others).

  6. Former user Account Deleted

    If I understand you right - I made an intentional error in a different lightning component, and got the same issue. Specifically, this line in another component:

    <aura:if isTrue="{!v.page == 'SREC'}" badAttribute="foo">

    Results in this same error:

    2017-12-18 13:03:14,638 [6405044] DEBUG - der.ForceComToolingApiDeployer - Received unexpected response status code 400 != 204. 2017-12-18 13:03:14,638 [6405044] DEBUG - der.ForceComToolingApiDeployer - Response body: [{"message":"The attribute \"badAttribute\" was not found on the COMPONENT markup://aura:if: Source","errorCode":"FIELD_INTEGRITY_EXCEPTION","fields":["Source"]}] 2017-12-18 13:03:14,949 [6405355] DEBUG - .ForceComBuildFailureAnnotator - Found compile failures for CAPConsents.cmp 2017-12-18 13:03:14,950 [6405356] DEBUG - .ForceComBuildFailureAnnotator - Adding external annotation: Problem type = ERROR Problem message = FIELD_INTEGRITY_EXCEPTION - Source Line number = 0 Column number = 0

    FWIW, I've also switched from the IntelliJ Community, to Webstorm, to Ultimate, and from IC to IC2 so I wouldn't be surprised if my environment has something wrong with it...

  7. Scott Wells repo owner

    Sorry...busy day. Okay, so if I understand correctly, when you have any error in Lightning markup you get this type of vague error on save now. Is that correct? And I wouldn't expect it to be a result of the change from IC1 to IC2 or IntelliJ to/from WebStorm. This is just the response to an API call to the server that hasn't changed in quite a while.

    Once you confirm the behavior pattern, I'll see if I can reproduce it myself. Hoping/assuming that I can, that should give me enough to take next steps.

  8. Former user Account Deleted

    Specifically, that vague error is raised when saving a component with an element with an invalid attribute.

    For instance, I get a helpful error in the Event Log when saving a <div> with no </div>:

    10:23 PM Deployment Failed: FIELD_INTEGRITY_EXCEPTION - 0Ad0a0000005GWC:386,3: ParseError at [row,col]:[387,3] Message: The element type "div" must be terminated by the matching end-tag "".: Source (show balloon)

    Here's the debug log associated with that error:

    2017-12-18 22:23:07,432 [39997838] DEBUG - der.ForceComToolingApiDeployer - Received unexpected response status code 400 != 204. 2017-12-18 22:23:07,432 [39997838] DEBUG - der.ForceComToolingApiDeployer - Response body: [{"message":"0Ad0a0000005GWC:386,3: ParseError at [row,col]:[387,3]\nMessage: The element type \"div\" must be terminated by the matching end-tag \"</div>\".: Source","errorCode":"FIELD_INTEGRITY_EXCEPTION","fields":["Source"]}] 2017-12-18 22:23:07,735 [39998141] DEBUG - .ForceComBuildFailureAnnotator - Found compile failures for CAPIncomeDoc.cmp 2017-12-18 22:23:07,735 [39998141] DEBUG - .ForceComBuildFailureAnnotator - Adding external annotation: Problem type = ERROR Problem message = FIELD_INTEGRITY_EXCEPTION - 0Ad0a0000005GWC:386,3: ParseError at [row,col]:[387,3] Message: The element type "div" must be terminated by the matching end-tag "</div>".: Source Line number = 0 Column number = 0

  9. Scott Wells repo owner

    Got it. I'm able to reproduce it with just a bad attribute. Thanks for helping to corner it. It looks like error reporting from the API for Lightning markup has changed recently. I'll see if I can update to accommodate for the next build.

  10. Scott Wells repo owner

    Okay, I have a fix for it. I'll include it in the next build. Thanks for all the details that helped lead to the problem identification and therefore the fix!

  11. Log in to comment