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:package:installed:list -> TypeError: this.config.getPluginsList is not a function #2426

Closed
nvuillam opened this issue Aug 24, 2023 · 37 comments
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@nvuillam
Copy link

nvuillam commented Aug 24, 2023

Summary

sfdx force:package:installed:list -u [email protected] --json

TypeError: this.config.getPluginsList is not a function

Steps To Reproduce

On private repo, sorry :/

Expected result

The list of packages :)

Actual result

TypeError: this.config.getPluginsList is not a function

System Information

{
  "cliVersion": "@salesforce/cli/2.5.7",
  "architecture": "linux-x64",
  "nodeVersion": "node-v18.17.1",
  "osVersion": "Linux 5.15.0-1042-azure",
  "shell": "bash",
  "rootPath": "/opt/hostedtoolcache/node/18.17.1/x64/lib/node_modules/@salesforce/cli",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 2.3.6 (core)",
    "@oclif/plugin-commands 2.2.22 (core)",
    "@oclif/plugin-help 5.2.17 (core)",
    "@oclif/plugin-not-found 2.3.37 (core)",
    "@oclif/plugin-plugins 3.2.6 (core)",
    "@oclif/plugin-search 0.0.22 (core)",
    "@oclif/plugin-update 3.1.32 (core)",
    "@oclif/plugin-version 1.3.8 (core)",
    "@oclif/plugin-warn-if-update-available 2.0.48 (core)",
    "@oclif/plugin-which 2.2.30 (core)",
    "@salesforce/cli 2.5.7 (core)",
    "apex 2.3.10 (core)",
    "auth 2.8.12 (core)",
    "data 2.5.6 (core)",
    "deploy-retrieve 1.17.5 (core)",
    "info 2.6.39 (core)",
    "limits 2.3.30 (core)",
    "login 1.2.26 (core)",
    "org 2.10.0 (core)",
    "packaging 1.22.2 (user)",
    "schema 2.3.23 (core)",
    "settings 1.4.25 (core)",
    "sobject 0.2.4 (core)",
    "source 2.10.31 (core)",
    "telemetry 2.3.0 (core)",
    "templates 55.5.10 (core)",
    "trust 2.6.1 (core)",
    "user 2.3.28 (core)",
    "sfdx-essentials 2.12.0 (user)",
    "sfdx-hardis 4.1.2-beta202308231615.0 (user)"
  ]
}

Additional information

I have multiple companies using sfdx-hardis that have their CI/CD pipelines blocked because of this issue :(

@nvuillam nvuillam added the investigating We're actively investigating this issue label Aug 24, 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.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Aug 24, 2023
@nvuillam
Copy link
Author

Edit: same result happens with

sfdx force:package:install --package 04t0E0000005eSpQAI --noprompt --securitytype AdminsOnly -w 60 --json -u [email protected]

@stuartgrieve
Copy link

This is also impacting our project as of this morning. All package-related commands in our CI process are throwing

Installing plugin packaging... ⣟ [4/4] Building fresh packages... Installing plugin packaging... ⣯ [4/4] Building fresh packages... Installing plugin packaging... ⣷ Done in 15.73s. Installing plugin packaging... installed v1.22.1 TypeError: this.config.getPluginsList is not a function

I was last able to create an unlocked package version around 5:30pm (UK) yesterday. I've also tried ramping down the SF CLI docker image used from salesforce/cli:latest-full to salesforce/cli:2.3.0-full with no change.

@corentindoctolib
Copy link

Hello, same result with the previous CLI release (2.6.6.) :

CLI

npm install @salesforce/[email protected]

RESULT

sf package install --package 04t5w000005diA4AAI --target-org [email protected] --no-prompt --wait 5 --json\n> Result : TypeError: this.config.getPluginsList is not a function"

@GeorgePreece
Copy link

I am also receiving this issue, seems to occur with any package command

$ sfdx version
@salesforce/cli/2.5.7 darwin-arm64 node-v18.12.1
$ sfdx plugins
packaging 1.22.1 (1.22.1)

@j-schreiber
Copy link

Package creation and package installation are also affected by this. I can reproduce this with 2.5.7 locally and in our CI environment.

-> packaging 1.22.1 (1.16.1)

It works with legacy CLI version 1.86.7 (uses packaging 1.20.1 (1.16.1))

@limlynette
Copy link

limlynette commented Aug 24, 2023

Package creation error:
TypeError: this.config.getPluginsList is not a function

CLI command:
sf package version create -p "Package Name" --installation-key XXXX --target-dev-hub XXX --code-coverage

CLI version:
@salesforce/cli/1.86.7-legacy.0 linux-x64 node-v18.15.0

@ashishrajbanshi
Copy link

Try "sfdx package version create" command. Worked for me.
System version: @salesforce/cli/2.4.10 linux-x64 node-v18.17.1

@olektymchenko
Copy link

"sf update nightly" helped me to resolve this issue

torhakon added a commit to navikt/crm-workflows-base that referenced this issue Aug 24, 2023
Bumper versjon og oppdaterer til å kjøre nightly for å omgå denne bug'en
 forcedotcom/cli#2426
@MathiBK
Copy link

MathiBK commented Aug 24, 2023

"sf update nightly" helped me to resolve this issue

Had the same problem, "sf update nightly" worked for me as well.

@KaneBN
Copy link

KaneBN commented Aug 24, 2023

We're also seeing this issue with our CI package creation job.

Command:
sf package1 version create --package-id XXXX --name XXXX --wait 0 --target-org XXXX --managed-released

Error:
TypeError: this.config.getPluginsList is not a function

Fix:
sf update nightly didn't give us the desired result but directly installing the nightly version worked instead.
npm install --global @salesforce/cli@nightly

@j-schreiber
Copy link

@stuartgrieve
Copy link

If you're using the SF CLI docker image, switching from latest to
salesforce/cli:nightly-full
did the trick for us

@ImJohnMDaniel
Copy link

Throw my hat in the ring. We are seeing this issue as well.

@ebertineau
Copy link

Same issue here. Any news about a fix ?

@mdonnalley
Copy link
Contributor

Thanks everyone for alerting us to the issue. The current workaround is to use the nightly release.

We have a couple of solutions in the works. I'll post here once we've landed on one

@RemcovanDiesen
Copy link

Same here, our CI/CD deployment is affected and on hold a.t.m.

@thobanrev
Copy link

Same issue here. I believe it is with every package command...

$ sf package list
TypeError: this.config.getPluginsList is not a function

@mdonnalley
Copy link
Contributor

We just published patches to latest (2.5.8) andlatest-rc (2.6.7)

If you're using npm,

npm install -g @salesforce/cli

If you're using installer,

sf update stable

@mdonnalley
Copy link
Contributor

mdonnalley commented Aug 24, 2023

Will you push to latest-slim as well?

@jeromegv Yes, those have been published too

@jdschleicher
Copy link

jdschleicher commented Aug 24, 2023

hi, following here and throwing some stuff on the wall:

https://salesforce.stackexchange.com/questions/399035/sfdx-create-package-version-throws-plugin-packaging-error

by adding npm i -g @salesforce/plugin-packaging following npm install --global @salesforce/cli in out ci systems it seemed to resolve our error. It may have worked right at the moment 2.5.8 rolled out. Looking into it more

confirmed it was indeed an issue with sfdx cli version and the plugin-packaging install did nothing :)

@ethan-sargent
Copy link

ethan-sargent commented Aug 25, 2023

To add, I've observed this issue with sfdx-scanner as well as with plugin-packaging.

oclif/plugin-plugins#642
forcedotcom/sfdx-scanner#1153

#2336 (comment)

How do we know that we won't experience these issues on stable in the future?

@PeterOlvera
Copy link

PeterOlvera commented Aug 25, 2023

Same result for org shape generation
sf org delete shape
sf org create shape
sf org shape list
@salesforce/cli/2.5.7 win32-x64 node-v18.15.0

@R0Wi
Copy link

R0Wi commented Aug 25, 2023

We just published patches to latest (2.5.8) andlatest-rc (2.6.7)

If you're using npm,

npm install -g @salesforce/cli

If you're using installer,

sf update stable

sf update stable did the trick for me. sf dev generate plugin is working again 👍

@mdonnalley
Copy link
Contributor

mdonnalley commented Aug 25, 2023

To add, I've observed this issue with sfdx-scanner as well as with plugin-packaging.

oclif/plugin-plugins#642 forcedotcom/sfdx-scanner#1153

#2336 (comment)

How do we know that we won't experience these issues on stable in the future?

@ethan-sargent I'm not familiar with the issues you posted so it's hard to say that those are caused by the same thing but it's possible. If it helps, here's a detailed explanation about why this happened and what we'll do to fix it.

@oclif/core (the CLI framework that sf is built on) creates a Config instance before every command execution using the version of @oclif/core in the root plugin (which is the @salesforce/cli plugin). This class is responsible for loading all the plugins, finding commands, executing hooks, executing commands, among other things. When the user executes a command Config finds the matching command file, loads it, then executes it. In order for Config to execute the command, it passes itself to the command so that the command can use methods and properties on Config during execution. This means that all commands receive an instance of Config based on the root plugin's version NOT on the version required by the plugin.

This can be problematic if the command requires a higher version of Config than what it's given. This is what caused this issue. The packaging plugin expected v2.11.10 of @oclif/core (more on this later) that contained a newly added method (this.config.getPluginsList) but sf was giving the packaging commands v2.11.8 which did not have that method.

This historically hasn't been a problem for us because we bump @oclif/core to the latest version for every release and because we lock the dependencies of bundled plugins. But the introduction of just-in-time plugin installation has made this issue more apparent because JIT plugins always pull in the latest versions of its dependencies during installation. If the dependencies had been locked, then it wouldn't have pulled in the newer version and caused the issue described in the previous paragraph.

So there are two problems that need to be solved:

  1. Commands can receive an instance of Config that doesn't meet their requirements.
  2. JIT plugins install latest versions of dependencies

Solving the second problem helps reduce the frequency of the first problem and it also solves the problem of a dependency or transitive dependency suddenly introducing a breaking change (think the color.js debacle).

But it doesn't totally solve the first problem because a plugin could have purposely and legitimately bumped their version of @oclif/core before it was bumped in the root sf plugin. For this I have a number of ideas that I need to investigate and run by the team.

This is a high priority for us given that this isn't the first time this happened (see #2330).

@veaux
Copy link

veaux commented Aug 28, 2023

I see this was closed but we are still experiencing this and none of the suggested fixes, sf update nightly or sf update stable are working. At a complete standstill. All was actually fine for us 4 days ago on 2.58 when this was opened, the problem started occurring after 8/25. Seems to be affecting most all sf commands. @salesforce/cli/1.86.7-legacy.0 win32-x64 node-v18.15.0

Getting error this.config.getPluginsList is not a function for sf commands but sfdx same command seems to work.

@molson-sfdc
Copy link

I am still seeing this as well and none of the recommendations are helping. Reverting back to using sfdx does allow me to do some command.

@mdonnalley
Copy link
Contributor

mdonnalley commented Aug 30, 2023

@veaux @molson-sfdc can you provide more details? The following would be helpful:

sf version --verbose and sf plugins inspect @salesforce/cli

And then which commands you're seeing the error on

@veaux
Copy link

veaux commented Aug 30, 2023

@mdonnalley I'm seeing error on pretty much all sf commands. I stopped using them and using sfdx instead.

CLI Version:
@salesforce/cli/1.86.7-legacy.0

Architecture:
win32-x64

Node Version:
node-v18.15.0

