15

Question

Doing a deployment with ANT that includes some apex and a custom object. However, when I test deploy I'm getting errors about fields not being in the package.xml. Has something changed with the package.xml validation?

Error Message (snippet)

[sf:deploy] 1.  objects/MyObject__c.object (MyObject__c.MyField__c) -- Error: Not in package.xml

Package XML (snippet)

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>MyObject__c</members>
        <name>CustomObject</name>
    </types>
    <version>29.0</version>
</Package>

Additional Details

A full-ish redacted package.xml, custom object, and deployment log are available in this gist.

The deployment included several apex classes, triggers, and custom objects. Strangely thought if you look at the deployment log the error happens in the "Processing Custom Objects" phase.

In any event, deploying just the custom object succeeds. But for the sake of the next guy hopefully we can get some clarity on why this would happen.

Possible Cause - Case Sensitive package.xml validation?

Ran into this a second time with just a single field deployment. Field was retrieved successfully, but on deployed returned the same error. Correcting the package.xml to match the exact case of the field name led to a successful deployment. Upon re-inspection of the initial deployment I noticed that the my package.xml wasn't using the same case as the actual object API name.

  • Does the Profile of "ANT integration user" have rights to see the said field? – eyescream Dec 12 '13 at 21:28
  • The object doesn't exist yet, migrating it from a sandbox to production. Profile is system administrator. – Ralph Callaway Dec 12 '13 at 22:09
  • 2
    SF is poor at detecting circular dependencies (new object -> new class that relies on it + new page -> this page becomes an override for say "New" action -> object definition goes bananas)... You might have to cut the deployment into chunks and do sth manually. In my example I'd comment out most of the body of VF page, leaving only standardController bit... Another idea is to force add "CustomField" section and see what happens? salesforce.com/us/developer/docs/api_meta/Content/… – eyescream Dec 12 '13 at 22:17
  • Deploying just the custom object works. I updated the question with the full deployment log, package.xml, and custom object. Strangely the deployment fails at the processing custom objects phase ... – Ralph Callaway Dec 12 '13 at 22:22
  • And while I can't see how a brand new class would fall into any of the usual circular dependency loops, it seems like the solution is the same, break the deployment into smaller groups. Classic, don't figure out the bug, just work around it. – Ralph Callaway Dec 12 '13 at 22:23
16

It appears that the deploy package to package.xml validation is case sensitive. If you get a is not in package.xml, double check the case of the object or field in your package.xml.

The tricky part about this is that ant retrieve will work just fine, the validation only occurs when doing ant deploy or ant test

  • was going through the unanswered questions and this one came up. May you accept your own answer? – James Loghry Dec 27 '13 at 19:47
  • Yes, it is okay to accept your own amswer. – realfire Apr 12 '18 at 16:52
0

Package.xml is Case Sensitive. See the subtle difference that cause the error and it took a while to identify.

Error: 1. objects/Sales_Target__c.object (Sales_Target__c.Acknowledgement_Status__c) -- Error: Not in package.xml

retrieveUnpackaged directory contained MetaData Name: Sales_Target__c.Acknowledgement_Status__c

package.xml earlier content sales_target__c.acknowledgement_status__c

package.xml changed to & worked Sales_Target__c.Acknowledgement_Status__c

0

In our case we had space(s) at the end of the field, which was resulting in this error.

<members>Building__c.Available_Days__c   </members>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.