Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Instance allocated in server_tracking DB for some users #15

Open
andrewresearch opened this issue Feb 25, 2019 · 3 comments
Open

New Instance allocated in server_tracking DB for some users #15

andrewresearch opened this issue Feb 25, 2019 · 3 comments

Comments

@andrewresearch
Copy link

We have around 100 students logging in to JupyterHub, and some have found that if they log out, and then log back in they are given a new instance. This is very disconcerting, as it appears as though they have lost all of there previous work!
Looking at AWS, it appears that the old instance is still there and running in AWS, but the student's GitHub account has been associated with a new instance in the server_tracking DB.
Any suggestions on why this has occurred and how to stop it recurring?
Could this be load problem? What causes a new instance to be allocated to a user?
Also, is there a way of tracking down these orphaned instances? Perhaps by matching IP address, or looking for instance IDs that are not in server_tracking?
Thanks. I'd appreciate your assistance.

@farassadek
Copy link
Collaborator

Hi Andrew
Jupyterhub spawn a new instance only when the user login for the first time.
When the user login to the hub, the hub checks the user name in the database. If the username is in the DB, the hub will only start the instance registers for that user.
If the username is not in the database then the hub will launch a new instance and register the username and the instance ID in the database.

Three years ago when I used GitHub module for authentication, I faced the problem of having two instances registered for the same user . It turn out that the user have two GitHub accounts. Therefore, when the user logged in with one account, the hub created an instance and registered the instance id with the username in the database. Later when the same user logged in but with the second account, jupyterhub created different instance for the same user and registered the instance id and the second user name in the database.

You might have the same issue, but if we leave the guessing aside, for me to check what is happening I need to see your jupyterhub logs (located in /var/log/jupyterhub ) and the config file (remove the credentials ). I also need to see your GitHub authentication module and the list of usernames that get multiple instances.

@andrewresearch
Copy link
Author

Thanks Faras, I really appreciate the followup.
For clarity, the students don’t have 2 instances registered to them - I checked the 2 account possibility first.
With a small number of students (but enough to be concerned), when they logout and then log back in they actually get a fresh instance as though they are a new user - even though their username is unchanged.
The old instance is still running on EC2, but they are logging in to a new instance.
It’s as though JupyterHub thinks they are a new user and instead of checking server_tracking, it just goes ahead and creates a new instance which overwrites the old entry for the same username in server_tracking.
My JupyterHub log file is 212MB. I’ll see if I can get it onto S3 and share it with you. Can I do this outside GitHub?
Config file is attached.
Thanks for your help,
Andrew
jupyterhub_config.txt

@farassadek
Copy link
Collaborator

Send a compressed version to my email [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants