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

ERROR running force:org:status: Cannot create an AuthInfo instance that will overwrite existing auth data. #1077

Closed
HyruleConsulting opened this issue Jul 9, 2021 · 9 comments
Labels
investigating We're actively investigating this issue owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. wontfix We won't work on this issue

Comments

@HyruleConsulting
Copy link

Summary

When using sfdx force:org:status to authenticate with a sandbox following a refresh, an authentication error occurs:

ERROR running force:org:status: Cannot create an AuthInfo instance that will overwrite existing auth data.
Try this:
Create the AuthInfo instance using existing auth data by just passing the username. E.g., AuthInfo.create({ username: '[email protected]' });

Steps To Reproduce:

  1. Use a connected app in production. Add following scopes: api, full, refresh_token, offline_access. Add callback url: http://localhost:1717/OauthRedirect
  2. Refresh a sandbox
  3. Authenticate production with your CLI (sfdx force:auth:jwt:grant)
  4. Use command: sfdx force:org:status
  5. Receive auth error

ERROR running force:org:status: Cannot create an AuthInfo instance that will overwrite existing auth data.
Try this:
Create the AuthInfo instance using existing auth data by just passing the username. E.g., AuthInfo.create({ username: '[email protected]' });

Expected result

Sandbox should be authenticated

Actual result

ERROR running force:org:status: Cannot create an AuthInfo instance that will overwrite existing auth data.
Try this:
Create the AuthInfo instance using existing auth data by just passing the username. E.g., AuthInfo.create({ username: '[email protected]' });

System Information

sfdx-cli/7.107.0 darwin-x64 node-v14.17.1

@HyruleConsulting HyruleConsulting added the investigating We're actively investigating this issue label Jul 9, 2021
@github-actions
Copy link

github-actions bot commented Jul 9, 2021

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.

@mshanemc
Copy link
Contributor

mshanemc commented Jul 9, 2021

I'm not sure that's a bug. We usually try not to overwrite an auth, ever, for safety reasons.

So you'd probably want to auth:logout of the sandbox before trying to connect to it post-refresh (it's technically going to be like a whole new org).

  1. see if that works
  2. leave some feedback on if that seems like the correct approach or if you think for source:status should behave differently?

@mshanemc mshanemc added the more information required Issue requires more information or a response from the customer label Jul 9, 2021
@HyruleConsulting
Copy link
Author

Thanks Shane, I've logged out of all orgs from my CLI now which helps but I still can't authenticate due to invalid client credentials.

ERROR running force:org:status: Error authenticating with auth code due to: invalid client credentials

Connected App Details in Production (and in sandbox following refresh)

Scopes:
Access your basic information (id, profile, email, address, phone)
Access and manage your data (api)
Provide access to your data via the Web (web)
Full access (full)
Perform requests on your behalf at any time (refresh_token, offline_access)
Allow access to content resources (content)

Callback URL
https://login.salesforce.com/
https://test.salesforce.com
http://localhost:1717/OauthRedirect

@no-response no-response bot removed the more information required Issue requires more information or a response from the customer label Jul 12, 2021
@MGarfOppLoans
Copy link

any update on this, we have had to roll back to a smaller version to get around the issue

@mshanemc
Copy link
Contributor

mshanemc commented Dec 9, 2021

I think the best option if auth:logout didn't help would be to org:delete so that no auth files are kept around and then try the auth again. Can @MGarfOppLoans or @HyruleConsulting try that if this org is still around?

Sandbox team is aware of their auth problems. There's not much we can do other than try to help with workarounds.

You can try opening a case to help them see how many people think this needs to be addressed when they prioritize work.

@mshanemc mshanemc added the owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. label Dec 9, 2021
@github-actions
Copy link

github-actions bot commented Dec 9, 2021

We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.

@MGarfOppLoans
Copy link

right we are doing what we recommended which is to check if already authed before attempting to auth again. Not ideal but works

@HyruleConsulting
Copy link
Author

HyruleConsulting commented Dec 10, 2021 via email

@mshanemc mshanemc added the wontfix We won't work on this issue label Nov 7, 2023
@mshanemc
Copy link
Contributor

mshanemc commented Nov 7, 2023

org:status is deprecated and has been replaced by org:resume:sandbox. You should be able to use that command during refreshes now.

closing because it's not going to be fixed.

@mshanemc mshanemc closed this as completed Nov 7, 2023
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 owned by another team The Salesforce CLI team does not own this work but will pass on the information to the correct team. wontfix We won't work on this issue
Projects
None yet
Development

No branches or pull requests

3 participants