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

org create command returns different results in json depending on command syntax #2131

Closed
Brian-Triplett opened this issue May 11, 2023 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue

Comments

@Brian-Triplett
Copy link

Brian-Triplett commented May 11, 2023

Summary

When you run sfdx org create scratch <other args> --json the orgId field returned in the results json output was previously the created scratch org’s id (00D....). However, the "orgId" node recently changed to be the scratch org record id 2SR*****. Interestingly using the same sfdx cli version, if I run sfdx force:org:create the orgId returned in the results json output is the actual org Id 00D*****. It seems like something with the new command format vs. old so maybe a bug?

Steps To Reproduce:

  1. Run sfdx org create scratch --json command and examine result json
  2. Run sfdx force:org:create and compare the ordId result

Expected result

Expected the ordId field to remain the scratch org Id (00D...)

Actual result

ScratchOrg record in DevHub is returned (2SR....).

System Information

sfdx force:org:create -f config/project-scratch-def.json -d 1 --json
{
  "status": 0,
  "result": {
    "username": "[email protected]",
    "scratchOrgInfo": {
      "attributes": {
        "type": "ScratchOrgInfo",
        "url": "/services/data/v57.0/sobjects/ScratchOrgInfo/2SR3n000000HRduGAG"
      },
      "Id": "2SR3n000000HRduGAG",
      "OwnerId": "005a000000AGU0pAAH",
      "IsDeleted": false,
      "Name": "00371243",
      "CurrencyIsoCode": "USD",
      "CreatedDate": "2023-05-09T18:37:58.000+0000",
      "CreatedById": "005a000000AGU0pAAH",
      "LastModifiedDate": "2023-05-09T18:38:30.000+0000",
      "LastModifiedById": "00530000005lmrRAAQ",
      "SystemModstamp": "2023-05-09T18:38:30.000+0000",
      "LastViewedDate": "2023-05-09T18:37:58.000+0000",
      "LastReferencedDate": "2023-05-09T18:37:58.000+0000",
      "Edition": "Partner Developer",
      "Username": null,
      "AdminEmail": null,
      "OrgName": "force-nPORTAL",
      "DurationDays": 1,
      "ConnectedAppConsumerKey": "PlatformCLI",
      "ConnectedAppCallbackUrl": "http://localhost:1717/OauthRedirect",
      "Namespace": "nPORTAL",
      "Features": "API;AuthorApex;Communities;DebugApex;PlatformEncryption",
      "Snapshot": null,
      "Country": "US",
      "Language": "en_US",
      "Instance": null,
      "Package2AncestorIds": null,
      "SourceOrg": null,
      "HasSampleData": true,
      "Release": "Current",
      "SignupUsername": "[email protected]",
      "Status": "Active",
      "ErrorCode": null,
      "ScratchOrg": "00D8G0000006s7k",
      "SignupInstance": "CS219",
      "AuthCode": "*****",
      "SignupCountry": "US",
      "SignupLanguage": "en_US",
      "SignupEmail": "******",
      "SignupTrialDays": 1,
      "LoginUrl": "https://platform-force-7271-dev-ed.scratch.my.salesforce.com/",
      "Description": "force-nPORTAL",
      "ExpirationDate": "2023-05-10",
      "LastLoginDate": null,
      "DeletedBy": null,
      "DeletedDate": null
    },
    "authFields": {
      "accessToken": "*****",
      "instanceUrl": "https://platform-force-7271-dev-ed.scratch.my.salesforce.com",
      "orgId": "00D8G0000006s7kUAA",
      "username": "[email protected]",
      "loginUrl": "https://CS219.salesforce.com",
      "refreshToken": "*****",
      "clientId": "PlatformCLI",
      "isDevHub": false,
      "devHubUsername": "[email protected]",
      "created": "1683657478000",
      "expirationDate": "2023-05-10",
      "createdOrgInstance": "CS219",
      "snapshot": null,
      "instanceApiVersion": "57.0",
      "instanceApiVersionLastRetrieved": "5/9/2023, 2:38:32 PM",
      "tracksSource": true
    },
    "warnings": [],
    "orgId": "00D8G0000006s7kUAA"
  },
  "warnings": []
}


#################################################


sfdx org create scratch -f config/project-scratch-def.json --json
{
  "status": 0,
  "result": {
    "username": "[email protected]",
    "scratchOrgInfo": {
      "attributes": {
        "type": "ScratchOrgInfo",
        "url": "/services/data/v57.0/sobjects/ScratchOrgInfo/2SR3n000000HRe9GAG"
      },
      "Id": "2SR3n000000HRe9GAG",
      "OwnerId": "005a000000AGU0pAAH",
      "IsDeleted": false,
      "Name": "00371246",
      "CurrencyIsoCode": "USD",
      "CreatedDate": "2023-05-09T18:40:31.000+0000",
      "CreatedById": "005a000000AGU0pAAH",
      "LastModifiedDate": "2023-05-09T18:44:46.000+0000",
      "LastModifiedById": "00530000005lmrRAAQ",
      "SystemModstamp": "2023-05-09T18:44:46.000+0000",
      "LastViewedDate": "2023-05-09T18:44:46.000+0000",
      "LastReferencedDate": "2023-05-09T18:44:46.000+0000",
      "Edition": "Partner Developer",
      "Username": null,
      "AdminEmail": null,
      "OrgName": "force-nPORTAL",
      "DurationDays": 7,
      "ConnectedAppConsumerKey": "PlatformCLI",
      "ConnectedAppCallbackUrl": "http://localhost:1717/OauthRedirect",
      "Namespace": "nPORTAL",
      "Features": "API;AuthorApex;Communities;DebugApex;PlatformEncryption",
      "Snapshot": null,
      "Country": "US",
      "Language": "en_US",
      "Instance": null,
      "Package2AncestorIds": null,
      "SourceOrg": null,
      "HasSampleData": true,
      "Release": "Current",
      "SignupUsername": "******",
      "Status": "Active",
      "ErrorCode": null,
      "ScratchOrg": "00D52000000ZsvS",
      "SignupInstance": "CS170",
      "AuthCode": "*****",
      "SignupCountry": "US",
      "SignupLanguage": "en_US",
      "SignupEmail": "********",
      "SignupTrialDays": 7,
      "LoginUrl": "https://strawberry-sagittarius-2235-dev-ed.scratch.my.salesforce.com/",
      "Description": "force-nPORTAL",
      "ExpirationDate": "2023-05-16",
      "LastLoginDate": null,
      "DeletedBy": null,
      "DeletedDate": null
    },
    "authFields": {
      "accessToken": "****",
      "instanceUrl": "https://strawberry-sagittarius-2235-dev-ed.scratch.my.salesforce.com",
      "orgId": "00D52000000ZsvSEAS",
      "username": "****",
      "loginUrl": "https://CS170.salesforce.com",
      "refreshToken": "******",
      "clientId": "PlatformCLI",
      "isDevHub": false,
      "devHubUsername": "[email protected]",
      "created": "1683657631000",
      "expirationDate": "2023-05-16",
      "createdOrgInstance": "CS170",
      "snapshot": null,
      "instanceApiVersion": "57.0",
      "instanceApiVersionLastRetrieved": "5/9/2023, 2:44:48 PM",
      "tracksSource": true
    },
    "warnings": [],
    "orgId": "2SR3n000000HRe9GAG"
  },
  "warnings": []
}
@Brian-Triplett Brian-Triplett added the investigating We're actively investigating this issue label May 11, 2023
@github-actions
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@Kevmo92
Copy link

Kevmo92 commented May 11, 2023

It's odd the field orgId would not have the actual org id but the org record id instead. Seems like a goof.

@mshanemc mshanemc added the bug Issue or pull request that identifies or fixes a bug label May 11, 2023
@mshanemc
Copy link
Contributor

yep, that's a bug!

@git2gus
Copy link

git2gus bot commented May 11, 2023

This issue has been linked to a new work item: W-13191817

@mshanemc
Copy link
Contributor

fix is now live in all the current releases, thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug investigating We're actively investigating this issue
Projects
None yet
Development

No branches or pull requests

3 participants