jupyterhub / traefik-proxy

JupyterHub proxy implementation with traefik
https://jupyterhub-traefik-proxy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
54 stars 29 forks source link

TLJH: Rules.toml can't be replaced #111

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello, I'm trying to use TLJK in a LXC, Ubuntu 16.04 updated. I follow the default configuration (not very complicated ...) but i have some issues when starting jupyterhub.

/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub_traefik_proxy/traefik_utils.py:42: RuntimeWarning: Escape character '_' cannot be a safe character. Set allow_collisions=True if you want to allow ambiguous escaped strings. return server_type + "_" + escapism.escape(routespec, safe=safe) [E 2020-05-29 11:16:45.215 JupyterHub app:2718] Traceback (most recent call last): File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub/app.py", line 2716, in launch_instance_async await self.start() File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub/app.py", line 2614, in start await self.proxy.check_routes(self.users, self._service_map) File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub/proxy.py", line 63, in locked_method return await method(*args, **kwargs) File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub/proxy.py", line 394, in check_routes await gen.multi(futures) File "/opt/tljh/hub/lib/python3.6/site-packages/tornado/gen.py", line 501, in callback result_list.append(f.result()) File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub_traefik_proxy/toml.py", line 191, in add_route self.toml_dynamic_config_file, self.routes_cache File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub_traefik_proxy/traefik_utils.py", line 153, in persist_routes toml.dump(routes_dict, config_fd) File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__ next(self.gen) File "/opt/tljh/hub/lib/python3.6/site-packages/jupyterhub_traefik_proxy/traefik_utils.py", line 137, in atomic_writing os.replace(fileobj.name, path) OSError: [Errno 16] Device or resource busy: '/opt/tljh/state/rules.toml-tmp-57z3bbg6' -> '/opt/tljh/state/rules.toml'

I don't understand why, but sometimes i can't even go to the first page because of this error, and sometimes i can login with the first user, then the jupyter notebook can't load because it can't create the URL for my notebook (and same problem, it can't replace the temp rules in the rules.toml), depending on if i i systemctl stop/start traefik before starting jupyterhub, or even by using the /opt/tljh/hub/lib/python3.6/site-packages/tljh/jupyterhub_config.py --upgrade-db command in the /opt/tljh/state directory.

Any ideas ?

Thanks a lot !

GeorgianaElena commented 4 years ago

Hey @JordanDelorme and thanks for reporting this issue.

I'm trying to use TLJK in a LXC, Ubuntu 16.04 updated.

TLJH requires Ubuntu > 18.04. There should have been an error about this coming from here

I don't understand why, but sometimes i can't even go to the first page because of this error, and sometimes i can login with the first user, then the jupyter notebook can't load because it can't create the URL for my notebook (and same problem, it can't replace the temp rules in the rules.toml), depending on if i i systemctl stop/start traefik before starting jupyterhub, or even by using the /opt/tljh/hub/lib/python3.6/site-packages/tljh/jupyterhub_config.py --upgrade-db command in the /opt/tljh/state directory.

Maybe using lsof can help identify the process that has the file opened?