Skip to content

Lost remote after 10000ms - Issue connecting to zerorpc server after packaging python #28

Open

Description

@spsvision

After packaging the python executable with Pyinstaller, I suddenly have issues with the zerorpc server. It appears that my issue comes after execFile the python executable. I'm able to create the pyprocess, but it isn't able to connect to the python script as it did before when it was just spawning off the script.

This is the exact error:
D:_\pyCal\renderer.js:14 Error: Lost remote after 10000ms
at Object.createErrorResponse
(D:_\pyCal\node_modules\zerorpc\lib\util.js:53)
at ClientChannel.
(D:_\pyCal\node_modules\zerorpc\lib\client.js:163)
at emitOne (events.js:96)
at ClientChannel.emit (events.js:191)
at D:_\pyCal\node_modules\zerorpc\lib\channel.js:198
client.invoke @ D:_\pyCal\renderer.js:14
callbackErrorWrapper @ D:_\pyCal\node_modules\zerorpc\lib\client.js:105
(anonymous) @ D:_\pyCal\node_modules\zerorpc\lib\client.js:164
emitOne @ events.js:96
emit @ events.js:191
(anonymous) @ D:_\pyCal\node_modules\zerorpc\lib\channel.js:198

Activity

  1. jhampl commented on Aug 3, 2018

    @jhampl

    Same problem here.

  2. rishantagarwal commented on Sep 7, 2018

    @rishantagarwal

    I appreciate all the effort and hardwork put in by you @fyears . This is a great open source project and is quite helpful.

    I am getting the same error as mentioned above except after i package the app, it is not able to connect to the server. Do you have any suggestions for this ? @fyears

  3. rishantagarwal commented on Sep 7, 2018

    @rishantagarwal

    I tried running the executable directly and it fails with error
    screen shot 2018-09-07 at 17 20 23

  4. kamranIoTDeveloper commented on Apr 15, 2019

    @kamranIoTDeveloper

    I am also getting same issue, it seems zerorpc don't work in exe file. Anyone found solution?

  5. brainytwoo commented on Jun 19, 2019

    @brainytwoo

    Not sure if the issue is exactly the same but I was getting the same error. I fixed it by installing zerorpc via pip. pip install zerorpc

  6. tepsukka commented on Nov 1, 2019

    @tepsukka

    I compared an old working package to a newer one that didn't work, and noticed that some folders and files were missing. I'm not sure which of the following fixed it for me, but here's what I did:

    • Uninstalled every other python version that I had
    • Reinstalled Python 3.6.3, installed it for every user and chose to install pip, tcl, tkinter, with precompiled standard library
    • Reinstalled all the other libraries with pip, such as pyinstaller, requests, etc
    • Reinstalled pypiwin32 with pip

    For reference, here's a comparison between a working and non working file/folder structure

    WORKING (Python 3.6.3)

    certifi
    Include
    lib2to3
    tcl
    tk
    zmq
    api.exe
    api.exe.manifest
    base_library.zip
    gevent.libev.corecext.pyd
    gevent._semaphore.pyd
    greenlet.pyd
    msgpack._packer.pyd
    msgpack._unpacker.pyd
    MSVCP140.dll
    pyexpat.pyd
    python36.dll
    pywintypes36.dll
    select.pyd
    tcl86t.dll
    tk86t.dll
    unicodedata.pyd
    VCRUNTIME140.dll
    win32api.pyd
    win32evtlog.pyd
    win32wnet.pyd
    zmq.backend.cython.constants.pyd
    zmq.backend.cython.context.pyd
    zmq.backend.cython.error.pyd
    zmq.backend.cython.message.pyd
    zmq.backend.cython.socket.pyd
    zmq.backend.cython.utils.pyd
    zmq.backend.cython._device.pyd
    zmq.backend.cython._poll.pyd
    zmq.backend.cython._version.pyd
    _bz2.pyd
    _ctypes.pyd
    _decimal.pyd
    _elementtree.pyd
    _hashlib.pyd
    _lzma.pyd
    _multiprocessing.pyd
    _socket.pyd
    _ssl.pyd
    _testcapi.pyd
    _tkinter.pyd
    

    NOT WORKING (Python 3.8)

    api.exe
    api.exe.manifest
    base_library.zip
    libcrypto-1_1.dll
    libffi-7.dll
    libssl-1_1.dll
    pyexpat.pyd
    python38.dll
    select.pyd
    unicodedata.pyd
    VCRUNTIME140.dll
    _asyncio.pyd
    _bz2.pyd
    _ctypes.pyd
    _decimal.pyd
    _elementtree.pyd
    _hashlib.pyd
    _lzma.pyd
    _multiprocessing.pyd
    _overlapped.pyd
    _queue.pyd
    _socket.pyd
    _ssl.pyd
    

    WORKING AFTER REINSTALLATION (Python 3.6.3)

    certifi
    gevent
    gevent-1.4.0-py3.6.egg-info
    Include
    lib2to3
    msgpack
    tcl
    tk
    win32com
    zmq
    api.exe
    api.exe.manifest
    base_library.zip
    greenlet.cp36-win_amd64.pyd
    mfc140u.dll
    MSVCP140.dll
    pyexpat.pyd
    python36.dll
    pythoncom36.dll
    pywintypes36.dll
    select.pyd
    tcl86t.dll
    tk86t.dll
    unicodedata.pyd
    VCRUNTIME140.dll
    win32api.pyd
    win32evtlog.pyd
    win32trace.pyd
    win32ui.pyd
    win32wnet.pyd
    _bz2.pyd
    _cffi_backend.cp36-win_amd64.pyd
    _ctypes.pyd
    _decimal.pyd
    _elementtree.pyd
    _hashlib.pyd
    _lzma.pyd
    _multiprocessing.pyd
    _socket.pyd
    _ssl.pyd
    _testcapi.pyd
    _tkinter.pyd
    _win32sysloader.pyd
    
  7. tramngo1603 commented on Dec 9, 2019

    @tramngo1603

    I also experienced this issue when completing the tutorial with Windows 10.
    The specific problem I experienced was with the .bind method. The python program (bundled as an .exe file with pyinstaller) stopped immediately without logging any errors when it called the .bind method.
    When I used pdb.set_trace() to debug the issue, this is what I found when stepping through the program:

    > .\dist\add\add.exe 4242                                               
    > c:\users\tram ngo\desktop\src\electron-python\add.py(14)main()
    -> s.bind(addr)
    (Pdb) s
    --Call--
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\socket.py(42)bind()
    (Pdb) s
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\socket.py(43)bind()
    (Pdb) s
    --Call--
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(322)bind()
    (Pdb) s
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(323)bind()
    (Pdb) s
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(324)bind()
    (Pdb) s
    --Call--
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(305)_resolve_endpoint()
    (Pdb) list
    [EOF]
    (Pdb) n
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(306)_resolve_endpoint()
    (Pdb) list
    [EOF]
    (Pdb) n
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(307)_resolve_endpoint()
    (Pdb) n
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(308)_resolve_endpoint()
    (Pdb) n
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(313)_resolve_endpoint()
    (Pdb) n
    --Return--
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(313)_resolve_endpoint()->['tcp://127.0.0.1:4242']
    (Pdb) list
    [EOF]
    (Pdb) n
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(325)bind()
    (Pdb) s
    > c:\users\tram ngo\desktop\src\electron-python\site-packages\zerorpc\events.py(326)bind()
    

    How I fixed it:

    Originally I used Python 2.7 to install Zerorpc and pyinstaller. When I switched to Python 3.7 (in a virtualenv), it worked! I'm not sure why upgrading python version fixed the issue.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions