1

I've created over 40 scratch orgs with the following config, without issues.

{
    "orgName": "MyScratchOrg",
    "edition": "Developer",
    "features": ["Communities","PersonAccounts","SiteDotCom","ContactsToMultipleAccounts"],
    "orgPreferences" : {
        "enabled": ["S1DesktopEnabled","NetworksEnabled"]
    }
}

Today I tried to spin up a new one (actually two, one after the other), everything went well, but the deployment failed when deploying the community/network/site stuff with the following message:

Apex class 'SiteLoginController' does not exist

This is a class that should be automatically created once you enable communities right?

So far I've only found this

Salesforce CLI Sometimes Doesn’t Recognize Scratch Orgs with Communities Description: Sometimes, but not in all cases, the Salesforce CLI doesn’t acknowledge the creation of scratch orgs with the Communities feature. You can’t open the scratch org using the CLI, even though the scratch org is listed in Dev Hub. Workaround: You can try this workaround, although it doesn’t fix the issue in all cases. Delete the scratch org in Dev Hub, then create a new scratch org using the CLI. Deleting and recreating scratch orgs counts against your daily scratch org limits.

Error Occurs If You Pull a Community and Deploy It Description: The error occurs because the scratch org doesn’t have the required guest license. Workaround: In your scratch org definition file, if you specify the Communities feature, also specify the Sites feature.

In my case, I've got enough licenses, I've specified both Communities and Sites, and I can actually login to the scratch org, therefore this limitation is probably not the culprit...

Anyone else experienced this? What else could be the issue?

Update: I was able to create a third scratch org today, this time without issues. I'd still like to get to the bottom of this and find out what causes this intermittent issue...

Another Update I tried to run 2 bitbucket pipelines in parallel which create scratch orgs (to test the theory of possible issue with parallel creation/deployment), however this time around one succeeded, whereas the second threw yet another new error:

'ENOTFOUND': getaddrinfo ENOTFOUND

Which I guess might be related to the subdomain not yet propagated through the DNS servers... In any case, I'll be opening a case with support...

  • when did it start failing? did you create the 40 scratch orgs today? – glls Mar 18 at 3:43
  • 1
    i usually deply the 'Sites' feature for communities as the workaround mentions, however, i still have to push my controllers, site configs and so on for the community to be created after creating the scratch org – glls Mar 18 at 3:54
  • 1
    ¯_(ツ)_/¯ probably worth opening a case with sf (if you have time) – glls Mar 18 at 5:23
  • 1
    I've encountered unrelated, but similar, issues with inconsistent scratch org creation. Never found a good solution. – David Reed Mar 18 at 11:24
  • 1
    Given we're also installing FSC package on top, this takes ~15 minutes. It's just nuts to re-iterate until you get one that works... Might as well go back to using sandboxes... – Boris Bachovski Mar 18 at 22:40
1

It's been a while and this hasn't occurred again after hundreds of scratch orgs created in the meantime. I guess it was a bug that got fixed behind the scenes by SFDC.

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.