Jupyterhub: Server crashes on start with SyntaxError

Created on 27 Nov 2018  路  3Comments  路  Source: jupyterhub/jupyterhub

Hi all. I have been trying to set up JupyterHub on an AWS instance running Ubuntu 16.04 LTS but have run into a confusing problem.

jupyter@REDACTED:~$ jupyterhub notebook --SudoSpawner.sudospawner_path=/usr/local/bin/sudospawner
[I 2018-11-27 15:15:26.738 JupyterHub app:1673] Using Authenticator: jupyterhub.auth.PAMAuthenticator-0.9.4
[I 2018-11-27 15:15:26.739 JupyterHub app:1673] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-0.9.4
[I 2018-11-27 15:15:26.747 JupyterHub app:1016] Loading cookie_secret from /home/jupyter/jupyterhub_cookie_secret
[I 2018-11-27 15:15:26.765 JupyterHub proxy:431] Generating new CONFIGPROXY_AUTH_TOKEN
[W 2018-11-27 15:15:26.766 JupyterHub app:1173] No admin users, admin interface will be unavailable.
[W 2018-11-27 15:15:26.766 JupyterHub app:1174] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2018-11-27 15:15:26.766 JupyterHub app:1201] Not using whitelist. Any authenticated user will be allowed.
[I 2018-11-27 15:15:26.803 JupyterHub app:1855] Hub API listening on http://127.0.0.1:8081/hub/
[W 2018-11-27 15:15:26.803 JupyterHub proxy:472] Found proxy pid file: /home/jupyter/jupyterhub-proxy.pid
[W 2018-11-27 15:15:26.803 JupyterHub proxy:484] Proxy no longer running at pid=4079
[W 2018-11-27 15:15:26.804 JupyterHub proxy:565] Running JupyterHub without SSL.  I
hope there is SSL termination happening somewhere else...
[I 2018-11-27 15:15:26.804 JupyterHub proxy:567] Starting proxy @ http://:8000
/usr/local/lib/node_modules/configurable-http-proxy/node_modules/winston/lib/winston.js:11
const { warn } = require('./winston/common');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/configurable-http-proxy/bin/configurable-http-proxy:14:13)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
[C 2018-11-27 15:15:27.801 JupyterHub app:1867] Failed to start proxy
    Traceback (most recent call last):
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/app.py", line 1865, in start
        await self.proxy.start()
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/proxy.py", line 594, in start
        _check_process()
      File "/usr/local/lib/python3.5/dist-packages/jupyterhub/proxy.py", line 590, in _check_process
        raise e from None
    RuntimeError: Proxy failed to start with exit code 1

This occurs both when running it normally and when running with SudoSpawner. It seems that the main Python process is trying to interpret a JS source file; I don't know enough about the Jupyter codebase to understand what's going on.

Any help would be appreciated!

Most helpful comment

@00Kai0 thanks for providing this information, but can you elaborate a little more when this dependency has been changed? I see from my logs that jupyterhub v0.9.3 worked with npm v3.5.2. (still the most up-to-date version available by Ubuntu, which seems to be the documented way to install it as described at https://jupyterhub.readthedocs.io/en/stable/quickstart.html )

At that time configurable-http-proxy was v3.1.1 whereas now it is [email protected]
It seems that the problem is the latter, not the version of npm. Downgrading configurable-http-proxy to v3.1.1 seems to fix the issue even while continuing to use npm v3.5.2

Thanks for the tip though, it lead me on the right path.

All 3 comments

Print your npm verison, it must > v6.0 and npm install -g configurable-http-proxy.
Are you use sudo apt-get install npm to install npm ?

@00Kai0 thanks for providing this information, but can you elaborate a little more when this dependency has been changed? I see from my logs that jupyterhub v0.9.3 worked with npm v3.5.2. (still the most up-to-date version available by Ubuntu, which seems to be the documented way to install it as described at https://jupyterhub.readthedocs.io/en/stable/quickstart.html )

At that time configurable-http-proxy was v3.1.1 whereas now it is [email protected]
It seems that the problem is the latter, not the version of npm. Downgrading configurable-http-proxy to v3.1.1 seems to fix the issue even while continuing to use npm v3.5.2

Thanks for the tip though, it lead me on the right path.

@davidedelvento I think you are right. My version is [email protected]. If you want to use this version, you must upgrade your nodejs to LTS version and download from here https://nodejs.org/en/. The version of nodejs in apt-get is outdated.

If you don't know how to install it, I recommend you to use anaconda, it is always useful.

Thanks for your feedback.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iptizer picture iptizer  路  3Comments

matteoacrossi picture matteoacrossi  路  4Comments

sarath145p picture sarath145p  路  4Comments

barrachri picture barrachri  路  3Comments

nabriis picture nabriis  路  4Comments