-
Notifications
You must be signed in to change notification settings - Fork 78
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
Package related commands return error as they do not recognize the org set as DevHub #2245
Comments
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. |
Hello @ymata 👋 It looks like you didn't include the full Salesforce CLI version information in your issue. A few more things to check:
Thank you! |
Hi @ymata - this is an interesting one... can you try |
Thanks @WillieRuemmele. I tried this command ( |
Just to iterate the issue, when logging in using jwt with the --set-default-dev-hub tag, we get the
on sf org list here is what it looks like for that org: As you can see the isDevHub flag is false, but is set to isDefaultDevHubUsername = true Im using the same version of sfdx as @ymata
Could you please assist? |
Interesting, we might not be correctly identifying DevHubs... that property should be set in |
Hi @WillieRuemmele |
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted. |
@ymata - Just to confirm, the key to reproducing this is to first create a user in the devhub org using the Minimum Access profile and grant permission to the connected app. Then with that user you do the devhub auth and packaging commands? |
@ymata the auth process sets the isDevHub field by querying the org to see if it has any ScratchOrgInfo objects associated with it. https://github.com/forcedotcom/sfdx-core/blob/f4250e227d7657a458113493201b4c4c76d3a050/src/org/org.ts#L549-L550 If you modify your profile (or, preferable, create a permissions set that allows the user to read from the ScratchOrgInfo object) it should clear up the issue. You'd need more permissions that that if you intend to use the hub to create/delete scratch orgs, but if you're just using it for 2GP Alternatively, you can manually set |
Summary
I am trying to migrate from an old version of sfdx-cli to the latest version of @salesforce/cli but the package related commands return an error as they do not recognize the org set as DevHub.
All the commands work correctly except the ones related to packages.
Steps To Reproduce
Run:
sf package list --target-dev-hub MYDEVHUB --verbose
Expected result
As a result, a list of all packages in MYDEVHUB org should be displayed.
Actual result
System Information
Shell used: bash
Run:
sf --version --verbose --json
@salesforce/cli/1.83.4 linux-x64 node-v20.3.1
Additional information
If we run the command to list connected orgs, we can see that the MYDEVHUB org is set to DevHub.
Run:
sf org list
Result:
Diagnostic tests
sf package list --target-dev-hub MYDEVHUB --verbose --dev-debug
Update
By logging into Salesforce using the web server flow (
sf org login web
) the problem goes away.The problem occurs when logging in using JSON web token (
sf org login jwt
).In both cases the output of the
sf org list
command is the same:Org login jwt:
Run:
Result:
The
set-default-dev-hub
flag is being used, however in the output it can be seen thatisDevHub
is false.Org login web:
Run:
Result
In this case
isDevHub
is true.The text was updated successfully, but these errors were encountered: