question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to start Jupyter service with configurable-http-proxy 4.4.0

See original GitHub issue

Bug description

With configurable-http-proxy version 4.4.0, JupyterHub failed to start proxy. Output:

/usr/lib/node_modules/configurable-http-proxy/node_modules/prom-client/lib/metrics/osMemoryHeapLinux.js:57
			} catch {
			        ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/lib/node_modules/configurable-http-proxy/node_modules/prom-client/lib/metrics/osMemoryHeap.js:4:22) 

Expected behaviour

I expected JupyterHub service to start as usual with the config proxy adding default route for Hub > http://127.0.0.1:8081

Actual behaviour

May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.563 JupyterHub proxy:666] Starting proxy @ http://:8000

How to reproduce

My instance is created with an ansible playbook where I had the npm module install configurable-http-proxy globally. Which now uses version 4.4.0 by default, which triggered this bug. Currently I have version: ‘4.3.2’ added to my playbook and everything is back up and running.

Your personal set up

jupyterhub version 1.3.0 Python 3.6.9 Ubuntu 18.04 nginx 1.14.0

  • Configuration
# jupyterhub_config.py
c.Spawner.default_url = '/lab?reset'
c.Spawner.notebook_dir = '~'
c.Authenticator.admin_users = {'ubuntu'}
  • Logs
# paste relevant logs here, if any
May 31 10:37:46 my-instance systemd[1]: Started Jypyter Hub daemon.
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.507 JupyterHub app:2349] Running JupyterHub version 1.3.0
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.508 JupyterHub app:2380] Using Authenticator: jupyterhub.auth.PAMAuthenticator-1.3.0
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.508 JupyterHub app:2380] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-1.3.0
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.508 JupyterHub app:2380] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-1.3.0
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.510 JupyterHub app:1420] Loading cookie_secret from /jupyterhub_cookie_secret
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.524 JupyterHub proxy:460] Generating new CONFIGPROXY_AUTH_TOKEN
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.546 JupyterHub app:1726] Not using allowed_users. Any authenticated user will be allowed.
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.559 JupyterHub app:2419] Initialized 0 spawners in 0.001 seconds
May 31 10:37:46 my-instance jupyterhub[14230]: [W 2021-05-31 10:37:46.561 JupyterHub proxy:529] Found proxy pid file: /jupyterhub-proxy.pid
May 31 10:37:46 my-instance jupyterhub[14230]: [W 2021-05-31 10:37:46.562 JupyterHub proxy:541] Proxy no longer running at pid=14214
May 31 10:37:46 my-instance jupyterhub[14230]: [W 2021-05-31 10:37:46.562 JupyterHub proxy:663] Running JupyterHub without SSL.  I hope there is SSL termination happening somewhere else...
May 31 10:37:46 my-instance jupyterhub[14230]: [I 2021-05-31 10:37:46.563 JupyterHub proxy:666] Starting proxy @ http://:8000
May 31 10:37:46 my-instance jupyterhub[14230]: [E 2021-05-31 10:37:46.567 JupyterHub utils:80] Unexpected error connecting to my-instance:8000 [Errno 22] Invalid argument
May 31 10:37:46 my-instance jupyterhub[14230]: [E 2021-05-31 10:37:46.622 JupyterHub utils:80] Unexpected error connecting to my-instance:8000 [Errno 22] Invalid argument
May 31 10:37:46 my-instance jupyterhub[14230]: /usr/lib/node_modules/configurable-http-proxy/node_modules/prom-client/lib/metrics/osMemoryHeapLinux.js:57
May 31 10:37:46 my-instance jupyterhub[14230]:                         } catch {
May 31 10:37:46 my-instance jupyterhub[14230]:                                 ^
May 31 10:37:46 my-instance jupyterhub[14230]: SyntaxError: Unexpected token {
May 31 10:37:46 my-instance jupyterhub[14230]:     at createScript (vm.js:80:10)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Object.runInThisContext (vm.js:139:10)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Module._compile (module.js:617:28)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Object.Module._extensions..js (module.js:664:10)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Module.load (module.js:566:32)
May 31 10:37:46 my-instance jupyterhub[14230]:     at tryModuleLoad (module.js:506:12)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Function.Module._load (module.js:498:3)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Module.require (module.js:597:17)
May 31 10:37:46 my-instance jupyterhub[14230]:     at require (internal/module.js:11:18)
May 31 10:37:46 my-instance jupyterhub[14230]:     at Object.<anonymous> (/usr/lib/node_modules/configurable-http-proxy/node_modules/prom-client/lib/metrics/osMemoryHeap.js:4:22)
May 31 10:37:46 my-instance jupyterhub[14230]: [E 2021-05-31 10:37:46.758 JupyterHub utils:80] Unexpected error connecting to my-instance:8000 [Errno 22] Invalid argument
May 31 10:37:47 my-instance jupyterhub[14230]: [E 2021-05-31 10:37:47.406 JupyterHub utils:80] Unexpected error connecting to my-instance:8000 [Errno 22] Invalid argument
May 31 10:37:47 my-instance jupyterhub[14230]: [E 2021-05-31 10:37:47.662 JupyterHub utils:80] Unexpected error connecting to my-instance:8000 [Errno 22] Invalid argument
May 31 10:37:47 my-instance jupyterhub[14230]: [C 2021-05-31 10:37:47.662 JupyterHub app:2625] Failed to start proxy
May 31 10:37:47 my-instance jupyterhub[14230]:     Traceback (most recent call last):
May 31 10:37:47 my-instance jupyterhub[14230]:       File "/usr/local/lib/python3.6/dist-packages/jupyterhub/app.py", line 2623, in start
May 31 10:37:47 my-instance jupyterhub[14230]:         await self.proxy.start()
May 31 10:37:47 my-instance jupyterhub[14230]:       File "/usr/local/lib/python3.6/dist-packages/jupyterhub/proxy.py", line 693, in start
May 31 10:37:47 my-instance jupyterhub[14230]:         _check_process()
May 31 10:37:47 my-instance jupyterhub[14230]:       File "/usr/local/lib/python3.6/dist-packages/jupyterhub/proxy.py", line 689, in _check_process
May 31 10:37:47 my-instance jupyterhub[14230]:         raise e from None
May 31 10:37:47 my-instance jupyterhub[14230]:     RuntimeError: Proxy failed to start with exit code 1
May 31 10:37:47 my-instance jupyterhub[14230]:     
May 31 10:37:47 my-instance systemd[1]: jupyterhub.service: Main process exited, code=exited, status=1/FAILURE
May 31 10:37:47 my-instance systemd[1]: jupyterhub.service: Failed with result 'exit-code'.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
ErickSystemcommented, Jun 2, 2021

@Icare2000 and @MvdB202, I came back from version latest (published 7 days ago: 4.4.0) to npm install -g configurable-http-proxy@4.3.2, my issue was solved.

1reaction
dtaniwakicommented, Jun 3, 2021

Sorry for the late response. I agree that we should follow the maintained node versions and test against them in the CI!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to start the Kernel - Jupyter in VS Code - Stack Overflow
I got the same error message because the jupyter package was missing in my selected environment. pip install jupyter.
Read more >
What to do when things go wrong - The Jupyter Notebook
If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command...
Read more >
jupyterhub/jupyterhub - Gitter
Hi, I'm wondering, is it possible to integrate a 3rd-party HTTP-based per-user service into jupyterhub? Basically I would like to, in addition to...
Read more >
Jupyterhub "Failed to start proxy" error
RuntimeError: Proxy failed to start with exit code 0. 1 Like. yuvipanda November 8, 2018, 9:55pm #3. It looks like your configurable-http-proxy isn't ......
Read more >
Jupyter notebook can't connect to the kernel - MongoDB
When I open the notebook your_first_read (or create a new notebook) in the mflix environment, it doesn't connect to the kernel.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found