Cli: force:org:list Cannot read property 'getUsername' of undefined

Created on 2 May 2020  Â·  4Comments  Â·  Source: forcedotcom/cli

Summary

force:org:list fails.

$ sfdx force:org:list 
ERROR running force:org:list:  Cannot read property 'getUsername' of undefined

Steps To Reproduce:

  1. Update cli
$ sfdx update
sfdx-cli: Updating CLI from 7.53.0-839fc82926 to 7.56.1-2773b53bf5... done
sfdx-cli: Updating CLI... done
warning "@oclif/plugin-autocomplete > @oclif/[email protected]" has unmet peer dependency "@oclif/plugin-help@^2".
sfdx-cli: Updating plugins... done
  1. sfdx force:org:list

Actual result

ERROR running force:org:list: Cannot read property 'getUsername' of undefined

Additional information

_Feel free to attach a screenshot_.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.56.1-2773b53bf5 linux-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.1.5
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.1 (core)
generator 1.1.2 (core)
salesforcedx 48.12.1
├─ @salesforce/sfdx-plugin-lwc-test 0.1.5
├─ salesforcedx-templates 48.10.0
└─ salesforce-alm 48.12.0

sfdx-cli 7.56.1 (core)

OS and version:
Distributor ID: LinuxMint
Description: Linux Mint 19.1 Tessa
Release: 19.1
Codename: tessa

4.15.0-20-generic

bug

All 4 comments

Looks like a regression from the org:list updates. We'll fix this asap. It will help us greatly if you could run the command again appending --dev-debug and post the stack trace. Thanks in advance!

Hello @shetzel
thanks for your quick reply.

  sfdx:core TRACE Setup child 'OrgListCommand' logger instance +0ms
  sfdx:force:org:list init version: @oclif/[email protected] argv: [] +0ms
  sfdx:OrgListCommand INFO Running command [OrgListCommand] with flags [{"loglevel":"warn"}] and args [{}] +0ms
  sfdx:core TRACE Setup child 'AuthInfo' logger instance +0ms
  sfdx:core TRACE Setup child 'crypto' logger instance +0ms
  sfdx:crypto DEBUG retryStatus: undefined +0ms
  sfdx:core TRACE Setup child 'keyChain' logger instance +1ms
  sfdx:keyChain DEBUG platform: linux +0ms
  sfdx:AuthInfo INFO Updated auth info for username: [email protected] +0ms
ERROR running force:org:list:  Cannot read property 'getUsername' of undefined 
*** Internal Diagnostic ***

TypeError: Cannot read property 'getUsername' of undefined
    at contents.reduce (/home/ondrej/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/org/orgListUtil.js:25:25)
    at Array.reduce (<anonymous>)
    at Function.readLocallyValidatedMetaConfigsGroupedByOrgType (/home/ondrej/.local/share/sfdx/node_modules/salesforce-alm/dist/lib/org/orgListUtil.js:24:36)
Outer stack:
    at Function.wrap (/home/ondrej/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/command/node_modules/@salesforce/core/lib/sfdxError.js:151:27)
    at OrgListCommand.catch (/home/ondrej/.local/share/sfdx/node_modules/salesforce-alm/node_modules/@salesforce/command/lib/sfdxCommand.js:255:67)
******

Workaround with docker:
docker run --rm -t -e \"TERM=xterm-256color\" -v /home/ondrej/.sfdx:/root/.sfdx salesforce/salesforcedx:7.54.4-slim sfdx force:org:list
Just change the path /home/ondrej/.sfdx to your .sfdx directory.

Seems to be fixed in 7.58.2-937f666ed4

Was this page helpful?
0 / 5 - 0 ratings