8

When I try to install the appexchange app "Salesforce Community Management Package for Communities with Chatter" into a scratch org, I receive the error "We've encountered an intermittent problem. Please click back on your browser and try again. If you continue to encounter the problem, please log a case in your Salesforce org to help us solve the issue."

Is this supported functionality? Or maybe I'm doing something wrong? Here are my specific steps:

  1. Navigate to the appexchange app at https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5XHsEAN
  2. Click the "Get It Now" button.
  3. Choose "Log in to the AppExchange - Use your Salesforce credentials".
  4. Click the "Log In with a Different Username" link.
  5. Click the "Use Custom Domain" link.
  6. Enter the domain of my scratch org (without the leading https://) and click the "Continue" button.
  7. Receive error.

If it matters, I am using a Dev Hub trial org. I tried this with another (randomly-chosen) appexchange app (https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5P9CEAV) and received the same error.

Possibly helpful - the URL of the error page contains the following: ...salesforce.com/genericerror?ErrorCode=No_Oauth_Token&ErrorDescription=invalid_grant+authentication+failure&ProviderId=0SO30000000TN4O...

I guess there's an auth issue at play?

Thanks.

2
  • 2
    You could try the initial steps of installing the package in another org and stop when you get to the URL that looks like /packaging/installPackage.apexp?p0=04t400000000001. Then login to your scratch org and use that URL to install the package. Sep 5, 2017 at 19:04
  • 1
    Thanks, Daniel. Similar to what I figured out. Taking this one step further to using the sfdx force:package:install command is nice because it can be scripted. Sep 5, 2017 at 19:54

3 Answers 3

8

Figured it out. You cannot use the sfdx force:package:install command using the ID of the appexchange app. The ID that is needed is eventually displayed in the URL during an interactive install of the app into a non-scratch org (at the step where you are asked to select which users should be granted access to the app). For example, the URL for the "Salesforce Community Management Package for Communities with Chatter":

The package ID needed is the value of the apvId parameter (04to00000007jkAAAQ). Feed this into the sfdx command like so:

  • sfdx force:package:install --id 04to00000007jkAAAQ -w 1000

More details about obtaining the package ID:

3
  • Very similar to this: salesforce.stackexchange.com/questions/185840/…
    – pchittum
    Sep 6, 2017 at 6:14
  • I tried to install the exact same package and I am met with this error. Encountered errors installing the package!,Installation errors: 1) Missing Organization Feature: Networks 2) Missing Organization Feature: NetworksEnabledOnce
    – abhi
    Sep 8, 2017 at 21:09
  • My bad, I suspect I have to enable communities in the scratchorg.
    – abhi
    Sep 8, 2017 at 21:13
4

Just in case to help anyone in the future, you also can obtain the package version ID installed in any org with:

sfdx force:package:installed:list -u <alias|username>

The output for a Nonprofit Success pack as example:

ID                  Package ID          Package Name                    Namespace      Package Version ID  Version Name               Version
──────────────────  ──────────────────  ──────────────────────────────  ─────────────  ──────────────────  ─────────────────────────  ──────────
0A32E000000rQnwSAE  033i0000000Gi57AAC  Nonprofit Success Pack          npsp           04t1Y000000ggZ2QAI  Cumulus                    3.170.0.19

So you can install it with:

sfdx force:package:install -p 04t1Y000000ggZ2QAI -u <scratchOrg> -w 1000

In case you need to install more than one, just add the -r parameter for no prompt, and add && to concat commands.

sfdx force:package:install -p 04t1Y000000ggZ2QAI -u <scratchOrg> -w 1000 - r &&
sfdx force:package:install -p 04t1Y000000ggZ2QAI -u <scratchOrg> -w 1000
1
  • Note that this is different to sfdx force:package:list, which is a valid command but will fail if you don't have packaging enabled in the org you're targeting. Oct 7, 2020 at 20:51
0

This article was helpful: https://success.salesforce.com/answers?id=9063A000000kpuqQAA Login with your production salesforce login

From your sandbox, click on AppExchange -> Get It Now -> Login with your production credentials (counter-intuitive, but this is what you need to do) Select Sandbox Environment Login with your sandbox credentials.

1
  • 1
    Note for other people seeing this in the review queues: This does appear to contain the important bits from the link. I'm not entirely sure if the same procedure applies to scratch orgs, but yeah, don't blindly click recommend delete because of non-spam link.
    – Derek F
    Mar 22, 2019 at 22:58

You must log in to answer this question.

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