function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jeremiah SherrillJeremiah Sherrill 

Migrating metadata from one org to a sandbox, sfdx force gives me an error when using sfdx force:org:create

The error I am getting is  ERROR:  No such column 'PackageDirectories' on sobject of type ScratchOrgInfo.    

sfdx force:org:create -f  sfdx-project.json -a myorgthing

json file

{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "42.0"
}
 

folder structure is 
 

--force-app
  -- main
    -- default
      -- applications
      -- classes
      -- et.all.
 

 

Best Answer chosen by Jeremiah Sherrill
jigarshahjigarshah
Jeremiah,

The issue is that the PackageDirectories field on the ScratchOrgInfo Sobject is missing and probably the code components you intend to deploy to the target are referencing the PackageDirectories field. This results in the issue.

Solution here would be to include the ScratchOrgInfo sobject containing the PackageDirectories field within your deployment and I believe that means including the objects folder within your folder structure from the second snapshot.

All Answers

jigarshahjigarshah
Jeremiah,

The issue is that the PackageDirectories field on the ScratchOrgInfo Sobject is missing and probably the code components you intend to deploy to the target are referencing the PackageDirectories field. This results in the issue.

Solution here would be to include the ScratchOrgInfo sobject containing the PackageDirectories field within your deployment and I believe that means including the objects folder within your folder structure from the second snapshot.
This was selected as the best answer
Jeremiah SherrillJeremiah Sherrill
I will look into that, but I understand only about 30% of what you just wrote
jigarshahjigarshah
Basically the components that you are trying to deploy need a PackageDirectories field on the ScratchOrg object, for it to be deployed. Hence include that as a part of your components that you are attempting to move from one Salesforce org to another to address the dependency. Regards, Jigar Shah
jigarshahjigarshah
Jeremiah, were you able to resolve your issue?
Jeremiah SherrillJeremiah Sherrill
I was able to resolve this problem, thanks