cli icon indicating copy to clipboard operation
cli copied to clipboard

sf org login jwt -> TypeError:

Open tparaiso opened this issue 1 year ago • 17 comments

Summary

When the commande "sf org login jwt" is executed, it returns "TypeError: Cannot read properties of undefined (reading 'entries')"

Steps To Reproduce:

  1. This is step 1 -> In terminal type : sf org login jwt .

Expected result

You forget something normally

Actual result

TypeError: Cannot read properties of undefined (reading 'entries')

Additional information

Feel free to attach a screenshot.

Salesforce Extension Version in VS Code:

Salesforce CLI Version: Latest @salesforce/cli/2.46.6 darwin-arm64 node-v20.9.0

OS and version: MacOs Sonoma

CleanShot 2024-06-21 at 10 22 34

tparaiso avatar Jun 21 '24 08:06 tparaiso

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.

github-actions[bot] avatar Jun 21 '24 08:06 github-actions[bot]

Hello @tparaiso :wave: It looks like you didn't include the full Salesforce CLI version information in your issue. Please provide the output of version --verbose --json for the CLI you're using (sf or sfdx).

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue.
    • A repository that clearly demonstrates the bug is ideal.
  • Make sure you've installed the latest version of Salesforce CLI. (docs)
    • Better yet, try the rc or nightly versions. (docs)
  • Try running the doctor command to diagnose common issues.
  • Search GitHub for existing related issues.

Thank you!

github-actions[bot] avatar Jun 21 '24 08:06 github-actions[bot]

{ "architecture": "darwin-arm64", "cliVersion": "@salesforce/cli/2.46.6", "nodeVersion": "node-v20.9.0", "osVersion": "Darwin 23.5.0", "rootPath": "/usr/local/lib/node_modules/@salesforce/cli", "shell": "zsh", "pluginVersions": [ "@oclif/plugin-autocomplete 3.1.2 (core)", "@oclif/plugin-commands 4.0.2 (core)", "@oclif/plugin-help 6.2.1 (core)", "@oclif/plugin-not-found 3.2.3 (core)", "@oclif/plugin-plugins 5.2.4 (core)", "@oclif/plugin-search 1.1.2 (core)", "@oclif/plugin-update 4.3.5 (core)", "@oclif/plugin-version 2.2.3 (core)", "@oclif/plugin-warn-if-update-available 3.1.5 (core)", "@oclif/plugin-which 3.2.2 (core)", "@salesforce/cli 2.46.6 (core)", "apex 3.1.18 (core)", "auth 3.6.21 (core)", "community 3.0.13 (user) published 159 days ago (Sat Jan 13 2024) (latest is 3.2.20)", "data 3.4.6 (core)", "deploy-retrieve 3.9.4 (core)", "info 3.3.6 (core)", "limits 3.3.12 (core)", "marketplace 1.2.12 (core)", "org 4.2.1 (core)", "packaging 2.1.1 (user) published 158 days ago (Sun Jan 14 2024) (latest is 2.6.1)", "schema 3.3.11 (core)", "settings 2.3.1 (core)", "signups 2.0.17 (user) published 158 days ago (Sun Jan 14 2024) (latest is 2.3.13)", "sobject 1.4.11 (core)", "source 3.4.2 (core)", "telemetry 3.4.0 (core)", "templates 56.2.11 (core)", "trust 3.7.5 (core)", "user 3.5.13 (core)", "edenred-sfdx-plugin 2.0.0 (link) /Users/Thomas/developpement/programmes/edenred/Redforce/edenred-sfdx-plugin" ] }

tparaiso avatar Jun 21 '24 08:06 tparaiso

Same issue with this command : sf org list

TypeError: Cannot read properties of undefined (reading 'entries')

tparaiso avatar Jun 21 '24 12:06 tparaiso

