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

Kernel Error: No mapping between account names and security IDs was done #5042

Closed
wRaq opened this issue Nov 11, 2019 · 3 comments
Closed

Kernel Error: No mapping between account names and security IDs was done #5042

wRaq opened this issue Nov 11, 2019 · 3 comments

Comments

@wRaq
Copy link

wRaq commented Nov 11, 2019

Traceback (most recent call last):
File "d:\pyt\lib\site-packages\tornado\web.py", line 1699, in _execute
result = await result
File "d:\pyt\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "d:\pyt\lib\site-packages\notebook\services\sessions\handlers.py", line 72, in post
type=mtype))
File "d:\pyt\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "d:\pyt\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "d:\pyt\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 88, in create_session
kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name)
File "d:\pyt\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "d:\pyt\lib\site-packages\tornado\gen.py", line 742, in run
yielded = self.gen.throw(*exc_info) # type: ignore
File "d:\pyt\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 101, in start_kernel_for_session
self.kernel_manager.start_kernel(path=kernel_path, kernel_name=kernel_name)
File "d:\pyt\lib\site-packages\tornado\gen.py", line 735, in run
value = future.result()
File "d:\pyt\lib\site-packages\tornado\gen.py", line 209, in wrapper
yielded = next(result)
File "d:\pyt\lib\site-packages\notebook\services\kernels\kernelmanager.py", line 168, in start_kernel
super(MappingKernelManager, self).start_kernel(**kwargs)
File "d:\pyt\lib\site-packages\jupyter_client\multikernelmanager.py", line 110, in start_kernel
km.start_kernel(**kwargs)
File "d:\pyt\lib\site-packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "d:\pyt\lib\site-packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "d:\pyt\lib\site-packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "d:\pyt\lib\contextlib.py", line 82, in enter
return next(self.gen)
File "d:\pyt\lib\site-packages\jupyter_client\connect.py", line 100, in secure_write
win32_restrict_file_to_user(fname)
File "d:\pyt\lib\site-packages\jupyter_client\connect.py", line 58, in win32_restrict_file_to_user
admins, _domain, _type = win32security.LookupAccountName("", "Administrators")
pywintypes.error: (1332, 'LookupAccountName', 'No mapping between account names and security IDs was done.')

Help me, please!

@wRaq
Copy link
Author

wRaq commented Nov 11, 2019

Answer:
jupyter/jupyter_client#478
jupyter/jupyter_client@9af6e14

@wRaq wRaq closed this as completed Nov 11, 2019
@MrTrick
Copy link

MrTrick commented Apr 8, 2020

I am getting this same error, when running Jupyter Notebook as a service using nssm as per these instructions.

pywintypes.error: (1332, 'LookupAccountName', 'No mapping between account names and security IDs was done.')

I'm running the latest component versions, I think:

Package            Version
------------------ -------
jupyter            1.0.0
jupyter-client     6.1.2
jupyter-console    6.1.0
jupyter-core       4.6.3
notebook           6.0.3
pywin32            227
pywinpty           0.5.7
...other packages not listed

@asmak9
Copy link

asmak9 commented Jan 15, 2021

Hello Everyone,

If anyone still having this issue especially when using NSSM software on Windows 10 or Windows Server 2019. I have fixed it by manually applying the fix jupyter/jupyter_client#478. One more important if you still face same issue even after applying the above fix then do follow i.e.

  1. Manually verify Lib\site-packages\jupyter_client\connect.py file contains following lines i.e.

admins = win32security.CreateWellKnownSid(win32security.WinBuiltinAdministratorsSid)
user, _domain, _type = win32security.LookupAccountName("", win32api.GetUserName())

  1. Manually verify Lib\site-packages\jupyter_core\paths.py file contains following lines i.e.

user, _domain, _type = win32security.LookupAccountName("", win32api.GetUserName())

This will fix the issue.

Thanks & Regards,
Asma Khalid

Website: https://www.asmak9.com/
E-Store Bytezaar: https://www.bytezaar.com/
Q&A Forum: http://forum.asmak9.com/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants