4

First I was getting this error when tried to import the package from XML using Metadata API (I use force.com CLI for that). The package with this name really exists in the organization, but it normally is not a problem, because the existing package and all it's components just get updated.

Then I tried to retrieve the package using ant migration-tool, and got the same error. As I understand, retrievePkg is not creating anything in the org, so this must be some problem within the org:

$ ant -v retrievePkg
Unable to locate tools.jar. Expected to find it
   in /usr/lib/jvm/java-6-openjdk-amd64/lib/tools.jar
Apache Ant(TM) version 1.8.2 compiled on September 22 2011
Trying the default build file: build.xml
Buildfile: /home/david/mydir/migration-tool/build.xml
Detected Java version: 1.6 in: /usr/lib/jvm/java-6-openjdk-amd64/jre
Detected OS: Linux
parsing buildfile /home/david/mydir/migration-tool/build.xml with URI 
   = file:/home/david/mydir/migration-tool/build.xml
Project base dir set to: /home/david/mydir/migration-tool
parsing buildfile jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml
with URI = jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml
   from a zip file
 [property] Loading /home/david/mydir/migration-tool/build.properties
 [property] Loading Environment env.
Build sequence for target(s) `retrievePkg' is [retrievePkg]
Complete build sequence is [retrievePkg, listMetadata, deployCode, 
    deployCodeFailingTest, retrieveCode, deployCodeCheckOnly, 
    retrieveUnpackaged, bulkRetrieve, describeMetadata, test, 
    deployUnpackaged, undeployCode, deployZip, ]

retrievePkg:
parsing buildfile 
    jar:file:/home/david/.ant/lib/ant-salesforce.jar!/com/salesforce/antlib.xml 
    with URI = jar:file:/home/david/.ant/lib/ant-salesforce.jar!/com/salesforce/antlib.xml
    from a zip file
[sf:retrieve] Request for a retrieve submitted successfully.
[sf:retrieve] Request ID for the current retrieve task: 09Sb0000000YoelEAC
[sf:retrieve] Waiting for server to finish processing the request...
[sf:retrieve] Request Status: Error

BUILD FAILED
/home/david/mydir/migration-tool/build.xml:30:
Failed to process the request successfully. Cause(UNKNOWN_EXCEPTION): null:
More than 1 developer package named 'MyPackage' exists in this
organization.  Please rename one of packages so that it has a unique name.
    at com.salesforce.ant.RetrieveTask.throwExceptionForFailedRequests(RetrieveTask.java:269)
    at com.salesforce.ant.SFDCMDAPIAntTaskRunner.runTask(SFDCMDAPIAntTaskRunner.java:88)
    at com.salesforce.ant.RetrieveTask.execute(RetrieveTask.java:110)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    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:616)
    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:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 4 seconds

In reality I have only one package with this name. Is there a chance that another package with the same name is hidden? Or is it just a bug of Salesforce?

How could I fix this problem?

2

This part of your error messages to me suggests some kind of platform bug or corruption in your Packaging org, for which i would strongly recommend you contact Salesforce Support on before trying anything else. As you say its quite odd that this occurs on read as well.

Failed to process the request successfully. Cause(UNKNOWN_EXCEPTION): null:

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.