BindException : cannot assign requested address: connect

Issue #2095 resolved
Former user created an issue

Hello,

everything was working fine yesterday, but this morning suddenly my IC won’t interact with the remote org anymore. When I do anything related to the org (deploy, anonymous apex, query, … ), I get this error :

BindException invoking https://edifixio--alpha.sandbox.my.salesforce.com/services/Soap/T/54.0/00D5r0000004uiDEAQ: Cannot assign requested address: connect

It’s not an issue from my system or network, since deploying from the command line via SFDX works flawlessly.

My version of IC is 2.2.1.8 (not available in the dropdown below), and here are my IDE logs :

idea.log (I could’nt upload it here)

Thank you in advance for your help !

Comments (14)

  1. Scott Wells repo owner

    Hi. Here's the more complete stack:

    2022-04-29 11:53:58,246 [6852308]   WARN - o.a.c.p.PhaseInterceptorChain - Interceptor for {urn:partner.soap.sforce.com}PartnerService#{urn:partner.soap.sforce.com}query has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: Could not send Message.
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:67)
            ...
        at com.illuminatedcloud.client.ForceComApiClient.lambda$isProductionOrg$11(SourceFile:1327)
        at com.illuminatedcloud.client.ForceComApiClient.runWithClient(SourceFile:299)
        at com.illuminatedcloud.client.ForceComApiClient.runWithClient(SourceFile:394)
        at com.illuminatedcloud.client.ForceComApiClient.isProductionOrg(SourceFile:1326)
        at com.illuminatedcloud.intellij.builder.ForceComBuilder.build(SourceFile:1150)
        at com.illuminatedcloud.intellij.builder.ForceComBuilder.buildForSave(SourceFile:1857)
        at com.illuminatedcloud.intellij.builder.ForceComBuilder.buildForSave(SourceFile:1718)
        at com.illuminatedcloud.intellij.builder.ForceComBuilder.buildForSave(SourceFile:1707)
        at com.illuminatedcloud.intellij.builder.IlluminatedCloudForceSaveAction.deployFiles(SourceFile:99)
        at com.illuminatedcloud.intellij.builder.IlluminatedCloudForceSaveAction.lambda$actionPerformed$0(SourceFile:85)
            ...
    Caused by: java.net.BindException: BindException invoking https://edifixio--alpha.sandbox.my.salesforce.com/services/Soap/u/54.0/00D5r0000004uiDEAQ: Cannot assign requested address: connect
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1400)
        ... 42 more
    Caused by: java.net.BindException: Cannot assign requested address: connect
        at java.base/java.net.PlainSocketImpl.waitForConnect(Native Method)
        at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:107)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
        at java.base/java.net.Socket.connect(Socket.java:609)
        at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:177)
    

    IC2 is just executing PartnerApi.query for the following query:

    SELECT OrganizationType, IsSandbox, TrialExpirationDate
    FROM Organization
    LIMIT 1
    

    What's confusing is that this type of error generally occurs when it's trying to create a server socket and the requested port is already in use, but in this case it's trying to open a client socket connection to a Salesforce org. The normal instance of this issue is resolved by finding the existing process that is using that port and stopping/killing it, but again, this is not what I'd expect.

    I know this seems like a total punt, but does the issue persist if you restart your machine? That might help to remove conflicting processes, though again, this shouldn't have anything to do with other local processes. Just recommending it as part of a process of elimination.

  2. Former user Account Deleted reporter

    Hi, thank you for your quick response.
    I tried to restart my machine and the problem still happens. I also tried to delete and re-create my IC conncection, but no success either.

  3. Scott Wells repo owner

    Is this set up as a native IC2 connection where you had to explicitly enter the username/password and maybe token into an IC2 dialog, or is it an OAuth connection where the login occurred via the browser, even if initiated from IC2? It sounds like the latter since you mentioned being able to work with the org via the CLI. If so, can you remove the connection and re-auth? Again, I know this is all the effective equivalent of "have you tried turning it off and on again", but this error message doesn't match the type of activity so I'm really just trying to corner the issue until I understand it better.

  4. Former user Account Deleted reporter

    Yes it’s an OAuth org, I tried removing the connection and re-authenticating with no success. Auth works but when I try to use anything then, the error pops.
    No problem, I don’t mind trying anything you ask if it helps you to understand the issue. Being also a programmer, I know that "have you tried turning it off and on again" sometimes works !

  5. Scott Wells repo owner

    Okay. And do you see the same issue with any other orgs or is it unique to this one? My guess is that it's only happening with this org since I've never heard about such an issue, and if so we just need to figure out what's different about this org.

  6. Former user Account Deleted reporter

    I just tried by switching on another sandbox and deploying something, and the issue is the same, the URL of the other org appears in the error popup in the same fashion.

  7. Scott Wells repo owner

    Okay. How about a non-sandbox org? Could be a developer edition org or even a scratch org.

  8. Scott Wells repo owner

    Okay. I searched for any previous report of this type of issue and there's been none, so we're definitely in uncharted territory now. I did find this but also doubt that it will help:

    https://help.mulesoft.com/s/article/What-does-java-net-BindException-Cannot-assign-requested-address-mean

    It's worth trying, though. Can you verify that your hosts file has the localhost entry. I would be incredibly surprised if that did it, albeit pleasantly so. The reported issue is including the sandbox hostname in the URL, but again, that doesn't jibe with a BindException which I'd only expect to occur locally when trying to initialize a server socket.

    I'll keep looking while you try that.

  9. Former user Account Deleted reporter

    Hello, thank you for your research. I followed the instructions and and added the localhost entry to the hosts file, and rebooted my PC. Sadly, as you expected, it did not fix our problem, the error still pops.

  10. Former user Account Deleted reporter

    I just noticed that my IntelliJ seems to struggle accessing the network not only with Illuminated Cloud ; the plugin browser can’t list plugins from the marketplace.

    I’ll try a full reinstall of IntelliJ and plugins and see where it takes me, I’ll keep you posted.

  11. Former user Account Deleted reporter

    After a full reinstallation of intelliJ and plugins, the problem persists. After testing a few features, like SSH, database, etc… I can confirm that the issue is not with IC but with anything requiring an outbound connection in IntelliJ.
    I’ll contact Jetbrains support and keep you posted here when I have the solution.

  12. Scott Wells repo owner

    Okay, I'm glad you were able to generalize the issue. I'll be very curious to hear what they say.

  13. Scott Wells repo owner

    Generalized to the JetBrains IDE so not an IC2-specific issue. Resolving but I'd still love to hear the diagnosis and solution if possible.

  14. Log in to comment