For some time now (several years) I've been deploying changes to Apex classes using the Metadata API deploy web method with an associated zip file containing the metadata and package.xml file.
This morning when I tried to deploy to na87 on Spring 19 with patch 11.5 it failed with the message:
- : package.xml (classes/package.xml) (line:0 column:0)
No package.xml found
I double checked the zip file I was sending in. It had the structure:
- classes/TheApexClassToDeploy.cls
- classes/TheApexClassToDeploy.cls-meta.xml
- package.xml
The package.xml had:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>TheApexClassToDeploy</members>
<name>ApexClass</name>
</types>
<version>45.0</version>
</Package>
It isn't clear to me why this package format isn't correct anymore. Did I miss something in the release notes?
Based on the error message I took a punt and created this package.xml file in the classes folder:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<version>45.0</version>
</Package>
Which seemed to allow the deploy to proceed.
I'll go down the path of raising a support case for this, but I'd be interested to know if I've missed a documented change to the Metadata API format.
Verification in Workbench migration/deploy using v45.0:
If I change the root level package.xml from:
<version>45.0</version>
to:
<version>44.0</version>
The deploy works against the v45.0 Metadata API endpoint.
As suggested by Pranay I did a retrieve via Workbench using v45.0 with the package.xml file and "Single Package" checked.
It doesn't appear to have the additional package.xml file.
I then did a Metadata deploy with the resulting zip file. It failed in the same way as it did above. I then tired again, but checked "Single Package"... and it deployed.
Maybe they are enforcing something new around the singlePackage
setting?
standalone="true"
, in package.xml ?<?xml version="1.0" encoding="utf-8" standalone="yes"?>
. I'm not sure I ended up with=true
in my example.package.xml
in retrevie command and see whats the file structure of retreived zip ?