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
Inderjit Singh WaraichInderjit Singh Waraich 

SFDX force:org:create issue in Jenkins

I am getting below error, i am trying to follow Continuous Integration section of SFDX developer's guide. Any help will be appreciated.
 
[SFDX] Running batch script
{"message":"Setting variables must be in the format <key>=<value> or <key>=\"<value with spaces>\" but found Files.","status":1,"stack":"InvalidArgsFormat: Setting variables must be in the format <key>=<value> or <key>=\"<value with spaces>\" but found Files.\n    at ALMError (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\almError.js:35:19)\n    at context.args.forEach.arg (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\varargsCommand.js:38:31)\n    at Array.forEach (<anonymous>)\n    at OrgCreateCommand.<anonymous> (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\varargsCommand.js:35:30)\n    at Generator.next (<anonymous>)\n    at C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\varargsCommand.js:13:71\n    at Promise (<anonymous>)\n    at __awaiter (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\varargsCommand.js:9:12)\n    at OrgCreateCommand.validate (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\varargsCommand.js:27:16)\n    at OrgCreateCommand.<anonymous> (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\scratchOrgCreateCommand.js:110:38)\n    at Generator.next (<anonymous>)\n    at C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\scratchOrgCreateCommand.js:13:71\n    at Promise (<anonymous>)\n    at __awaiter (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\scratchOrgCreateCommand.js:9:12)\n    at OrgCreateCommand.validate (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\lib\\scratchOrgCreateCommand.js:108:16)\n    at aggregator.initialize.then (C:\\Windows\\System32\\config\\systemprofile\\AppData\\Local\\sfdx\\client\\node_modules\\salesforce-alm\\dist\\index.js:367:28)","name":"InvalidArgsFormat","warnings":[]}

C:\Program Files (x86)\Jenkins\workspace\SFDX>"C:\Program Files\sfdx\bin\sfdx" force:org:create -f C:\Program Files (x86)\Jenkins\workspace\SFDX/config/project-scratch-def.json --json --setdefaultusername

 
Gopi krishna Aavula 2Gopi krishna Aavula 2
I faced this issue while creating a scratch org....and the issue in my script is  sfdx force:org:create -s -f config/project-scratch-def.json -a "default scratch org".....I gave a space and a(like - a instead of -a)...

You can try different script instead of of json like this (sfdx force:org:create -a MyDevOrg -s -v YOURUSERNAME edition=Developer)...it works like a charm...
Richard E. MooreRichard E. Moore
We ran into a similar issue that was due to the parent folder having spaces in its name.
Error:  
Setting variables must be in the format <key>=<value> or <key>="<value with spaces>" but found 2/salesforce/config/modifiedScratchDef.json.

Parent folder for the repo was "my-project 2". Changing the folder name to remove the space resolved the issue.