danielballan / remotekernel

15 stars 2 forks source link

OSError: [Errno 99] Cannot assign requested address #4

Open inksink opened 7 years ago

inksink commented 7 years ago

I have fixed the problem https://github.com/danielballan/remotekernel/issues/3 by jupyter-notebook --MappingKernelManager.kernel_manager_class=remotekernel.manager.RemoteIOLoopKernelManager --KernelSpecManager.kernel_spec_class=remotekernel.kernelspec.RemoteKernelSpec, then I found another problem: <remotekernel.kernelspec.RemoteKernelSpec object at 0x7f06724d16a0> [E 17:37:34.459 NotebookApp] Unhandled error in API request Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/notebook/base/handlers.py", line 503, in wrapper result = yield gen.maybe_future(method(self, *args, **kwargs)) File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1015, in run value = future.result() File "/usr/local/lib/python3.5/dist-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/usr/local/lib/python3.5/dist-packages/notebook/services/sessions/handlers.py", line 75, in post type=mtype)) File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1015, in run value = future.result() File "/usr/local/lib/python3.5/dist-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/usr/local/lib/python3.5/dist-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name) File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1015, in run value = future.result() File "/usr/local/lib/python3.5/dist-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/usr/local/lib/python3.5/dist-packages/notebook/services/sessions/sessionmanager.py", line 92, in start_kernel_for_session self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name) File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1015, in run value = future.result() File "/usr/local/lib/python3.5/dist-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "<string>", line 3, in raise_exc_info File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 285, in wrapper yielded = next(result) File "/usr/local/lib/python3.5/dist-packages/notebook/services/kernels/kernelmanager.py", line 87, in start_kernel super(MappingKernelManager, self).start_kernel(**kwargs) File "/usr/local/lib/python3.5/dist-packages/jupyter_client/multikernelmanager.py", line 110, in start_kernel km.start_kernel(**kwargs) File "/usr/local/lib/python3.5/dist-packages/remotekernel/manager.py", line 63, in start_kernel self.write_connection_file() File "/usr/local/lib/python3.5/dist-packages/jupyter_client/connect.py", line 407, in write_connection_file kernel_name=self.kernel_name File "/usr/local/lib/python3.5/dist-packages/jupyter_client/connect.py", line 99, in write_connection_file sock.bind((ip, 0)) OSError: [Errno 99] Cannot assign requested address [E 17:37:34.465 NotebookApp] { "Cookie": "_xsrf=2|751f9433|cbbba28a0b60396e500baeeb347e2e43|1496733840; username-8888-hopeful-bhabha-yangyang-brw-local-brainpp-ml-8080=\"2|1:0|10:1496819037|63:username-8888-hopeful-bhabha-yangyang-brw-local-brainpp-ml-8080|44:ZDhmOGQxZjFhNjE3NDRkZjliNjQ5MWU5NGQ0YTIzZmI=|3e12c3042d7a9a3af8e10dda12f7d4d3a40932e537f045ad9cbfa243871739aa\"", "Host": "8888.hopeful-bhabha.yangyang.brw.local.brainpp.ml:8080", "Referer": "http://8888.hopeful-bhabha.yangyang.brw.local.brainpp.ml:8080/notebooks/Untitled.ipynb?kernel_name=remote", "Accept-Language": "zh-CN,zh;q=0.8", "Accept": "application/json, text/javascript, */*; q=0.01", "X-Xsrftoken": "2|751f9433|cbbba28a0b60396e500baeeb347e2e43|1496733840", "X-Forwarded-For": "127.0.0.1", "X-Requested-With": "XMLHttpRequest", "Content-Type": "application/json", "Content-Length": "90", "Accept-Encoding": "gzip, deflate", "Origin": "http://8888.hopeful-bhabha.yangyang.brw.local.brainpp.ml:8080", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" }

danielballan commented 7 years ago

Try editing /usr/local/lib/python3.5/dist-packages/jupyter_client/connect.py" and replacing sock.bind((ip, 0)) with sock.bind(('', 0)). This change reverts back to how jupyter_client used to read. I need to look into submitting a proper fix upstream to jupyter_client.