Mikhail_Sam
Mikhail_Sam

Reputation: 11218

Jupyterhub: PermissionError: [Errno 13] Permission denied: 'jupyterhub-proxy.pid'

I'm trying to install Jupyterhub on Linux server. So I have sudo rights but I'm not a root. I already configured JupyterHub and it's config, so I can run it in single-user mode (from different folders too).

But I have this error when trying to start multi-user as described here: official documentation link.

I faced the same problem before with configurable-http-proxy and jupyterhub.sqlite - the problem was multi-user script try to save this files in system directory (/lib/systemd/system/jupyterhub.service or /etc/systemd/system/jupyterhub.service).

I changes such parameters in jupyter_config.py:

## url for the database. e.g. `sqlite:///jupyterhub.sqlite`
c.JupyterHub.db_url = 'sqlite:////data/jupyterhub/jupyterhub.sqlite'

## DEPRECATED since version 0.8. Use ConfigurableHTTPProxy.command
#c.JupyterHub.proxy_cmd = []
c.ConfigurableHTTPProxy.command = '/data/anaconda3/envs/fraud/bin/configurable-http-proxy'

So I tried the same way for jupyterhub-proxy.pid:

## File to write PID Useful for daemonizing JupyterHub.
c.JupyterHub.pid_file = '/data/jupyterhub/jupyterhub-proxy.pid'

But looks like JupyterHub ignores it and still trying to save it to system directory! I add print to jupyterhub/proxy.py at _write_pid_file(self) function:

self.log.info("Writing log: %s", self.pid_file)
self.log.info("Writing log: %s", os.path.abspath(os.curdir))

Output:

[I 2019-12-19 20:23:50.289 JupyterHub proxy:562] Writing proxy pid file: jupyterhub-proxy.pid

[I 2019-12-19 20:23:50.290 JupyterHub proxy:564] Writing log: /

My idea - maybe there is another one config parameter I need to change, but I can't find anythig relevant.

Upvotes: 2

Views: 2120

Answers (1)

Francesc Torradeflot
Francesc Torradeflot

Reputation: 126

It worked for me setting the c.ConfigurableHTTPProxy.pid_file parameter in the jupyterhub configuration file.

Upvotes: 2

Related Questions