镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

EINVAL during syscall=connect #13431

Description

@pdkovacs
  • Version: v6.10.3
  • Platform: Linux pici 4.9.27-v7+ #997 SMP Tue May 9 19:58:37 BST 2017 armv7l armv7l armv7l GNU/Linux
  • Subsystem: net (?)

I am getting the following error when trying to access a host via HTTP:

2017-05-28T07:20:04.765Z - error:  Error: connect EINVAL 108.160.151.39:443
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
2017-05-28T07:20:04.781Z - error: stopping... code=EINVAL, errno=EINVAL, syscall=connect, address=108.160.151.39, port=443

Activity

  1. added
    netIssues and PRs related to the net subsystem.
    on Jun 3, 2017
  2. addaleax commented on Jun 3, 2017

    @addaleax
    Member

    Can you make sure that you can connect to the same host and port combination using other tools, e.g. nc? If so, can you try to attach strace to node and share the output?

  3. gireeshpunathil commented on Jun 3, 2017

    @gireeshpunathil
    Member

    I guess the end-point is an HTTPS one - assumption based on the port number.

  4. bnoordhuis commented on Jun 3, 2017

    @bnoordhuis
    Member

    Can you post your code? Are you using the localAddress or localPort options?

  5. pdkovacs commented on Jun 3, 2017

    @pdkovacs
    Author

    Can you make sure that you can connect to the same host and port combination using other tools, e.g. nc

    I got this error after the same code executed successfully hundreds of thousands of times. (Sure I can connect with other tools.)

    I probably should have mentioned in the problem description that this is a sporadic error. In fact this is the first time I saw this error after the same code executed about half a million times without error. (I earlier observed two other errors as well (once each): EAI_AGAIN and ENOTFOUND. But these are "operational" errors, whereas EINVAL smells a software bug.)

    Can you post your code?

    https://github.com/pdkovacs/noip-updater/blob/master/src/backend/MyPublicIpChecker.ts#L33
    The request options used in this case were:

            {
                protocol: 'https:',
                host: 'whatismypublicip.com',
                method: 'GET'
            }
    

    Are you using the localAddress or localPort options?

    Probably not (not explicitly at least). See above.

  6. pdkovacs commented on Jun 3, 2017

    @pdkovacs
    Author

    If so, can you try to attach strace to node and share the output?

    I will, if the error re-occurs at least once more. ;-)

  7. gireeshpunathil commented on Mar 30, 2018

    @gireeshpunathil
    Member

    closing due to inactivity, please re-open with requested data, if still outstanding

  8. oxygen commented on Oct 4, 2018

    @oxygen

    I'm getting this using Linux Subsystem for Windows (WSL).

    After many https:// outgoing requests, and only when doing hundreds or thousands of them in a short period (but not concurrently, and even with artificially added 100ms pause between requests), the above starts to happen, exactly as described by the author of the bug.

    The connectivity is cut down both ways (the listening server is also cut off from listening along with all existing connections; which has nothing to do with the client functionality, which is also cut off).

    Other apps running alongside (some Linux native ones and another NodeJS app) are unaffected, but cannot talk to this one that is showing the above behaviour.

    If you are not familiar with WSL, it is worth mentioning it does not have the Linux kernel, but an ABI compatible layer, so it could be that NodeJS is not at fault. Just leaving this here, maybe it will help rule out the OS as a culprit after more evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    netIssues and PRs related to the net subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions