I've been unable to create a package due to this following error: : An unexpected error occurred. Please include this ErrorId if you contact support: 1290395039-462760 (-600457350)

This occurs when trying to create a package version containing a connected app. It works when creating the package version without validation and installing it, but when trying to create it with validation it fails.

This is what my ConnectedApp metadata looks like

<?xml version="1.0" encoding="UTF-8"?>
<ConnectedApp xmlns="http://soap.sforce.com/2006/04/metadata">
    <label>Connected App Name</label>

Any ideas?

1 Answer 1


Connected Apps are not really compatible with 2GPs since under the hood they are tightly bound to 1GP tech stack. This is something Salesforce has discussed in various forums including in a 2GP Ask Me Anything session (back in April 2021). The following comes from the transcript of the outout:

Q: Why is including connected app metadata in managed 2GPs so complicated?

A: When connected apps were first built, they were tightly coupled to the underlying technology that powers firstgeneration managed packaging. As one of the most-installed metadata component types, it was critical that the packaging of connected apps in 2GP remain as rock-solid as it is in 1GP while 2GP itself matured. Due to 1GPs tight coupling with the system that powers connected apps, it made the most sense to continue leveraging the 1GP mechanisms. The good news is that the team responsible for connected apps is thinking of how to bring this functionality natively into the 2GP world. No information on timelines or roadmap at this time, but rest assured it's on our radar.

So that said, in my experience there's no need to package the Connected App in general cases. Take a look at this Q&A.

  • 1
    I like the idea of side-stepping packaging. However, in our case (I work with Alex) we are using the connected app to store a certificate for a JWT flow so it needs to be installed in the customer org for JWT Bearer flow to work. Commented Jan 21, 2022 at 15:57
  • Well, the Q said "Why... so complicated" so that suggests it may be doable. Reach out to Vivek Chawla (Salesforce) through the Partner Forums.
    – Phil W
    Commented Jan 21, 2022 at 16:11
  • 1
    Yes, we have done it successfully but it will intermittently stop working and then we can't release new versions of the package. Or we will see weird behavior like beta packages can be created and installed successfully but non-beta will fail package creation. Thanks for the contact! Will reach out to Vivek. Commented Jan 21, 2022 at 17:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .