Skip to content

Cannot connect to jupyter/ipython instance #185

Closed

Description

@jzuhone

When attempting to run a jupyter notebook or qtconsole, I get error messages like this:

Invalid argument (bundled/zeromq/src/tcp_address.cpp:171)

The normal ipython prompt works fine.

Activity

  1. sunilmut commented on Apr 14, 2016

    @sunilmut
    Member

    Thanks for trying this out. Could you collect a strace for the failing command to what might be failing?

  2. chrisgorgo commented on May 19, 2016

    @chrisgorgo

    It seems that this bug is caused by jupyter/notebook#1331

  3. arthurhjorth commented on May 19, 2016

    @arthurhjorth

    Trying to get the same thing to run too, and with the same result. I'm on a Surface 3 4GB/128GB and happy to aid with testing/pinning things down. Jupyter is such an excellent tool and being able to run this on Bash on Windows would be amazing.

  4. guydepauw commented on May 20, 2016

    @guydepauw

    Same setup as Arthur Hjorth (@arthurhjorth) here and also happy to help out. Loving bash on windows so far. Getting jupyter up and running would be the icing on the cake.

  5. aseering commented on May 27, 2016

    @aseering
    Contributor

    I came up with a workaround based on William Guss (@MadcowD) 's investigation on jupyter/notebook#1331 . I submitted it upstream as zeromq/libzmq#2013 , and posted an updated Ubuntu 14.04 package to a PPA in case anyone would like to try to use it.

    Standard disclaimers -- I make no guarantees about either security or correctness; if it eats your data or steps on your cat I take no responsibility. But it seems to work for me.

    Of course, getting a fix into WSL would be ideal. My cursory understanding of this code is that WSL would need to implement getifaddrs(), and would I think need to at minimum report on the existence of a loopback interface.

  6. sgraphics commented on Jun 12, 2016

    @sgraphics

    Adam Seering (@aseering) can you please explain how to use this fix? I can 'make install' for libzmq from repo source (including this fix) but how do I setup Jupyter to use the custom libzmq build? - it is still giving the same error that is quoted in the original post. Thank you!

  7. aseering commented on Jun 12, 2016

    @aseering
    Contributor

    sgraphics are you familiar with Ubuntu PPAs? I would suggest using the PPA that I created that contains the fix. The simplest way to do so would be, I believe:

    sudo add-apt-repository ppa:aseering/wsl
    sudo apt-get update
    sudo apt-get install libzmq3
    

    That last command would normally install Ubuntu's libzmq; but because you've added my PPA containing the updated package, it will get the updated package instead.

    If you want to inspect the source code, you're welcome to download it from the PPA's website (see the link above). You can also follow the first two steps above, then run apt-get source libzmq3, which will download the source code for the package to the current directory. Note that PPAs can contain updated versions of any package; you should only add PPAs that you trust.

    Unfortunately, make install will not work in this case: The upstream version that contains the fix is also too new to work on Ubuntu 14.04. The PPA contains the same fix but applied to the source code used by the official Ubuntu 14.04 package. (I downloaded the Ubuntu source using apt-get source, then used quilt to apply the diff containing my fix, and uploaded the updated package.)

  8. guydepauw commented on Jun 15, 2016

    @guydepauw

    Adam Seering (@aseering) this works perfectly. Thanks a million!

  9. pulinagrawal commented on Jul 13, 2016

    @pulinagrawal

    Adam Seering (@aseering)
    I am getting an error 'Invalid argument' in line 190 of tcp_address.cpp even after updating the libzmq3 as you described above.
    I couldn't build from source because it was asking for source URI when I was trying to download source.

  10. jzuhone commented on Jul 13, 2016

    @jzuhone
    Author

    I had the same issue as Pulin Agrawal (@pulinagrawal).

    On Jul 13, 2016, at 11:22 AM, Pulin Agrawal [email protected] wrote:

    Adam Seering (@aseering)

    I am getting an error 'Invalid argument' in line 190 of tcp_address.cpp even after updating the libzmq3 as you described above.
    I couldn't build from source because it was asking for source URI when I was trying to download source.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub, or mute the thread.

  11. aseering commented on Jul 14, 2016

    @aseering
    Contributor

    Pulin Agrawal (@pulinagrawal) John ZuHone (@jzuhone) -- hm... Could you post the output of dpkg -l libzmq3? It should indicate that you have version 4.0.4+dfsg-2wsl1 installed. (The wsl1 at the end is the key.)

  12. aseering commented on Jul 14, 2016

    @aseering
    Contributor

    I've posted a bug report about this issue to the Ubuntu libzmq3 bugtracker:

    https://bugs.launchpad.net/ubuntu/+source/zeromq3/+bug/1602900

    The fix is known; hopefully they will agree to backport it so that WSL users don't have to keep doing this dance to install packages from a PPA.

  13. mrsiamen commented on Jul 16, 2016

    @mrsiamen

    this fix doesn't work for my Surface 3...
    I can still see the message
    Invalid argument (bundled/zeromq/src/tcp_address.cpp:171)

    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name Version Architecture Description
    +++-========================-=================-=================-=====================================================
    ii libzmq3:amd64 4.0.4+dfsg-2wsl1 amd64 lightweight messaging kernel (shared library)

  14. aseering commented on Jul 16, 2016

    @aseering
    Contributor

    mrsiamen -- it sounds like you have the new package but it's not getting used for some reason. Is this a clean install of WSL? Did you try installing libzmq3 yourself before using the PPA?

    Could you post the results of the following commands?:

    ldd /usr/lib/python2.7/dist-packages/zmq/backend/cython/utils.x86_64-linux-gnu.so | grep zmq
    md5sum /usr/lib/x86_64-linux-gnu/libzmq.so.3.1.0
    

    For reference, on my machine, I see:

    $ ldd /usr/lib/python2.7/dist-packages/zmq/backend/cython/utils.x86_64-linux-gnu.so | grep zmq
            libzmq.so.3 => /usr/lib/x86_64-linux-gnu/libzmq.so.3 (0x00007f72cc2a0000)
    $ md5sum /usr/lib/x86_64-linux-gnu/libzmq.so.3
    87b97738b28a38a8e89796ecd41862b0  /usr/lib/x86_64-linux-gnu/libzmq.so.3.1.0
    
  15. 98 remaining items

  16. ggada commented on Apr 17, 2017

    @ggada

    Thanks John ZuHone (@jzuhone)!

    conda install -c jzuhone zeromq=dev fixed this for me. The apt-get one didn't work probably because I am using conda environment.

    Not going for the fast ring because I've faced BSOD's before.. ;)

  17. ericweijieli commented on Jun 29, 2017

    @ericweijieli

    Thanks John ZuHone (@jzuhone)!
    → conda install -c jzuhone zeromq=4.1.dev0 works for me!

  18. ahsteven commented on Dec 20, 2017

    @ahsteven

    How to get tensorflow gpu support? I have cuda and tensorflow-gpu installed on Windows but not on Windows bash. Any suggestions on using the GPU with GYM on windows Bash.

  19. Yangff commented on Dec 20, 2017

    @Yangff

    ahsteven it's impossible to run tensorflow with gpu on WSL.

  20. WSLUser commented on Dec 20, 2017

    @WSLUser

    Yangff Did you try using VcxSrv to run it with 17063? (I'm unable to go Insiders to test myself). You can now run VSCode from WSL so I wouldn't be surprised if other GUI dev tools are able to work now too. It will be interesting to see what now works and what still doesn't and what is preventing them at this point from running.

  21. ahsteven commented on Dec 20, 2017

    @ahsteven
  22. phobson commented on Jan 10, 2018

    @phobson

    Despite John ZuHone (@jzuhone)'s herculean efforts on his build of zeromq, my WSL/jupyter installation isn't working with matplotlib.

    For example, a notebook consisting simply of:

    from matplotlib import pyplot
    pyplot.plot([1, 2, 3], [3, 1, 2], 'ko')

    Kills the kernel.

    Is this still expected on non-Insider builds of Windows 10? Should bug my IT department to let me into the Insider program?

    Output of `conda list`
    paul@POR-PHOBSON10:/mnt/c/Users/phobson$ conda list
    # packages in environment at /home/paul/miniconda:
    #
    _nb_ext_conf              0.4.0                    py35_1
    anaconda-client           1.6.6            py35h6b90917_0
    asn1crypto                0.23.0           py35h4ab26a5_0
    beautifulsoup4            4.6.0            py35h442a8c9_1
    bleach                    2.1.1            py35hd5e75dd_0
    ca-certificates           2017.08.26           h1d4fec5_0
    certifi                   2017.11.5        py35h9749603_0
    cffi                      1.11.2           py35hc7b2db7_0
    chardet                   3.0.4            py35hb6e9ddf_1
    clyent                    1.2.2            py35h491ffcb_1
    conda                     4.4.7                    py35_0
    conda-build               3.2.1                    py35_0
    conda-env                 2.6.0                h36134e3_1
    conda-verify              2.0.0            py35he912c7b_0
    cryptography              2.1.4            py35hbeb2da1_0
    cycler                    0.10.0           py35hc4d5149_0
    dbus                      1.10.22              h3b5a359_0
    decorator                 4.1.2            py35h3a268aa_0
    entrypoints               0.2.3            py35h48174a2_2
    expat                     2.2.5                he0dffb1_0
    filelock                  2.0.13           py35h4160c53_0
    fontconfig                2.12.4               h88586e7_1
    freetype                  2.8                  hab7d2ae_1
    glib                      2.53.6               h5d9569c_2
    glob2                     0.6              py35hff66265_0
    gmp                       6.1.2                h6c8ec71_1
    gst-plugins-base          1.12.2               he3457e5_0
    gstreamer                 1.12.2               h4f93127_0
    html5lib                  1.0.1            py35h2f9c1c0_0
    icu                       58.2                 h9c2bf20_1
    idna                      2.6              py35h8605a33_1
    intel-openmp              2018.0.0             hc7b2577_8
    ipykernel                 4.7.0            py35h2f9c1c0_0
    ipython                   6.2.1            py35hd850d2a_1
    ipython_genutils          0.2.0            py35hc9e07d0_0
    ipywidgets                7.0.5            py35h8147dc1_0
    jedi                      0.11.0                   py35_2
    jinja2                    2.10             py35h480ab6d_0
    jpeg                      9b                   h024ee3a_2
    jsonschema                2.6.0            py35h4395190_0
    jupyter                   1.0.0            py35hd38625c_0
    jupyter_client            5.1.0            py35h2bff583_0
    jupyter_console           5.2.0            py35h4044a63_1
    jupyter_core              4.4.0            py35ha89e94b_0
    libedit                   3.1                  heed3624_0
    libffi                    3.2.1                hd88cf55_4
    libgcc                    7.2.0                h69d50b8_2
    libgcc-ng                 7.2.0                h7cc24e2_2
    libgfortran-ng            7.2.0                h9f7466a_2
    libiconv                  1.15                 h63c8f33_5
    libpng                    1.6.32               hbd3595f_4
    libsodium                 1.0.15               hf101ebd_0
    libstdcxx-ng              7.2.0                h7a57d05_2
    libxcb                    1.12                 hcd93eb1_4
    libxml2                   2.9.4                h2e8b1d7_6
    markupsafe                1.0              py35h4f4fcf6_1
    matplotlib                2.1.1            py35ha26af80_0
    mistune                   0.8.1            py35h9251d8c_0
    mkl                       2018.0.1             h19d6760_4
    nb_anacondacloud          1.4.0                    py35_0
    nb_conda                  2.2.1            py35hccc8299_0
    nb_conda_kernels          2.1.0                    py35_0
    nbconvert                 5.3.1            py35hc5194e3_0
    nbformat                  4.4.0            py35h12e6e07_0
    nbpresent                 3.0.2            py35h9c03491_1
    ncurses                   6.0                  h9df7e31_2
    notebook                  5.2.2            py35he644770_0
    numpy                     1.14.0           py35h3dfced4_0
    openssl                   1.0.2n               hb7f436b_0
    packaging                 16.8             py35h2260b46_1
    pandoc                    1.19.2.1             hea2e7c5_1
    pandocfilters             1.4.2            py35h1565a15_1
    parso                     0.1.1            py35h1b200a3_0
    patchelf                  0.9                  hf79760b_2
    path.py                   10.5             py35h39c98c1_0
    pcre                      8.41                 hc27e229_1
    pexpect                   4.3.0            py35hf410859_0
    pickleshare               0.7.4            py35hd57304d_0
    pip                       9.0.1            py35h7e7da9d_4
    pkginfo                   1.4.1            py35hb526c55_1
    prompt_toolkit            1.0.15           py35hc09de7a_0
    ptyprocess                0.5.2            py35h38ce0a3_0
    pyasn1                    0.4.2            py35h8f845f4_0
    pycosat                   0.6.3            py35h6b6bb97_0
    pycparser                 2.18             py35h61b3040_1
    pycrypto                  2.6.1            py35h9852db7_1
    pygments                  2.2.0            py35h0f41973_0
    pyopenssl                 17.5.0           py35h4f8b8c8_0
    pyparsing                 2.2.0            py35h041ed72_1
    pyqt                      5.6.0            py35h0e41ada_5
    pysocks                   1.6.7            py35h6aefbb0_1
    python                    3.5.4               h417fded_24
    python-dateutil           2.6.1            py35h90d5b31_1
    pytz                      2017.3           py35hb13c558_0
    pyyaml                    3.12             py35h46ef4ae_1
    pyzmq                     16.0.2                   py35_0
    qt                        5.6.2               h974d657_12
    qtconsole                 4.3.1            py35h4626a06_0
    readline                  7.0                  ha6073c6_4
    requests                  2.18.4           py35hb9e6ad1_1
    ruamel_yaml               0.11.14          py35h8e2c16b_2
    setuptools                36.5.0           py35ha8c1747_0
    simplegeneric             0.8.1            py35h2ec4104_0
    sip                       4.18.1           py35h9eaea60_2
    six                       1.11.0           py35h423b573_1
    sqlite                    3.20.1               hb898158_2
    terminado                 0.6              py35hce234ed_0
    testpath                  0.3.1            py35had42eaf_0
    tk                        8.6.7                hc745277_3
    tornado                   4.5.2            py35hf879e1d_0
    traitlets                 4.3.2            py35ha522a97_0
    urllib3                   1.22             py35h2ab6e29_0
    wcwidth                   0.1.7            py35hcd08066_0
    webencodings              0.5.1            py35hb6cf162_1
    wheel                     0.30.0           py35hd3883cf_1
    widgetsnbextension        3.0.8            py35h84cb72a_0
    xz                        5.2.3                h55aa19d_2
    yaml                      0.1.7                had09818_2
    zeromq                    4.1.dev0                      0    jzuhone
    zlib                      1.2.11               ha838bed_2
    
  23. sunilmut commented on Jan 11, 2018

    @sunilmut
    Member

    Paul Hobson (@phobson) - Can you clarify what you mean by Kilss the kernel.? Are you getting a blue (or green) screen of death? i.e. Is your Windows crashing? If so, can you please follow the instructions for BSOD here?

    Also, which version of Windows are you running. From your WSL bash prompt, output of cmd.exe /c ver

  24. phobson commented on Jan 12, 2018

    @phobson

    Sunil Muthuswamy (@sunilmut)

    Sorry I wasn't clear. I meant that trying to plot in a jupyter notebook with matplotlib was killing the ipython kernel. The windows/WSL/linux kernels were fine.

    I was just digging back into this and working with my IT department. I'm not sure which if these incantations did the trick, but we upgraded my windows build to 1709 and then uninstalled/reinstalled WSL/Ubuntu via lxrun and and it worked!

    🤷‍♂️

  25. sunilmut commented on Jan 12, 2018

    @sunilmut
    Member

    Paul Hobson (@phobson) - Thanks for the details. Good to know your issue was resolved. There is significant investment going into WSL. So, staying on the latest Windows release will always give you the most mileage, at least that's what we aim for.

  26. therealkenc commented on Mar 24, 2018

    @therealkenc

    The OP here was:

    Invalid argument (bundled/zeromq/src/tcp_address.cpp:171)
    

    Which was:

        //  Get the addresses.
        ifaddrs *ifa = NULL;
        const int rc = getifaddrs (&ifa);
        errno_assert (rc == 0);
        zmq_assert (ifa != NULL);
    

    Which is #308 addressed in 15007 and Creators Update 15063.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions