forcedotcom / cli

Salesforce CLI
https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/
BSD 3-Clause "New" or "Revised" License
488 stars 78 forks source link

sfdx force:auth:jwt:grant failing after 14/01 release #806

Closed anderg4 closed 2 years ago

anderg4 commented 3 years ago

Summary

Our AWS pipeline which has been working for months has just started failing to deploy to Production with a strange error message "No org configuration found for name".

Steps To Reproduce:

  1. Setup JWT Auth
  2. Use sfdx force:auth:jwt:grant

Expected result

Successful connect

Actual result

Error message and pipeline failure.

Additional information

sfdx installed to ·[38;5;104m/usr/local/bin/sfdx

sfdx-cli/7.83.0-eba9c6a927 linux-x64 node-v12.18.3 CMD= /usr/local/bin/sfdx force:auth:jwt:grant --clientid (redacted) --jwtkeyfile /tmp/server.key --username (redacted) --instanceurl https://login.salesforce.com › Warning: force:auth:jwt:grant is not a sfdx command. Did you mean auth:jwt:grant? [y/n]: { "status": 1, "name": "NoOrgFound", "message": "No org configuration found for name (redacted)", "exitCode": 1, "commandName": "SourceDeployCommand", "stack": "NoOrgFound: No org configuration found for name (redacted)\n at Function.create (/usr/local/lib/sfdx/node_modules/@salesforce/core/lib/sfdxError.js:160:16)\n at AuthInfo.loadAuthFromConfig (/usr/local/lib/sfdx/node_modules/@salesforce/core/lib/authInfo.js:682:49)", "warnings": [ "The error message \"NoOrgFound\" has been deprecated and will be removed in v46 or later. It will become \"NamedOrgNotFound\"." ] }

github-actions[bot] commented 3 years ago

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.

sifer commented 3 years ago

Hey, I'm reading that they changed auth into its own component. https://github.com/forcedotcom/cli/blob/main/releasenotes/README.md So the new syntax should be sfdx auth:jwt:grant

anderg4 commented 3 years ago

Hi @sifer, i'm aware of that change - however the command has been aliased for now so it "should" continue to work as before was my understanding?

anderg4 commented 3 years ago

Update: changing our pipeline configuration to use "sfdx auth:jwt:grant" works - so it would appear to be the alias which is broken?

FabienTaillon commented 3 years ago

Same here, we have several CIs broken, alias doesn't seem to work.

ImJohnMDaniel commented 3 years ago

I just took a look at our CI builds. Our builds update the CLI installation on the Docker image before working on the build. When I just checked on a build, it is upgrading to v7.84.2-a2868a68d5 .... not v7.83.0-eba9c6a927 that @anderg4.

Has Salesforce already fixed this? It is odd because npmjs.com is still showing v7.83.1 as the "latest" (re: npmjs.com entry on 'sfdx-cli')

mshanemc commented 3 years ago

Release process: an npm package goes at as latest-rc and then promoted to latest a week later.

For example, right now sfdx plugins:install salesforcedx@latest-rc will give you 7.85.0.

ImJohnMDaniel commented 3 years ago

@mshanemc -- Understood, but how is my sfdx update command picking up v7.84.2-a2868a68d5 then? I don't see that on any of the npmjs aliases.

anderg4 commented 3 years ago

Sorry, we're not using npm. Our pipelines use wget to download the latest via: wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz which currently results in sfdx-cli/7.83.0-eba9c6a927 linux-x64 node-v12.18.3

We've changed to use the non-aliased command sfdx auth:jwt:grant and the pipeline is working again. It's definitely something in the aliased command - but we can live with it as we've now change syntax.

anderg4 commented 3 years ago

CLI has been rolled back - see https://github.com/forcedotcom/cli/issues/811

anderg4 commented 3 years ago

Exact same issue has been re-introduced.

Warning: force:auth:jwt:grant is not a sfdx command. { "status": 1, "name": "NoOrgFound", "message": "No org configuration found for name ***", "exitCode": 1, "commandName": "SourceDeployCommand", "stack": "NoOrgFound: No org configuration found for name ***\n at Function.create (/usr/local/lib/sfdx/node_modules/@salesforce/core/lib/sfdxError.js:160:16)\n at AuthInfo.loadAuthFromConfig (/usr/local/lib/sfdx/node_modules/@salesforce/core/lib/authInfo.js:682:49)", "warnings": [ "The error message \"NoOrgFound\" has been deprecated and will be removed in v46 or later. It will become \"NamedOrgNotFound\"." ] } Did you mean auth:jwt:grant? [y/n]:

anderg4 commented 3 years ago

sfdx retrieved into github action via:

wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz

anderg4 commented 3 years ago

the above results in sfdx-cli-v7.83.0-eba9c6a927-linux-x64 which appears to be the original non-working version from above rather than the correct repackaged version from Feb 5

mshanemc commented 2 years ago

also note that we changed the URLs in early 2021, so you don't want to use that URLs discussed on this issue.

ex: https://developer.salesforce.com/media/salesforce-cli/sfdx/channels/stable/sfdx-linux-x64.tar.gz

You can always check the docs https://developer.salesforce.com/docs/atlas.en-us.232.0.sfdx_setup.meta/sfdx_setup/sfdx_setup_install_cli.htm#sfdx_setup_install_cli_macos