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

Failed to create system user #17

Open
jameholme opened this issue Oct 4, 2019 · 7 comments
Open

Failed to create system user #17

jameholme opened this issue Oct 4, 2019 · 7 comments

Comments

@jameholme
Copy link

jameholme commented Oct 4, 2019

[I 2019-10-04 14:20:32.534 JupyterHub ldapauthenticator:290] Creating 'jholme' user home directory using command 'mkhomedir_helper jholme'
[E 2019-10-04 14:20:32.538 JupyterHub web:1788] Uncaught exception POST /hub/login?next= (::ffff:IPADDRESS)
    HTTPServerRequest(protocol='https', host='company.com', method='POST', uri='/hub/login?next=', version='HTTP/1.1', remote_ip='::ffff:IPADDRESS)
    Traceback (most recent call last):
      File "/usr/local/lib64/python3.6/site-packages/tornado/web.py", line 1699, in _execute
        result = await result
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/handlers/login.py", line 144, in post
        user = await self.login_user(data)
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/handlers/base.py", line 697, in login_user
        user = await self.auth_to_user(authenticated)
      File "/usr/local/lib/python3.6/site-packages/jupyterhub/handlers/base.py", line 676, in auth_to_user
        await maybe_future(self.authenticator.add_user(user))
      File "/usr/local/lib/python3.6/site-packages/ldapauthenticator/ldapauthenticator.py", line 269, in add_user
        yield gen.maybe_future(self.add_user_home_dir(username))
      File "/usr/local/lib/python3.6/site-packages/ldapauthenticator/ldapauthenticator.py", line 295, in add_user_home_dir
        raise RuntimeError("Failed to create system user %s: %s" % (username, err))
    RuntimeError: Failed to create system user jholme:

[E 2019-10-04 14:20:32.548 JupyterHub log:166] {
      "X-Forwarded-Host": "company.com",
      "X-Forwarded-Proto": "https",
      "X-Forwarded-Port": "443",
      "X-Forwarded-For": "::ffff:IPADDRESS",
      "Accept-Language": "en-US,en;q=0.9",
      "Accept-Encoding": "gzip, deflate, br",
      "Referer": "https://company.com/hub/login",
      "Sec-Fetch-Site": "same-origin",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
      "Sec-Fetch-User": "?1",
      "Sec-Fetch-Mode": "navigate",
      "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36",
      "Content-Type": "application/x-www-form-urlencoded",
      "Upgrade-Insecure-Requests": "1",
      "Origin": "https://company.com",
      "Cache-Control": "max-age=0",
      "Content-Length": "51",
      "Connection": "close",
      "Host": "company.com"
    }
[E 2019-10-04 14:20:32.548 JupyterHub log:174] 500 POST /hub/login?next= (@::ffff:IPADDRESS 796.90ms

As you can see, it authenticates against the LDAP server, but fails to create user/home directory

@enlznep
Copy link

enlznep commented Oct 8, 2019

Same issue. Any updates on this?

@jameholme
Copy link
Author

jameholme commented Oct 8, 2019

No updates. I am still unable to resolve this. It seems the 'mkhomedir_helper' isn't working. Even when I attempt it manually on the CLI, it does nothing.

@arunoruto
Copy link

Had the same issue and used the following command to get around the error:
c.LDAPAuthenticator.create_user_home_dir_cmd = ['adduser', '-m']

@jameholme
Copy link
Author

jameholme commented Nov 3, 2019

Did you have to update the ldap auth script? Or just the jupyterhub config file? I will try this out on Monday, thanks!

@arunoruto
Copy link

Did you have to update the ldap auth script? Or just the jupyterhub config file? I will try this out on Monday, thanks!

I used a new container every time I was trying to figure out to make it work. So I just tried to see what will happen and it worked like a charm.
I don't know if this is a valid fix or a temporary workaround, but it does the same thing as mkhomedir_helpmer but also adds the user to the system (which was the problem for me).

@jameholme
Copy link
Author

Same here, I tried it out, -m didn't work for me, had to use --create-home.

Otherwise it worked! Thanks!

@billtzim
Copy link

Had the same issue and used the following command to get around the error: c.LDAPAuthenticator.create_user_home_dir_cmd = ['adduser', '-m']

Faced the same problem, saw this post and found solution with one small correction.
The command to be used is useradd and NOT adduser. The useradd has the -m or --create-home paramater

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

4 participants