Plugin Version:
@oclif/plugin-autocomplete 2.3.1 (core)
@oclif/plugin-commands 2.2.17 (core)
@oclif/plugin-help 5.2.11 (core)
@oclif/plugin-not-found 2.3.26 (core)
@oclif/plugin-plugins 3.1.6 (core)
@oclif/plugin-search 0.0.18 (core)
@oclif/plugin-update 3.1.22 (core)
@oclif/plugin-version 1.3.6 (core)
@oclif/plugin-warn-if-update-available 2.0.41 (core)
@oclif/plugin-which 2.2.22 (core)
@salesforce/cli 1.86.7-legacy.0 (core)
apex 2.3.4 (core)
auth 2.8.4 (core)
community 2.3.14 (user)
custom-metadata 2.1.41 (user)
data 2.4.5 (core)
deploy-retrieve 1.13.5 (core)
dev 1.1.9 (user)
info 2.6.30 (core)
limits 2.3.23 (core)
login 1.2.15 (core)
org 2.9.19 (core)
packaging 1.22.2 (user)
schema 2.3.17 (core)
settings 1.4.17 (core)
sobject 0.1.32 (core)
source 2.10.22 (core)
telemetry 2.2.1 (core)
templates 55.5.2 (core)
trust 2.4.27 (core)
user 2.3.20 (core)

OS and Version:
Windows_NT 10.0.19045

Shell:
cmd.exe

Root Path:
C:\Users\Darrell\AppData\Local\sfdx\client\7.209.6-8ba3197\sf

@mdonnalley
Copy link
Contributor

@veaux Thanks - I'm not seeing the same on 1.86.7-legacy.0. I would try running sf plugins update to see if maybe one of your user-installed plugins needs updated deps (specifically @oclif/core). If that doesn't work I would consider doing a complete uninstall and reinstall of sf.

@molson-sfdc
Copy link

@mdonnalley I did a complete reinstall of sf and the problem went away.

@akash-chaudhari-sf
Copy link

Hello Everyone,

Can anyone confirm that, 2.5.8 is locked to a specific packaging plugin version or not?

@djodrell
Copy link

djodrell commented Nov 16, 2023

The command sf plugins update threw a non-descriptive error, but still resolved the problem described in this thread.

$ sf plugins update
@salesforce/cli: Updating plugins... !
Error: /home/djodrell/.nvm/versions/node/v20.6.0/lib/node_modules/@salesforce/cli/node_modules/yarn/bin/yarn.js --prod --non-interactive --mutex=file:/home/djodrell/.local/share/sf/node_modules/@salesforce/plugin-community/yarn.lock --preferred-cache-folder=/home/djodrell/.cache/sf/yarn --check-files --silent
exited with code 1

@mshanemc
Copy link
Contributor

@djodrell can you open a new issue if you've got a way to consistently get that error? I'm not sure it's the same is the one you just posted on.

@djodrell
Copy link

djodrell commented Nov 16, 2023

@mshanemc In spite of the "Error" reported above, the command still appears to have been successful.
I did see the same output when I re-ran the command, but after running it a bunch of times, including with the --verbose flag, it now seems to be working normally. There are just a couple of warnings about unmet dependencies, but otherwise it all looks good.

$ sf plugins update
@salesforce/cli: Updating plugins... done
› Warning: "@salesforce/plugin-packaging > @oclif/core > [email protected]" has unmet peer dependency "@types/node@*".
› Warning: "@salesforce/plugin-packaging > @oclif/core > [email protected]" has unmet peer dependency "typescript@>=2.7".

@Dhirajpatil7776
Copy link

when I run the " sf modeler workspace create " this command I get this type of error

I install CLI plugin's latest version but still get this error please help me solve this error

Error
tyeperroe this.config.plugins.filter is not a function

error1

!

@davidchrin
Copy link

davidchrin commented Apr 30, 2024

I have the exact same problem. its been an issue with the CLI since August 2023. Could you please at least explain why we get these error messages instead of telling us to install / reinstall the modeler ?? We do not have access anymore to the version of the CLI explained in the documentation ( https://help.salesforce.com/s/articleView?id=sf.modeler_vscode_installation_prerequisites.htm&type=5), which is @salesforce/[email protected], the snippets that you propose in the documentation are incomplete, truncated or do not compile in the terminal so all needs to be done manually !! (eg, set VCTargetsPath=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\ ) can we have reliable info and a reason why or a way to debug it ourselves ?´thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests