Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error shape/settings/FieldService.settings FieldService Not available for deploy for this organization #376

Closed
manisfdcsfdx opened this issue Apr 22, 2020 · 12 comments
Labels
area:org owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.

Comments

@manisfdcsfdx
Copy link

Summary

Scratch org creation failed in latest version of CLI

Steps To Reproduce:

use below scratch org definition

{
  "orgName": "manisfdcsfdx",
  "edition": "Enterprise",
  "features": ["Communities", "ServiceCloud", "API", "Sites", "AddCustomApps:30", "AddCustomTabs:30", "ForceComPlatform"],
  
  "settings": {
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    }
  }
      
}

Run below CLI command:
sfdx force:org:create -f config/project-scratch-def.json -s -d 7 -a testcreate

Expected result

Scratch org should be created without any issue

Actual result

scratch org creation failed with below error
Error shape/settings/FieldService.settings FieldService Not available for deploy for this organization

Additional information

image

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.54.4-8ff9ba9cc5
SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
dependencies-cli 2.0.1 (link) C:\Plugin\dependencies-cli
generator 1.1.2 (core)
salesforcedx 48.10.1 (core)
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5 (core)
├─ salesforcedx-templates 48.8.0 (core)
└─ salesforce-alm 48.10.0 (core)

OS and version:
Windows 10

@manisfdcsfdx
Copy link
Author

issue resolved after deleting AppData\Local\Temp\shape\settings in my machine.

@manisfdcsfdx
Copy link
Author

This issue still exist. deleting AppData\Local\Temp\shape\settings is just workaround. i was able to reproduce the issue and find the actual root cause.

Background:
FSL setting and package will not work in enterprise scratch properly issue . As a workaround we use developer edition for project which depends on FSL, other projects are in Enterprise edition.

package_1 (depends on FSL)

{
  "orgName": "manisfdcsfdx",
  "edition": "Developer",
  "features": ["Communities", "ServiceCloud", "API", "Sites", "AddCustomApps:30", "AddCustomTabs:30", "ForceComPlatform","FieldService"],
  "settings": {
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    },
    "fieldServiceSettings": {
       "fieldServiceOrgPref": true
     }
  }
}

create scratch org
sfdx force:org:create -f config/project-scratch-def.json -s -d 7 -a package_1_org

Scratch org will be created.

Package_2

{
  "orgName": "manisfdcsfdx",
  "edition": "Enterprise",
  "features": ["Communities", "ServiceCloud", "API", "Sites", "AddCustomApps:30", "AddCustomTabs:30", "ForceComPlatform"],
  "settings": {
    "communitiesSettings": {
      "enableNetworksEnabled": true
    },
    "lightningExperienceSettings": {
      "enableS1DesktopEnabled": true
    }
  }
}

create scratch org
sfdx force:org:create -f config/project-scratch-def.json -s -d 7 -a package_1_org

cli throws below error
image

Everytime we create a scratch org cli is not deleting Temp\shape folder. As a result shape generated for package_1_org was not cleared. when package_2_org creation is attempted, new shape is added to the existing folder where all the settings exist and causing the problem.

WorkAround:
deleting AppData\Local\Temp\shape\settings\FieldService.settings - Windows
Go to terminal. --> type open $TMPDIR --> Go to Shape --> settings folder-->Delete FieldService.settings - MAC

@clairebianchi
Copy link
Collaborator

@manisfdcsfdx thank you for reporting. @rrmehta2 can you take a look at this issue?

@clairebianchi clairebianchi added the owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. label May 5, 2020
@albertinsyd
Copy link

albertinsyd commented Oct 25, 2020

Hi @clairebianchi and Rohit - I too am having apparently the same problem. Other features enable correctly but not this one.

image

Pure speculation but I'm wondering if the activation is checking for full FSL licence (which we don't have) and hence refusing to activate work orders? All the other features I can enable in the scratch org definition (which is using shape) and after creation I can log in via UI and enable this one. Just not through the definition.

Thanks!!

scratch org def:
{
"orgName": "Salesforce",
"sourceOrg": "-redacted-",
"settings": {
"surveySettings": {
"enableSurvey": true
},
"fieldServiceSettings": {
"enableWorkOrders": true
},
"knowledgeSettings": {
"enableKnowledge": true
},
... etc ...

@jonathanwiesel
Copy link

Same happened to me using OrderManagement feature

@jonathanwiesel
Copy link

Any update on this?

@Vladislav987
Copy link

Hi @jonathanwiesel , @manisfdcsfdx was right. I had a problem with OrderManagement, but I use this setting on another project. And when I deleted the setting from AppData\Local\Temp\shape\settings I stopped getting this error.

@jonathanwiesel
Copy link

Hi @Vladislav987, indeed that's a feasible workaround, I mean if there's an update on the resolution of the real issue, since the CLI shouldn't be trying to use a setting that is not specified in the supplied scratch org definition file

@Caitlyn-Mills
Copy link

Confirming that this issue still exists as I have just encountered it.

@Aravindh04
Copy link

@Caitlyn-Mills Is this occuring in macOS as well?

@Caitlyn-Mills
Copy link

@Aravindh04 Yeah that is where I had the issue

@cristiand391
Copy link
Member

I couldn't repro this on latest sf.
We've rewritten the scratch org create logic in 2022 and currently creates the zip file in memory, I think the previous one was writing it in the tmp dir without cleaning up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:org owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team.
Projects
None yet
Development

No branches or pull requests

9 participants