1

I'm trying to configure deploying my sfdc metadata using JenkinsCI but in case I see next error:

deployCodeCheckOnly:
parsing buildfile jar:file:/usr/share/ant/lib/ant-salesforce.jar!/com/salesforce/antlib.xml with URI = jar:file:/usr/share/ant/lib/ant-salesforce.jar!/com/salesforce/antlib.xml from a zip file
[sf:deploy] Note: use ant -verbose to get more information on the failure

BUILD FAILED
/var/lib/jenkins/workspace/HWKS - Aorta - DEV1 Build After Push To Master/build.xml:37: Failed to login: Failed to parse detail:  START_TAG seen ...</sf:exceptionMessage><sf:upgradeURL>... @1:752 due to: com.sforce.ws.ConnectionException: unable to find end tag at:  START_TAG seen ...</sf:exceptionMessage><sf:upgradeURL>... @1:752
    at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:227)
    at com.salesforce.ant.SFDCAntTask.getMetadataConnection(SFDCAntTask.java:257)
    at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:20)
    at com.salesforce.ant.DeployTask.execute(DeployTask.java:76)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:435)
    at org.apache.tools.ant.Target.performTasks(Target.java:456)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    at org.apache.tools.ant.Main.runBuild(Main.java:851)
    at org.apache.tools.ant.Main.startAnt(Main.java:235)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: com.sforce.ws.ConnectionException: Failed to parse detail:  START_TAG seen ...</sf:exceptionMessage><sf:upgradeURL>... @1:752 due to: com.sforce.ws.ConnectionException: unable to find end tag at:  START_TAG seen ...</sf:exceptionMessage><sf:upgradeURL>... @1:752
    at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:238)
    at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:204)
    at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:150)
    at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
    at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:1433)
    at com.salesforce.ant.SFDCAntTask.doLogin(SFDCAntTask.java:221)
0

We were also getting similar issue, its was due to forceful enforcement of TLS 1.1 and 1.2 in new orgs.

As per Salesforce documentation:

For enhanced security, we recommend Java 7 or later and a recent version of the Force.com Migration Tool (version 36.0 or later). Starting with version 36.0, the Force.com Migration Tool uses TLS 1.2 for secure communications with Salesforce if it detects Java version 7 (1.7). The tool explicitly enables TLS 1.1 and 1.2 for Java 7. If you’re using Java 8 (1.8), TLS 1.2 is used. For Java version 6, TLS 1.0 is used. However, Salesforce plans to discontinue TLS 1.0 support on this timeline.

Alternatively, if you’re using Java 7, instead of upgrading your Force.com Migration Tool to version 36.0 or later, you can add the following to your ANT_OPTS environment variable:

-Dhttps.protocols=TLSv1.1,TLSv1.2

This setting also enforces TLS 1.1 and 1.2 for any other Ant tools on your local system.

You can deactivate TLS security update in Salesforce ->Setup ->Critical Updates to confirm if this is causing issue.

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.