-
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
Force org status throws "more than 1 record" error #1833
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. |
In the case of a refresh, which sandbox do you expect to receive the status of ? |
That's the interesting part, and that's the assumption that seems to have changed recently. The org status command used to report on the pending refresh. So if I had an existing sandbox, refreshed it, and called org status it would sit and wait until the refresh was complete. This was useful from a CI perspective to easily wait for a refresh to complete and authenticate to the refreshed sandbox at the same time. This could also be seen as a negative if you wanted access to the currently-live instance of the sandbox but that isn't (currently) a problem for us. To answer your question, I think the most useful and user-friendly option would be the ability to choose. Perhaps a flag for the org status command such as
|
I opened this as a bug not a feature request because a command that previously worked in a useful fashion now returns an error under somewhat common/expected circumstances. I would say reporting on the current instance status or refresh status is a matter of preference. However, the |
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted. |
I've traced the root cause of this issue from the plugin-org repo. The problem lies in dependency code in this file The stack trace goes something like
The So this looks like an unintentional side effect of a long series of spaghetti method calls using a sprawling set of query functions. Since the relevant SandboxProcess object was: correctly queried early in the command, passed in the options to subsequent methods, and the subsequent methods don't seem to need any additional columns from the table, I would propose using the provided object instead of re-querying it. Of course there may be a reason for re-querying it which is relevant to other consumers of that method; I assume someone just changed that behavior for some other use case which introduced the bug here. So this may boil down to some refactoring and reduction of excessive helper methods. Let me know your thoughts. |
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted. |
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted. |
This auto-close workflow is quite annoying because the issue is not going stale due to a lack of engagement on my end. |
This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted. |
@mshanemc we have also been using this command for polling sandbox refreshes for multiple years, and just noticed that it has stopped working after upgrading CLI versions on our CI runners. We tried the new command (org:resume:sandbox) and the same issue is observed. I agree with @kyle-blair that this is a bug. Why are we auto-closing bugs that are pending a response from Salesforce? Should we be putting in support tickets for this instead? |
same issue using the new |
Yep, the new beta replacement command has the same issue both with and without the most recent flag. |
Hey @mshanemc - is there any way you could look into this? The issue was auto-closed for no good reason and it is still happening in 7.194.1. I did investigate this a little and posted my thoughts in #1749 (comment) |
@mshanemc or anyone, can we please reopen this? The issue is still occurring. |
There's a newer ticket now - see #2238 . |
Summary
An error is thrown when running
sfdx force:org:status
for a sandbox that has an in-progress refresh.Steps To Reproduce:
sfdx force:org:status --setalias test --sandboxname test --wait 60
.Expected result
The status command waits 60 minutes for the refresh to complete. If it completes within 60 minutes then the org details are printed and an sfdx alias is created.
Actual result
The command prints the error
ERROR running force:org:status: The query returned more than 1 record
.System Information
Additional information
Using the
--dev-debug
flag I can see the cli is querying the SandboxProcess object filtering by the desired SandboxInfoId andWHERE Status != 'D'
. Performing the same query myself I get two records as the error indicates; one with status Completed and one with Processing. Seems like the cli expectations do not match up with backend implementation or vice versa. This all worked fine a week or so ago. I can confirm the same issue is happening in our CI which uses sfdx version 7.165.0.Some expanded debug output:
The text was updated successfully, but these errors were encountered: