-
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
[BUG] sfdx force:org:display thows non related exception even when it works #719
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. |
@amphro could you help with this? |
My sfdx logs of when I had the same problem. The [
{
"name":"sfdx",
"hostname":"AORUSX7",
"pid":10492,
"log":"jsforce",
"level":50,
"msg":"{\"code\":\"ENOTFOUND\",\"errno\":\"ENOTFOUND\",\"syscall\":\"getaddrinfo\",\"hostname\":\"resourceful-moose-286285-dev-ed.my.salesforce.com\",\"host\":\"resourceful-moose-286285-dev-ed.my.salesforce.com\",\"port\":443}",
"time":"2018-11-28T17:31:56.655Z",
"v":0
},
{
"name":"sfdx",
"hostname":"AORUSX7",
"pid":10492,
"level":50,
"msg":"getaddrinfo ENOTFOUND resourceful-moose-286285-dev-ed.my.salesforce.com resourceful-moose-286285-dev-ed.my.salesforce.com:443.",
"time":"2018-11-28T17:31:56.659Z",
"v":0
},
{
"name":"sfdx",
"hostname":"AORUSX7",
"pid":10492,
"level":50,
"msg":"[ false,\n '{\"message\":\"getaddrinfo ENOTFOUND resourceful-moose-286285-dev-ed.my.salesforce.com resourceful-moose-286285-dev-ed.my.salesforce.com:443\",\"status\":1,\"stack\":\"Error: getaddrinfo ENOTFOUND resourceful-moose-286285-dev-ed.my.salesforce.com resourceful-moose-286285-dev-ed.my.salesforce.com:443\\\\n at errnoException (dns.js:50:10)\\\\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)\",\"name\":\"Error\",\"warnings\":[]}' ]",
"time":"2018-11-28T17:31:56.660Z",
"v":0
},
{
"name":"sfdx",
"hostname":"AORUSX7",
"pid":10492,
"log":"jsforce",
"level":50,
"msg":"{\"code\":\"ENOTFOUND\",\"errno\":\"ENOTFOUND\",\"syscall\":\"getaddrinfo\",\"hostname\":\"resourceful-moose-286285-dev-ed.my.salesforce.com\",\"host\":\"resourceful-moose-286285-dev-ed.my.salesforce.com\",\"port\":443}",
"time":"2018-11-28T17:31:56.668Z",
"v":0
}
] |
Are you listening to stderr in your automation? Here is a blog post I wrote that might help you prevent things like that from breaking your automation in the future. In terms of the error, the display command does some additional mapping on other orgs to make sure we have up to date information on a scratch org. It is supposed to be cached but sometimes it can't or there may be a bug in there. Honestly, we should probably just remove that logic but that is a little bit more work. I'll mark this as a bug since I don't think we should be throwing errors for a different org when running display, but in all honestly, we probably won't get to this one in a long while. Once we finish open sourcing all the CLI code, I may mark this one as help wanted. |
@amphro yes, I was doing |
This is hopefully fixed in |
This should be fixed in the new open-source version. You can try it early, here: #835 |
closing because the new |
Summary
Basically I have an org that I did not use for a long time, which is also not expired, and SF started to throw an exception while running
sfdx force:org:display -u ANY_ORG_ALIAS
, like the one in the image below:obs: this image is from another user that has the same problem as I had.
This exception causes a big problem for automations that uses sfdx. For instance, in Node, if this exception is not catched in a try/catch block, the automation stops, even when the command shows a success result at the end. This started to happen recently, like two months ago I never had this problem. But I can't tell you which version the problem started.
Steps To Reproduce:
I have no idea how you can reproduce it. It happend only for some Scratch Orgs, even when I was not displaying that particular org connection details. For instance, the error was saying something about Org A, while executing
sfdx force:org:display -u ORG_B
.But I know how I fixed the problem. To fix this issue I first tried to update sfdx, but it did not work. Then I went to
%USERNAME%\.sfdx
and deleted the file for the org sfdx was throwing the exception (the one that is displayed) from that folder, and the problem was fixed.Expected result
sfdx force:org:display should never throw an exception if it displays a success result.
Actual result
sfdx force:org:display throws an exception but it also works
Additional information
SFDX CLI Version(to find the version of the CLI engine run sfdx --version): sfdx-cli/7.78.1-5a65d9dd2f
OS and version: Windows 10
The text was updated successfully, but these errors were encountered: