SalesforceCommerceCloud / b2c-crm-sync

... a contemporary perspective on how to integrate B2C Commerce and the Salesforce Customer 360 Platform to power frictionless customer experiences in the B2C domain.
https://salesforcecommercecloud.github.io/b2c-crm-sync/
BSD 3-Clause "New" or "Revised" License
65 stars 46 forks source link

Error with deployment "The org cannot be found" (npm run crm-sync:sf:org:deploy) #166

Closed VALiNTRY360 closed 2 years ago

VALiNTRY360 commented 2 years ago

Describe the bug When attempting to run npm run crm-sync:sf:org:deploy, we are receiving error that the org cannot be found.

To Reproduce npm run crm-sync:sf:org:deploy sfdx force:source:deploy -p "src/sfdc/base"

Expected behavior Solution should be deployed to sandbox (non-scratch) org.

Screenshots

Your local environment details:

Screen Shot 2022-05-09 at 2 48 25 PM
VALiNTRY360 commented 2 years ago

Error message:

{ "stack": "Domain Not Found: The org cannot be found\n at Connection.isResolvable (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/connection.js:280:19)\n at async Connection.retrieveMaxApiVersion (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/connection.js:241:9)\n at async Connection.useLatestApiVersion (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/connection.js:252:32)\n at async useLatest (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/connection.js:423:13)\n at async Connection.loadInstanceApiVersion (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/connection.js:438:17)\n at async Function.create (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/connection.js:89:39)\n at async Org.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/org.js:485:31)\n at async Function.create (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/kit/lib/creatable.js:31:9)\n at async UserDisplayCommand.assignHubOrg (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:130:27)\n at async UserDisplayCommand.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:235:13)\n at async UserDisplayCommand._run (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:80:13)\nOuter stack:\n at Function.wrap (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/sfdxError.js:171:27)\n at UserDisplayCommand.assignHubOrg (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:146:40)\n at async UserDisplayCommand.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:235:13)\n at async UserDisplayCommand._run (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:80:13)", "message": "The org cannot be found", "name": "Domain Not Found", "exitCode": 1, "_code": "Domain Not Found", "commandName": "UserDisplayCommand", "code": "Error" }

VALiNTRY360 commented 2 years ago

Successfully deployed sfdx force:source:deploy -p src/sfdc/base but still not able to run the npm run crm-sync:sf:org:deploy command.

sfdx force:source:deploy -p src/sfdc/base Deploying v54.0 metadata with SOAP API v53.0 connection Deploy ID: 0Af8I000000wrgGSAQ DEPLOY PROGRESS | ████████████████████████████████████████ | 569/569 Components

VALiNTRY360 commented 2 years ago
Screen Shot 2022-05-09 at 4 47 50 PM Screen Shot 2022-05-09 at 5 09 00 PM

My .env file contains the (U) domain and user credentials.

VALiNTRY360 commented 2 years ago

Update: able to remove the (D) org by using the cd ~/.sfdx command on the home terminal

New error message is related to an old dev hub:

[ { "stack": "NamedOrgNotFound: No authorization information found for devhub username luigi@xxxxxxxx.com.staging.\n at Function.create (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/sfdxError.js:160:16)\n at AuthInfo.loadAuthFromConfig (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/authInfo.js:668:49)\n at async AuthInfo.initAuthOptions (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/authInfo.js:642:26)\n at async AuthInfo.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/authInfo.js:571:13)\n at async Function.create (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/kit/lib/creatable.js:31:9)\n at async Org.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/org.js:509:27)\n at async Function.create (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/kit/lib/creatable.js:31:9)\n at async UserDisplayCommand.assignHubOrg (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:130:27)\n at async UserDisplayCommand.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:235:13)\n at async UserDisplayCommand._run (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:80:13)\nOuter stack:\n at Function.wrap (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/core/lib/sfdxError.js:171:27)\n at UserDisplayCommand.assignHubOrg (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:146:40)\n at async UserDisplayCommand.init (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:235:13)\n at async UserDisplayCommand._run (/Users/luigifrascarelli/b2c-crm-sync/node_modules/@salesforce/command/lib/sfdxCommand.js:80:13)", "message": "No authorization information found for devhub username luigi@xxxxxxxxxx.com.staging.", "name": "NamedOrgNotFound", "exitCode": 1, "_code": "NamedOrgNotFound", "commandName": "UserDisplayCommand", "code": "Error" } ]

VALiNTRY360 commented 2 years ago

Resolved by reseting the default devhub to new username using setdefaultdevhubusername