{"action":"created","issue":{"url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/874","repository_url":"https://api.github.com/repos/jupyterhub/jupyterhub","labels_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/874/labels{/name}","comments_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/874/comments","events_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/874/events","html_url":"https://github.com/jupyterhub/jupyterhub/issues/874","id":190005332,"number":874,"title":"DELETE /api/users/{name}/server ... stops server, but then restarts new one automatically","user":{"login":"Analect","id":4063815,"avatar_url":"https://avatars.githubusercontent.com/u/4063815?v=3","gravatar_id":"","url":"https://api.github.com/users/Analect","html_url":"https://github.com/Analect","followers_url":"https://api.github.com/users/Analect/followers","following_url":"https://api.github.com/users/Analect/following{/other_user}","gists_url":"https://api.github.com/users/Analect/gists{/gist_id}","starred_url":"https://api.github.com/users/Analect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Analect/subscriptions","organizations_url":"https://api.github.com/users/Analect/orgs","repos_url":"https://api.github.com/users/Analect/repos","events_url":"https://api.github.com/users/Analect/events{/privacy}","received_events_url":"https://api.github.com/users/Analect/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-17T10:30:00Z","updated_at":"2016-11-18T12:13:04Z","closed_at":null,"body":"**How to reproduce the issue**\r\nRun up a JupyterHub using the latest 0.7b1 release, as per this pending [pull request](https://github.com/jupyterhub/jupyterhub-deploy-docker/pull/27). I'm using it in conjunction with JupyterLab.  I manually added tokens for a number of users into the jupyter_config.py file, as per [here](https://github.com/jupyterhub/jupyterhub/blob/master/docs/source/rest.md#adding-tokens-to-the-config-file).\r\n\r\n**What you expected to happen**\r\nFor the server to be stopped and the relevant user's 'server' container to be removed.\r\n\r\n**What actually happens**\r\nContainer state prior to sending the DELETE API call:\r\n```\r\nCONTAINER ID        IMAGE                                                         COMMAND                  CREATED              STATUS              PORTS                            NAMES\r\na185f614d2d7        mydockerregistry.com:5050/jupyter/datascience-notebook:jlab0.1   \"tini -- start-single\"   About a minute ago   Up About a minute   8888/tcp                         jupyter-testuser\r\n46c891d3e0e7        mydockerregistry.com:5050/jupyter/jupyterhub:0.7.0b1_jlab        \"jupyterhub -f /srv/j\"   30 minutes ago       Up 30 minutes       0.0.0.0:443->443/tcp, 8000/tcp   jupyterhub\r\n```\r\nThe API call succeeds with a 204 response.  As per below, the 'server' container is stopped and removed.  However, a new one is immediately started.  Perhaps this is a resiliency feature built into the [jupyterhub-deploy-docker](https://github.com/jupyterhub/jupyterhub-deploy-docker) implementation, although I haven't been able to find it documented anywhere.  If so, is there a parameter I can pass in the DELETE API call that could over-ride this behaviour.\r\n\r\nGiven there's no multi-server feature per user at this point, ideally, I'm looking to be able to stop a user's server (via the API) and spawn a separate one, but potentially pointing to a different image ... and so I don't want it restarting with the same image automatically, as it is doing now.\r\n\r\n```\r\njupyterhub | [I 2016-11-17 09:49:28.709 JupyterHub orm:207] Removing user testuser from proxy\r\njupyterhub | [I 2016-11-17 09:49:28.717 JupyterHub dockerspawner:474] Stopping container jupyter-testuser (id: a185f61)\r\njupyterhub | [I 2016-11-17 09:49:28.910 JupyterHub dockerspawner:480] Removing container jupyter-testuser (id: a185f61)\r\njupyterhub | [I 2016-11-17 09:49:28.942 JupyterHub base:388] User testuser server took 0.231 seconds to stop\r\njupyterhub | [I 2016-11-17 09:49:28.950 JupyterHub log:100] 204 DELETE /hub/api/users/testuser/server (testuser@172.18.0.2) 247.23ms\r\njupyterhub | [I 2016-11-17 09:49:30.061 JupyterHub log:100] 302 GET /user/testuser/api/terminals?1479376171385 (@172.18.0.2) 2.68ms\r\njupyterhub | [I 2016-11-17 09:49:30.084 JupyterHub dockerspawner:332] Container 'jupyter-testuser' is gone\r\njupyterhub | [W 2016-11-17 09:49:30.084 JupyterHub dockerspawner:303] container not found\r\njupyterhub | [I 2016-11-17 09:49:30.105 JupyterHub dockerspawner:332] Container 'jupyter-testuser' is gone\r\njupyterhub | [I 2016-11-17 09:49:30.154 JupyterHub dockerspawner:394] Created container 'jupyter-testuser' (id: 256a16d) from image mydockerregistry.com:5050/jupyter/datascience-notebook:jlab0.1\r\njupyterhub | [I 2016-11-17 09:49:30.154 JupyterHub dockerspawner:404] Starting container 'jupyter-testuser' (id: 256a16d)\r\njupyterhub | [I 2016-11-17 09:49:31.468 JupyterHub base:322] User testuser server took 1.383 seconds to start\r\njupyterhub | [I 2016-11-17 09:49:31.468 JupyterHub orm:188] Adding user testuser to proxy /user/testuser => http://172.18.0.3:8888\r\njupyterhub | [I 2016-11-17 09:49:31.482 JupyterHub log:100] 302 GET /hub/user/testuser/api/terminals?1479376171385 (testuser@172.18.0.2) 1400.89ms\r\n```\r\nContainer state a few seconds after the DELETE API call:\r\n```\r\nCONTAINER ID        IMAGE                                                         COMMAND                  CREATED             STATUS              PORTS                            NAMES\r\n256a16d573a3        mydockerregistry.com:5050/jupyter/datascience-notebook:jlab0.1   \"tini -- start-single\"   37 seconds ago      Up 35 seconds       8888/tcp                         jupyter-testuser\r\n46c891d3e0e7        mydockerregistry.com:5050/jupyter/jupyterhub:0.7.0b1_jlab        \"jupyterhub -f /srv/j\"   32 minutes ago      Up 32 minutes       0.0.0.0:443->443/tcp, 8000/tcp   jupyterhub\r\n```\r\n\r\n**Share what version of JupyterHub you are using**\r\n0.7b1 (as per top)\r\nRunning `jupyter troubleshoot` from the command line, if possible, and posting\r\nits output would also be helpful.\r\n\r\n`jupyter troubleshoot` output here:\r\nhttps://gist.github.com/Analect/b77f07b67e11b25b6a7635713804b310\r\n"},"comment":{"url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/comments/261518203","html_url":"https://github.com/jupyterhub/jupyterhub/issues/874#issuecomment-261518203","issue_url":"https://api.github.com/repos/jupyterhub/jupyterhub/issues/874","id":261518203,"user":{"login":"Analect","id":4063815,"avatar_url":"https://avatars.githubusercontent.com/u/4063815?v=3","gravatar_id":"","url":"https://api.github.com/users/Analect","html_url":"https://github.com/Analect","followers_url":"https://api.github.com/users/Analect/followers","following_url":"https://api.github.com/users/Analect/following{/other_user}","gists_url":"https://api.github.com/users/Analect/gists{/gist_id}","starred_url":"https://api.github.com/users/Analect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Analect/subscriptions","organizations_url":"https://api.github.com/users/Analect/orgs","repos_url":"https://api.github.com/users/Analect/repos","events_url":"https://api.github.com/users/Analect/events{/privacy}","received_events_url":"https://api.github.com/users/Analect/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T12:13:04Z","updated_at":"2016-11-18T12:13:04Z","body":"Just as a follow-up to the above .. .when I eventually close the empty JupyterLab browser window, the automatic re-spawning resolves itself.  But it seems to suggest that for whatever reason .. that terminal pinging back to the hub was alive in there somewhere .. .but not visible as an entity in any of the windows ... and not showing up under the 'terminal sessions' area."}}
{"actor":{"display_login":"Analect"}}