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

Getting the error "Assertion failed (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 320" while module installation by npm #2979

Closed

Description

@SergeKornilov

I get the error "Assertion failed (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 320" trying to install any module by npm via proxy, for example, request or cheerio:

npm config set proxy http://username:password@proxy.company.com:8080
npm config set https-proxy https://username:password@proxy.company.com:8080

npm install cheerio

//

Thus, request module is not installed at all, and cheerio module is installed without dependencies.

//

npm --version
2.14.3

node --version
v4.1.0

OS: windows xp sp3

Activity

  1. added
    tlsIssues and PRs related to the tls subsystem.
    on Sep 21, 2015
  2. ChALkeR commented on Sep 21, 2015

    @ChALkeR
    Member
  3. rvagg commented on Sep 21, 2015

    @rvagg
    Member

    /cc @nodejs/crypto, @nodejs/platform-windows (windows xp sp3 sets off red flags for me)

  4. thefourtheye commented on Sep 21, 2015

    @thefourtheye
    Contributor

    Npm folks might also be interested. cc @othiym23 @zkat @iarna

  5. changed the title [-]Getting the error "Assertion failed (wrap->ssl_) != (nullprt), file src\tls_wrap.cc, line 320" while module installation by npm[/-] [+]Getting the error "Assertion failed (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 320" while module installation by npm[/+] on Sep 21, 2015
  6. indutny commented on Sep 21, 2015

    @indutny
    Member

    Will look at it today...

  7. indutny commented on Sep 21, 2015

    @indutny
    Member

    I think it may be related to the Windows XP indeed. Checking the libuv code with this regards.

  8. indutny commented on Sep 21, 2015

    @indutny
    Member

    Hm... looks like I was wrong about it, the order of callbacks should be correct even on XP. Continuing the search.

  9. indutny commented on Sep 21, 2015

    @indutny
    Member

    I think it may be a windows-specific thing. May I ask you to give a try to the following patch:

    diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js
    index 1bff757..fc9696f 100644
    --- a/lib/_tls_wrap.js
    +++ b/lib/_tls_wrap.js
    @@ -296,7 +296,11 @@ proxiedMethods.forEach(function(name) {
    
     tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) {
       if (this._parentWrap && this._parentWrap._handle === this._parent) {
    -    setImmediate(cb);
    +    if (this._parentWrap._handle)
    +      this._parentWrap.once('close', cb);
    +    else
    +      setImmediate(cb);
    +
         return this._parentWrap.destroy();
       }
       return this._parent.close(cb);

    Hopefully, it will fix the problem


    @saghul a question about Windows and uv_close(). There is lots of endgames and everything for cancelling the request. Could it be the case that the uv_close_cb is not invoked on next libuv tick on Windows?

  10. indutny commented on Sep 21, 2015

    @indutny
    Member

    Relevant PR: #2991

  11. saghul commented on Sep 22, 2015

    @saghul
    Member

    a question about Windows and uv_close(). There is lots of endgames and everything for cancelling the request. Could it be the case that the uv_close_cb is not invoked on next libuv tick on Windows?

    Yes, AFAIK cancellation could take a bit, so the uv_close callback is not guaranteed to run exactly on the next tick.

  12. indutny commented on Sep 24, 2015

    @indutny
    Member

    @SergeKornilov may I ask you to test this patch? I have really good expectations from it. Let me know if you need some help with building this thing.

  13. SergeKornilov commented on Sep 25, 2015

    @SergeKornilov
    Author

    @indutny It something goes wrong when I try to build node.js. I follow installation guide:

    1. Start "Visual Studio Command prompt (2010)"
    2. Execute "set path=c:\python27;c:\python27\lib;%path%"
    3. Execute "python --version" to check and get the result "Python 2.7.10"
    4. Then execute "vcbuild.bat release x86" and get nothing.

    What's wrong here? obsolet version of VS?

  14. indutny commented on Sep 25, 2015

    @indutny
    Member

    cc @nodejs/release how do we do builds for Windows?

  15. 24 remaining items

  16. ChALkeR commented on Oct 7, 2015

    @ChALkeR
    Member

    @indutny Am I correct that the problem could be observed only on windows platform?

  17. indutny commented on Oct 7, 2015

    @indutny
    Member

    @ChALkeR so far it looks like this

  18. veneMarcos commented on Oct 7, 2015

    @veneMarcos

    I have the same problem in Win XP.
    I try install a express with command line npm install express -g and I get the msg ""Assertion failed (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 320"

  19. veneMarcos commented on Oct 8, 2015

    @veneMarcos

    Where do I put this code?

    • I do not find the file tls_wrap.cc.
  20. ChALkeR commented on Oct 8, 2015

    @ChALkeR
    Member

    @veneMarcos tls_wrap.cc is here: https://github.com/nodejs/node/blob/master/src/tls_wrap.cc , but I'm not exactly sure why are you trying to find it. The patch is against _tls_wrap.js, which could be found here: https://github.com/nodejs/node/blob/master/lib/_tls_wrap.js .

  21. wwwork commented on Oct 12, 2015

    @wwwork

    I get the same error on win xp, when I've run npm install

    npm --proxy http://191.168.1.1:3128 --without-ssl --insecure install string.
    I think it because I using proxy in my local arean network.

    node --version
    v4.1.2

  22. indutny commented on Oct 12, 2015

    @indutny
    Member

    Please give it a try to node.js 4.2.0 . The problem should be fixed there.

  23. SergeKornilov commented on Oct 13, 2015

    @SergeKornilov
    Author

    Thank you very much! 4.2.0 really works great!

  24. veneMarcos commented on Oct 13, 2015

    @veneMarcos

    Thank you, this version 4.2.0 works fine.

  25. indutny commented on Oct 13, 2015

    @indutny
    Member

    Whoa, looks like it was a good call to include that fix into release. Thank you!

  26. mypuem commented on Apr 11, 2016

    @mypuem

    I'm seeing this issue in node 4.4 running on win 7 and ubuntu 14.04.4 LTS. The error is printed when an ssl socket is closed. I'm only using the built in modules http, https, crypto. My code runs fine without the https module. Sorry if I've posted in the wrong place but this is the only reference I can find to this error. The error message is "Assertion failed: (wrap->ssl_) != (nullptr), file src\tls_wrap.cc, line 319".

  27. bnoordhuis commented on Apr 11, 2016

    @bnoordhuis
    Member

    @mypuem If you still get that with the latest v4.x release (v4.4.2 at the time of writing), can you file a new issue and include steps to reproduce? The test case should preferably not depend on any third-party modules.

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

    tlsIssues and PRs related to the tls subsystem.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions