n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.18k stars 187 forks source link

Error: Address in use from zmq #180

Open barik opened 5 years ago

barik commented 5 years ago

When I attempt to restart a Jupyter kernel from within the jupyter notebook GUI (Kernel > Restart) on Windows 10 I receive the following error in the console:

c:\opt\nvm\v11.6.0\node_modules\ijavascript\node_modules\zeromq\lib\index.js:451
  this._zmq.bindSync(addr);
            ^

Error: Address in use
    at exports.Socket.Socket.bindSync (c:\opt\nvm\v11.6.0\node_modules\ijavascript\node_modules\zeromq\lib\index.js:451:13)
    at Kernel._bindSockets (c:\opt\nvm\v11.6.0\node_modules\ijavascript\node_modules\jp-kernel\lib\jp-kernel.js:262:19)
    at new Kernel (c:\opt\nvm\v11.6.0\node_modules\ijavascript\node_modules\jp-kernel\lib\jp-kernel.js:244:10)
    at Object.<anonymous> (c:\opt\nvm\v11.6.0\node_modules\ijavascript\lib\kernel.js:69:14)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)

I'm not sure how to isolate this problem, but I suspect it is Windows-specific somehow. Versions of things:

I followed the instructions from the zeromq NPM package page to allow ZMQ to compile from source (Windows > Option 2).

n-riesco commented 5 years ago

My guess is that Jupyter Notebook tries to kill the kernel and fails.

I'll find a Windows box and see if I can debug the issue.

Regardless of the cause, I'm thinking of adding a flag to workaround this issue and let the kernel die when it receives a restart request; e.g.:

ijsinstall --kill-on-restart
Wismin-Effendi commented 5 years ago

I also have issue with running Jupyter notebook on Windows 10 after successful installation.

I just tried to add simple console.log('Hello there'); run but no output. Stuck with sand clock on the browser tab icon. And the [*] next to the cell.

On the powershell console. I found the following error messages: Error: Cannot find module '../build/Release/zmq.node' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object.<anonymous> (C:\Users\wismi\AppData\Roaming\npm\node_modules\ijavascript\node_modules\zeromq\lib\index.js:6:11) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) [I 18:11:29.679 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports internal/modules/cjs/loader.js:583 throw err; ^