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

Fix Kernel Startup on WIndows #478

Merged
merged 1 commit into from
Sep 17, 2019
Merged

Fix Kernel Startup on WIndows #478

merged 1 commit into from
Sep 17, 2019

Conversation

victorsamun
Copy link

Get administrators SID in correct way

@MSeal
Copy link
Contributor

MSeal commented Sep 16, 2019

Ahh I see why that would be an issue. Thanks for catching. I can't easily test this on a non-english windows setup, does the kernel startup ok after this change or is there any other concerns with the user fetching in non-english context that you're aware of?

@victorsamun
Copy link
Author

I tested it on russian Windows setup. The kernel startup ok after this change.
Moreover, almost all tests are failed before fix, now they passed.

@MSeal
Copy link
Contributor

MSeal commented Sep 16, 2019

Perfect, I'll run the tests on my machine tonight get this hotfix rolled out then. Thanks for helping fix it.

@ismael-elatifi
Copy link

ismael-elatifi commented Sep 16, 2019

I confirm this fix is working on my side too (french language).
For info I had this error when opening a notebook :

pywintypes.error: (1332, 'LookupAccountName', 'Le mappage entre les noms de compte et les ID de sécurité n’a pas été effectué.')

which translates to : "the mapping between the account names and the security IDs has not been done."
I applied the fix manually in the file C:\Program Files\Python37\Lib\site-packages\jupyter_client\connect.py and it works !
Thanks a lot for the fix !

@MSeal
Copy link
Contributor

MSeal commented Sep 17, 2019

Tested and merging. Will get a release out later today.

@MSeal MSeal merged commit edf6bed into jupyter:5.x Sep 17, 2019
@felixnext
Copy link

felixnext commented Sep 17, 2019

I did update the line in my Jupyter Installation (client version 5.3.2, English Windows Build 18362.356, Python 3.5). It solves the direct crash regarding the LookupAccountName. However, if I start a kernel jupyter lab will simply close, without displaying any error message.

@MSeal
Copy link
Contributor

MSeal commented Sep 17, 2019

@felixnext Can you launch from a command prompt to get the crash error message? It may be unrelated to this change.

@felixnext
Copy link

@MSeal already did with the --debug flag. Output I am getting:

[D 18:47:36.489 LabApp] Looking for jupyter_config in C:\ProgramData\jupyter
[D 18:47:36.502 LabApp] Looking for jupyter_config in c:\users\felix\appdata\local\programs\python\python35\etc\jupyter
[D 18:47:36.503 LabApp] Looking for jupyter_config in C:\Users\Felix\.jupyter
[D 18:47:36.512 LabApp] Looking for jupyter_config in C:\Programming
[D 18:47:36.517 LabApp] Looking for jupyter_notebook_config in C:\ProgramData\jupyter
[D 18:47:36.519 LabApp] Looking for jupyter_notebook_config in c:\users\felix\appdata\local\programs\python\python35\etc\jupyter
[D 18:47:36.519 LabApp] Looking for jupyter_notebook_config in C:\Users\Felix\.jupyter
[D 18:47:36.521 LabApp] Looking for jupyter_notebook_config in C:\Programming
[D 18:47:37.015 LabApp] Terminals not available (error was No module named 'terminado')
[W 18:47:37.019 LabApp] JupyterLab server extension not enabled, manually loading...
[I 18:47:37.033 LabApp] JupyterLab extension loaded from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\jupyterlab
[I 18:47:37.034 LabApp] JupyterLab application directory is c:\users\felix\appdata\local\programs\python\python35\share\jupyter\lab
[I 18:47:37.410 LabApp] Serving notebooks from local directory: C:\Programming\github\udacity\stock_trend_analysis
[I 18:47:37.410 LabApp] 0 active kernels
[I 18:47:37.412 LabApp] The Jupyter Notebook is running at: http://localhost:8888/?token=f536fd818b3016ae0d81b58fba0ed5f36c207051805c25e4
[I 18:47:37.413 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:47:37.416 LabApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=f536fd818b3016ae0d81b58fba0ed5f36c207051805c25e4
[D 18:47:37.423 LabApp] 200 GET /api/sessions?1568738853035 (127.0.0.1) 2.00ms
[D 18:47:37.428 LabApp] Using contents: services/contents
[D 18:47:37.466 LabApp] Path base/images/favicon.ico served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\base\images\favicon.ico
[D 18:47:37.468 LabApp] Path components/jquery-ui/themes/smoothness/jquery-ui.min.css served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\jquery-ui\themes\smoothness\jquery-ui.min.css
[D 18:47:37.469 LabApp] Path components/jquery-typeahead/dist/jquery.typeahead.min.css served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\jquery-typeahead\dist\jquery.typeahead.min.css
[D 18:47:37.471 LabApp] Path style/style.min.css served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\style\style.min.css
[D 18:47:37.473 LabApp] Path components/es6-promise/promise.min.js served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\es6-promise\promise.min.js
[D 18:47:37.474 LabApp] Path components/preact/index.js served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\preact\index.js
[D 18:47:37.476 LabApp] Path components/proptypes/index.js served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\proptypes\index.js
[D 18:47:37.479 LabApp] Path components/preact-compat/index.js served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\preact-compat\index.js
[D 18:47:37.480 LabApp] Path components/requirejs/require.js served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\components\requirejs\require.js
[D 18:47:37.482 LabApp] Path base/images/logo.png served from c:\users\felix\appdata\local\programs\python\python35\lib\site-packages\notebook\static\base\images\logo.png
[W 18:47:37.484 LabApp] 404 GET /metrics?1568738853372 (::1) 57.00ms referer=http://localhost:8888/lab
[D 18:47:37.502 LabApp] 200 GET /api/contents/?content=1&1568738853375 (::1) 15.00ms
[I 18:47:37.840 LabApp] Accepting one-time-token-authenticated connection from ::1
[D 18:47:37.848 LabApp] Using contents: services/contents
[D 18:47:37.861 LabApp] 200 GET /lab?token=2b117ccec15720cdca434e9a538541775a89435fd24ea769 (::1) 21.00ms
[D 18:47:37.909 LabApp] Path main.f723825c0024a62d4234.js served from c:\users\felix\appdata\local\programs\python\python35\share\jupyter\lab\static\main.f723825c0024a62d4234.js
[D 18:47:37.923 LabApp] 304 GET /static/lab/main.f723825c0024a62d4234.js (::1) 15.00ms
[D 18:47:37.931 LabApp] Path vendors~main.a8c1de6e5fac1c35fc76.js served from c:\users\felix\appdata\local\programs\python\python35\share\jupyter\lab\static\vendors~main.a8c1de6e5fac1c35fc76.js
[D 18:47:37.933 LabApp] 304 GET /static/lab/vendors~main.a8c1de6e5fac1c35fc76.js (::1) 3.00ms
[D 18:47:38.857 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:38.859 LabApp] 200 GET /api/sessions?1568738858852 (::1) 2.00ms
[D 18:47:38.864 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:38.867 LabApp] Found kernel python3 in c:\users\felix\appdata\local\programs\python\python35\share\jupyter\kernels
[D 18:47:38.869 LabApp] Found kernel apache_toree_scala in C:\ProgramData\jupyter\kernels
[D 18:47:38.879 LabApp] 200 GET /api/kernelspecs?1568738858855 (::1) 16.00ms
[D 18:47:38.883 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.012 LabApp] 200 GET /lab/api/settings/?1568738858868 (::1) 130.00ms
[D 18:47:39.021 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.022 LabApp] 200 GET /api/sessions?1568738858937 (::1) 2.00ms
[I 18:47:39.026 LabApp] 301 GET /lab/workspaces/auto-1/?clone (::1) 1.00ms
[D 18:47:39.029 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:39.032 LabApp] Found kernel python3 in c:\users\felix\appdata\local\programs\python\python35\share\jupyter\kernels
[D 18:47:39.034 LabApp] Found kernel apache_toree_scala in C:\ProgramData\jupyter\kernels
[D 18:47:39.039 LabApp] 200 GET /api/kernelspecs?1568738858939 (127.0.0.1) 10.00ms
[D 18:47:39.045 LabApp] Using contents: services/contents
[D 18:47:39.060 LabApp] 200 GET /lab/workspaces/auto-1?clone (::1) 15.00ms
[D 18:47:39.303 LabApp] 304 GET /static/lab/main.f723825c0024a62d4234.js (::1) 1.00ms
[D 18:47:39.308 LabApp] 304 GET /static/lab/vendors~main.a8c1de6e5fac1c35fc76.js (127.0.0.1) 1.00ms
[D 18:47:39.665 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:39.666 LabApp] 200 GET /api/sessions?1568738859642 (127.0.0.1) 2.00ms
[D 18:47:39.668 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.670 LabApp] Found kernel python3 in c:\users\felix\appdata\local\programs\python\python35\share\jupyter\kernels
[D 18:47:39.670 LabApp] Found kernel apache_toree_scala in C:\ProgramData\jupyter\kernels
[D 18:47:39.676 LabApp] 200 GET /api/kernelspecs?1568738859661 (::1) 7.00ms
[D 18:47:39.678 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:39.776 LabApp] 200 GET /lab/api/settings/?1568738859667 (127.0.0.1) 99.00ms
[D 18:47:39.779 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.781 LabApp] 200 GET /api/sessions?1568738859719 (::1) 2.00ms
[D 18:47:39.783 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.786 LabApp] Found kernel python3 in c:\users\felix\appdata\local\programs\python\python35\share\jupyter\kernels
[D 18:47:39.790 LabApp] Found kernel apache_toree_scala in C:\ProgramData\jupyter\kernels
[D 18:47:39.807 LabApp] 200 GET /api/kernelspecs?1568738859720 (::1) 24.00ms
[D 18:47:39.895 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.896 LabApp] Using contents: services/contents
[W 18:47:39.899 LabApp] 404 GET /metrics?1568738859891 (::1) 4.00ms referer=http://localhost:8888/lab/workspaces/auto-1?clone
[D 18:47:39.939 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:39.963 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.119 LabApp] 200 GET /api/nbconvert?1568738859959 (::1) 157.00ms
[D 18:47:40.129 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.133 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860096 (::1) 6.00ms
[D 18:47:40.137 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.141 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860095 (::1) 5.00ms
[D 18:47:40.147 LabApp] Path @jupyterlab\theme-light-extension\index.css served from c:\users\felix\appdata\local\programs\python\python35\share\jupyter\lab\themes\@jupyterlab\theme-light-extension\index.css
[D 18:47:40.149 LabApp] 304 GET /lab/api/themes/@jupyterlab/theme-light-extension/index.css (::1) 3.00ms
[D 18:47:40.153 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.165 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860098 (::1) 13.89ms
[D 18:47:40.167 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:40.170 LabApp] 200 GET /api/nbconvert?1568738860017 (127.0.0.1) 4.00ms
[D 18:47:40.173 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.188 LabApp] 200 GET /api/contents/?content=1&1568738860065 (::1) 16.00ms
[D 18:47:40.192 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.202 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860097 (::1) 9.00ms
[D 18:47:40.205 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.212 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860100 (::1) 8.00ms
[D 18:47:40.216 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.219 LabApp] Node v10.15.3

[D 18:47:40.224 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860102 (::1) 9.00ms
[D 18:47:40.229 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.234 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860106 (::1) 6.00ms
[D 18:47:40.237 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.241 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860107 (::1) 4.00ms
[D 18:47:40.244 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.249 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860108 (::1) 6.00ms
[D 18:47:40.251 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:40.255 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860103 (127.0.0.1) 4.00ms
[D 18:47:40.261 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.265 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860104 (::1) 5.00ms
[I 18:47:40.269 LabApp] Build is up to date
[D 18:47:40.271 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.275 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860109 (::1) 4.00ms
[D 18:47:40.277 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.284 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860111 (::1) 7.00ms
[D 18:47:40.287 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.290 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860112 (::1) 4.00ms
[D 18:47:40.294 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:40.299 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860114 (127.0.0.1) 5.00ms
[D 18:47:40.302 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.309 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860116 (::1) 8.00ms
[D 18:47:40.319 LabApp] 200 GET /lab/api/build?1568738859935 (::1) 380.30ms
[D 18:47:40.322 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.327 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860117 (::1) 5.43ms
[D 18:47:40.332 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.340 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860118 (::1) 8.00ms
[D 18:47:40.346 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.353 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860120 (::1) 9.00ms
[D 18:47:40.358 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:40.364 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860121 (127.0.0.1) 8.00ms
[D 18:47:40.368 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.371 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860122 (::1) 4.00ms
[D 18:47:40.376 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.378 LabApp] 200 GET /api/sessions?1568738860149 (::1) 2.00ms
[D 18:47:40.383 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.393 LabApp] 200 GET /lab/api/extensions?1568738860167 (::1) 10.00ms
[D 18:47:40.398 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.402 LabApp] 200 GET /lab/api/workspaces/lab?1568738860227 (::1) 5.00ms
[D 18:47:40.405 LabApp] Accepting token-authenticated connection from 127.0.0.1
[D 18:47:40.425 LabApp] 200 GET /lab/api/extensions?1568738860252 (127.0.0.1) 19.00ms
[D 18:47:40.433 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:40.448 LabApp] 200 GET /lab/api/settings/@jupyterlab/docmanager-extension:plugin?1568738860140 (::1) 18.00ms
[D 18:47:41.151 LabApp] Accepting token-authenticated connection from ::1
[D 18:47:41.153 LabApp] 204 PUT /lab/api/workspaces/lab/workspaces/auto-1?1568738861146 (::1) 3.00ms
[D 18:47:44.394 LabApp] Accepting token-authenticated connection from ::1

I uninstalled all extensions to minimize side-effects and re-installed jupyter, no change. The output is stable, until I open a Python 3 console. Then the process simply closes without further messages.

@MSeal
Copy link
Contributor

MSeal commented Sep 17, 2019

Does it happen when if you install downgrade jupyter_client to 5.3.1? (sorry don't have access to a windows machine for a few hours so can't test this myself atm)

@felixnext
Copy link

No. 5.3.1. works fine.

@MSeal
Copy link
Contributor

MSeal commented Sep 17, 2019

@SylvainCorlay @jasongrout Could one of you help look into this? I think we need to release this hotfix soon as it's breaking setups for many people but I don't know the lab internals for the issue being described by felixnext. I'm thinking we should do a 5.3.3 release and then either patch jupyterlab or, if a clear fix is needed here, do a 5.3.4 patch for jupyer_client.

@MSeal
Copy link
Contributor

MSeal commented Sep 17, 2019

I released 5.3.3 and will follow-up on the lab issue.

@jasongrout
Copy link
Member

jasongrout commented Sep 17, 2019

What is the link to the lab issue?

@MSeal
Copy link
Contributor

MSeal commented Sep 17, 2019

See the messages by felixnext above around the 5.3.3 released version of jupyter_client and Python 3 console crash. I can't reproduce on ubuntu and can't check for a bit on windows myself.

@felixnext
Copy link

@jasongrout Should I open a separate lab issue for that?

@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 #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/

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

Successfully merging this pull request may close these issues.

None yet

6 participants