@tparaiso - I can't reproduce this using the same installed CLI version. We have tons of tests that use these commands as well and they run cleanly. This is specific to your environment so here's what I'd do:

  1. Use the sf plugins reset command to put your CLI back to a base state. The --hard flag might be a good idea to use as well.
  2. After a reset, try sf org list again. If it works without error, then one of the old plugins installed is likely causing the issue. Figure out which one and pinpoint the problem. I would use the CLI-bundled versions of the core plugins. If it's the linked plugin, get more details about it (i.e., a stack trace) with export SF_ENV=development and rerun the command.
  3. If the error still happens after a reset, then please provide more information by running sf doctor --command "org list" and inspecting the results. I would like to see the stack trace from the debug output files.

shetzel avatar Jun 24 '24 17:06 shetzel

@shetzel thank you very much, the command "sf plugins reset --hard" fix my issue.

At my work I have had the same issue with our CI, we installed the previous version of the CLI and it's worked. There is something in the version of June 20 and plugins dependency. I will try the command tomorrow.

Thanks !

tparaiso avatar Jun 24 '24 19:06 tparaiso

I had the same problem. FWIW, I uninstalled plug-ins one at a time until sf org list worked again. Started working again after uninstalling @salesforce/sfdx-scanner 3.11.0

seanhharrison avatar Jun 26 '24 21:06 seanhharrison

We're experiencing the same error with this version as well

mgalalm avatar Jun 27 '24 09:06 mgalalm

@salesforce/cli/2.47.6 darwin-x64 node-v20.10.0 still has the issue

jhgihub0 avatar Jun 27 '24 21:06 jhgihub0

It appears that a breakage has been introduced for plugins using the relatively old sfdx-core package, as noted in this pull request: https://github.com/forcedotcom/sfdx-core/pull/1080. I managed to bypass the problem for debugging purposes by editing the core library. Specifically, I added a couple of lines

exports.Lifecycle = Lifecycle;
Lifecycle.getInstance()

above

const cloneListeners = (listeners) => new Map(Array.from(listeners.entries()));

in the lifecycleEvents.js part of the old version of the sfdx-core package. Please note that I am not proposing this as a solution, just sharing my findings.

mgalalm avatar Jun 28 '24 13:06 mgalalm

Thanks @mgalalm @jhgihub0 @seanhharrison - I verified that the bug exists with @salesforce/[email protected] - I just tried installing the latest version of scanner (4.3.0) and it worked.

if anyone else can confirm the latest version of scanner is fixed as well that'd be great

WillieRuemmele avatar Jun 28 '24 16:06 WillieRuemmele

Unfortunately Im getting the same problem there :( Updating the scanner to version 4.3.0 havent helped :( Any other recomendations? My config looks as below: { "architecture": "win32-x64", "cliVersion": "@salesforce/cli/2.47.6", "nodeVersion": "node-v20.14.0", "osVersion": "Windows_NT 10.0.22631", "rootPath": "C:\Users\Lenovo\AppData\Local\sf\client\2.47.6-6b39a27", "shell": "cmd.exe", "pluginVersions": [ "@oclif/plugin-autocomplete 3.1.4 (core)", "@oclif/plugin-commands 4.0.4 (core)", "@oclif/plugin-help 6.2.3 (core)", "@oclif/plugin-not-found 3.2.5 (core)", "@oclif/plugin-plugins 5.3.2 (core)", "@oclif/plugin-search 1.1.4 (core)", "@oclif/plugin-update 4.4.2 (core)", "@oclif/plugin-version 2.2.4 (core)", "@oclif/plugin-warn-if-update-available 3.1.6 (core)", "@oclif/plugin-which 3.2.4 (core)", "@salesforce/cli 2.47.6 (core)", "apex 3.1.21 (core)", "auth 3.6.23 (core)", "custom-metadata 3.3.13 (user)", "data 3.5.0 (core)", "deploy-retrieve 3.9.6 (core)", "info 3.3.9 (core)", "limits 3.3.13 (core)", "marketplace 1.2.15 (core)", "org 4.2.4 (core)", "packaging 2.4.6 (core)", "schema 3.3.14 (core)", "settings 2.3.3 (core)", "sobject 1.4.12 (core)", "source 3.4.6 (core)", "telemetry 3.4.3 (core)", "templates 56.2.13 (core)", "trust 3.7.7 (core)", "user 3.5.15 (core)", "@salesforce/sfdx-scanner 4.3.0 (user)", "sfdx-git-delta 5.40.2 (user)", "sfdx-git-packager 0.3.4 (user)", "sfdx-mdt-plugin 0.6.6 (user)", "sfdx-plugin-source-read 1.2.0 (user)" ] }

four4444PL avatar Jul 01 '24 11:07 four4444PL

Upgrading to latest version of sfdx/scanner is not working on my side.

kevanmoothien avatar Jul 02 '24 07:07 kevanmoothien

Same happens to me. Tried reinstalling or uninstalling the sacnner, but it doesnt work. Also for me its just happening when I try to deploy or retrieve using the VSCode UI, but it does not happen if I exceute sf project deploy start -d "..." directly in the terminal. I tried reinstalling the VSCode plugins, but that did not work also

ReaperBeats avatar Jul 02 '24 13:07 ReaperBeats

If you are blocked, you can install an older version (that's worked for me on my other computer) : install @salesforce/[email protected] --global (https://help.salesforce.com/s/articleView?id=release-notes.rn_sf_cli_previous_version.htm&release=220&type=5)

tparaiso avatar Jul 02 '24 13:07 tparaiso

Hey @tparaiso @ReaperBeats @kevanmoothien @four4444PL - after a lot more testing, I'm still stumped. I've installed all of the versions, with the various node versions reported, and the problem keeps appearing for me when I use [email protected], once I bump that to the latest ^4 version, it goes away

WillieRuemmele avatar Jul 02 '24 15:07 WillieRuemmele

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

git2gus[bot] avatar Jul 03 '24 14:07 git2gus[bot]

It is working fine for me since I updated to the last version on CLI.

ReaperBeats avatar Jul 09 '24 09:07 ReaperBeats

Still an issue with latest stable

@salesforce/cli/2.48.6 linux-x64 node-v20.15.0

@oclif/plugin-autocomplete 3.1.4 (core)
@oclif/plugin-commands 4.0.4 (core)
@oclif/plugin-help 6.2.3 (core)
@oclif/plugin-not-found 3.2.6 (core)
@oclif/plugin-plugins 5.3.2 (core)
@oclif/plugin-search 1.2.0 (core)
@oclif/plugin-update 4.4.3 (core)
@oclif/plugin-version 2.2.4 (core)
@oclif/plugin-warn-if-update-available 3.1.6 (core)
@oclif/plugin-which 3.2.4 (core)
apex 3.2.0 (core)
auth 3.6.27 (core)
data 3.5.2 (core)
deploy-retrieve 3.9.9 (core)
info 3.3.11 (core)
limits 3.3.15 (core)
marketplace 1.2.17 (core)
org 4.3.0 (core)
packaging 2.6.1 (core)
schema 3.3.16 (core)
settings 2.3.6 (core)
sobject 1.4.14 (core)
source 3.4.8 (core)
telemetry 3.5.1 (core)
templates 56.3.0 (core)
trust 3.7.10 (core)
user 3.5.17 (core)

jhgihub0 avatar Jul 10 '24 19:07 jhgihub0

Hey @jhgihub0 - thanks for staying so on top of this change, you might have just missed our promotion to latest (I mean, missed it by minutes, this happened within the hour), which is now 2.49.7. I'm hoping an update (again) will fix this for you

WillieRuemmele avatar Jul 10 '24 20:07 WillieRuemmele

Yes, it seems to work with @salesforce/cli/2.49.7 linux-x64 node-v20.15.0

Thank you.

jhgihub0 avatar Jul 10 '24 22:07 jhgihub0

Hi there guys, i´m facing the same issue with @salesforce/cli/2.49.7 win32-x64 node-v20.15.0

albertopuerto avatar Jul 12 '24 09:07 albertopuerto