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

sfdx force:org:shape:list command not working #1739

Closed
pranitjain1 opened this issue Sep 29, 2022 · 5 comments
Closed

sfdx force:org:shape:list command not working #1739

pranitjain1 opened this issue Sep 29, 2022 · 5 comments

Comments

@pranitjain1
Copy link

Summary

When trying to run sfdx force:org:shape:list command in VS Code running into error.
ERROR running force:org:shape:list: Cannot read properties of undefined (reading 'length')

Steps To Reproduce:

  1. Connect to DevHub
  2. Run sfdx force:org:shape:list command in VS Code

Expected result

Get the list of Org Shape

Actual result

Getting error while running shape:list command
ERROR running force:org:shape:list: Cannot read properties of undefined (reading 'length')

Additional information

logfile.log

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.169.1 darwin-x64 node-v16.17.0

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core):
@oclif/plugin-autocomplete 1.3.0 (core)
@oclif/plugin-commands 2.2.0 (core)
@oclif/plugin-help 5.1.12 (core)
@oclif/plugin-not-found 2.3.1 (core)
@oclif/plugin-plugins 2.1.0 (core)
@oclif/plugin-update 3.0.0 (core)
@oclif/plugin-version 1.1.2 (core)
@oclif/plugin-warn-if-update-available 2.0.4 (core)
@oclif/plugin-which 2.1.0 (core)
@salesforce/sfdx-plugin-lwc-test 1.0.1 (core)
alias 2.1.0 (core)
apex 1.2.0 (core)
auth 2.2.5 (core)
community 2.0.1 (core)
config 1.4.19 (core)
custom-metadata 2.0.0 (core)
data 2.1.2 (core)
generator 2.0.2 (core)
info 2.1.0 (core)
limits 2.0.1 (core)
org 2.2.3 (core)
packaging 1.9.1 (core)
salesforce-alm 54.8.1 (core)
schema 2.1.3 (core)
sfdx-cli 7.169.1 (core)
signups 1.2.0 (core)
source 2.0.13 (core)
telemetry 2.0.0 (core)
templates 55.1.0 (core)
trust 2.0.4 (core)
user 2.1.2 (core)

OS and version:
macOS Monterey 12.6

@cristiand391 cristiand391 transferred this issue from forcedotcom/sfdx-core Oct 4, 2022
@cristiand391
Copy link
Member

Hey @pranitjain1, in the attached log I see the command crashed after trying to query the shapes for the [email protected] user. I'm getting the same error when I have a sandbox I auth'd to before and then enabled enhanced domains, maybe related to this: #1687

Can you try to re-auth with that user again? That should set the correct instanceUrl in the local auth file and the request should work.

@pranitjain1
Copy link
Author

Hi @cristiand391 - thanks for your input. I checked and enhanced domain is disable for TNG. I also tried to re-auth that user and still got the same error and the logs were same as I have attached, but your feedback got me thinking and then I authenticated one of the sandbox where enhanced domain is enable and ran the command and this time it was successful. I then logout from that sandbox and reran the command it worked. I'm attaching log file for that and I don't see any change except now command is not crashing. I don't have any explanation but this is something weird.
LatestLog.log

@cristiand391
Copy link
Member

@pranitjain1 when you auth to an org, sfdx saves the instanceUrl in the local auth file. This bug happened when one prev auth'd to a sandbox without enhanced domains and enabled it after:

  1. auth to sbx (no enhanced domains), sfdx saves instanceUrl: https://lalalala.my.salesforce.com
  2. enable enhanced domains in the UI, sbx gets new URL: https://lalalala.sandbox.my.salesforce.com
  3. when running an sfdx command that tries to connect to that org it uses the saved instanceUrl, if you left the Redirect previous My Domain URLs to your current My Domain turned on in the org sfdx should follow that redirect and update the instanceUrl.

That part of the redirection in step 3 wasn't working and caused these errors (trying to access something from undefined), we fixed that in jsforce:
jsforce/jsforce#1272
and improved the error handling in sfdx-core so that users get a better error msg:
forcedotcom/sfdx-core#667

These fixes will go into the RC next Thursday, if someone else get these kind of errors I would suggest re-auth to any org that got enhanced domains.

@cristiand391
Copy link
Member

@pranitjain1
Copy link
Author

@cristiand391 - We seem to see the same issue with 7.172.0 too. One of my colleague ran the command and he got the same error which we got before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants