We have a Jenkins build that creates scratch orgs using this project-scratch-def.json:

    "orgName": "Xyz",
    "edition": "Developer",
    "features": ["Communities", "Sites"],
    "settings": {
        "apexSettings": {
            "enableCompileOnDeploy": true
        "communitiesSettings": {
            "enableNetworksEnabled": true,
            "enableOotbProfExtUserOpsEnable": true

and seemingly randomly but quite often the code push into the created scratch org fails with:

where Id in (select ParentId from NetworkMemberGroup where NetworkId

ERROR at Row:4:Column:51
sObject type 'NetworkMemberGroup' is not supported. If you are attempting to use
a custom object, be sure to append the '__c' after the entity name. Please
reference your WSDL or the describe call for the appropriate names. (1222:41)

where NetworkMemberGroup is an SObject type related to Experiences/Communities.

Any suggestions on how to fix this?


Related to akarnid's comment, anyone know the easiest way with sfdx of reading back from the org to check a setting such as enableNetworksEnabled?

  • 2
    Seen this problem lots of times in the years I've used SFDX. Sometimes it just fails to activate a platform feature for the scratch org for no good or visible reason and then you see that error. Only way I've eve known to fix it just to run the same command again and (usually) then it works. Sorry I don't have any concrete answers or a solution to this.
    – akarnid
    Apr 16, 2021 at 10:02
  • Thanks @akarnid. Perhaps I will have to resort to retrying: something like reading back the setting when the org create has completed so that the retry happens in the first few minutes (of a 45 minute build as several products are installed). Not sure that sfdx helps do that too directly; could just run the potentially failing query.
    – Keith C
    Apr 16, 2021 at 10:56
  • Is it worth trying to query Status of Network? Apr 16, 2021 at 12:47
  • Hi @JefersonChaves, Yeah though I suspect that object isn't there until communities enabled so the check would be error/no error. Was hoping for a cool sfdx one liner...
    – Keith C
    Apr 16, 2021 at 13:20
  • I see, the other alternative might be to check orgPreferenceSettings for NetworksEnabled. This might be more in line with your question at the end. Apr 16, 2021 at 21:55


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.