"python.exe has stopped working"

When I run KA-Lite I get the error message “python.exe has stopped working. A problem caused the program to stop working correctly.”

This is on a virgin Dell 3180 Education laptop with the most recent KA-Lite 0.17 installation on Windows 10 Pro.

I can run python (2.7.12) interactively on the laptop okay. I can start KA-Lite okay. Starting the server however generates the “python stopped working” message.
Administrative Event Viewer said that module _hashlib.pyd in python.exe had a fault.

“python.exe has stopped working” update:
:
django.log had an error: No en_icu.js file found in locale_path C:\Users\xxxx.kalite\locale
This file does not exist on my machine
server.log is empty

@Scott thanks a lot for reporting this!

The log error that you see is harmless, it’s seen before. However, your issue is likely related to this one: KA LITE Server doesn't starts on Windows 10

Would you be able to investigate the error by trying out if 0.17.0 works for you? It’s available here:

http://pantry.learningequality.org/downloads/ka-lite/0.17/installers/windows/KALiteSetup-0.17.0.exe

Benjamin, I unistalled version 0.17.1 and installed http://pantry.learningequality.org/downloads/ka-lite/0.17/installers/windows/KALiteSetup-0.17.0.exe. Same error.\

Hi @Scott Can you try to delete the C:\Users\xxxx.kalite folder and reinstall the KA Lite to generate the missing files at .kalite folder.

Thanks @Scott - there had been some speculation into whether a change in the Windows installer for 0.17.1 had caused things to break on Windows 10, but this indicates that the problem persists from an earlier version (we have had 4 issue reports about Windows 10, and 0 for other OS’es).

I can start KA-Lite okay

This is a little strange. So with command line interaction, everything is working?

Can you run kalite start and kalite stop from command line, and will the server run as it’s supposed to? Because this is the same as starting the server.

Problems could also exist in the GUI system tray application or with the startup service (which starts KA Lite at boot)…

Guys,
kalite is not a recognized command. The installer made the KAlite executable “KA Lite.exe”, The only environment variables related to KA are:
KALITE_PYTHON=\Python27\python.exe
KALITE_SCRIPT_DIR=\Python27\Scripts

There is no KAlite anything in the PATH.

I have been working on this for 16 hours. I bought the most recommended laptop for Education from the largest education laptop vendor (Dell), an Education Latitude 3180. It comes with Windows 10 Pro, the only OS available for this laptop. It has the most current Microsoft Update, the “Creative” update. Has KA-Lite been tested on Windows 10 Pro, Creative edition?" This is a completely stock machine with no other software loaded except what comes from Dell. I must be an idiot. :O( I’m trying to set up this machine for NY State prisons.

As I mentioned before, the System Applications error log indicated the problem came from python.exe executing module _hashlib.pyd.

@Scott when you were writing

I can run python (2.7.12) interactively on the laptop okay. I can start KA-Lite okay.

…I thought you were already running it from command line.

There is no KAlite anything in the PATH.

This is true, the Python Scripts dir isn’t automatically added to the path. If you do cd c:\Python27\Scripts before, then there’s a kalite command in that directory.

I have been working on this for 16 hours. I bought the most
recommended laptop for Education from the largest education laptop
vendor (Dell), an Education Latitude 3180. It comes with Windows 10
Pro, the only OS available for this laptop. It has the most current
Microsoft Update, the “Creative” update. Has KA-Lite been tested on
Windows 10 Pro, Creative edition?" This is a completely stock machine
with no other software loaded except what comes from Dell. I must be an
idiot. :O( I’m trying to set up this machine for NY State prisons.

You are doing nothing wrong here, but unfortunately, things that work on other Windows versions seems to have issues on Windows 10.

As I mentioned before, the System Applications error log indicated the problem came from python.exe executing module _hashlib.pyd.

I’m sorry but it’s difficult with this particular error since it’s about a library that AFAIK isn’t used while starting up the server. It’s a core library of Python though. By running KA Lite from command line, we might get more output:

cd c:\Python27\Scripts
kalite start

To stop it again, run kalite stop in the same command line. If you find errors in server.log or logs/django.log, those would be helpful.

Thanks for taking your time! I’m sorry that it’s not just plug and play for you :confused:

==================================================================
LOGS on Windows 10 Professional, “Creatives” (most recent) version

C:\Users\CCP Adminstraotr\Desktop>cd\

C:>cd python27
Console:
C:\Python27\Scripts>kalite start
Running ‘kalite start’ as daemon (system service)
Going to daemon mode, logging to C:\Users\CCP Adminstraotr.kalite\server.log

To access KA Lite from another connected computer, try the following address(es):
http://192.168.1.179:8008/

To access KA Lite from this machine, try the following address:
http://127.0.0.1:8008/

[INFO] [2017-05-25 19:04:14,236] cherrypy.error: [25/May/2017:19:04:14] ENGINE Listening for SIGTERM.
[INFO] [2017-05-25 19:04:14,236] cherrypy.error: [25/May/2017:19:04:14] ENGINE Bus STARTING
[INFO] [2017-05-25 19:04:14,236] cherrypy.error: [25/May/2017:19:04:14] Loading and serving the Django application
[INFO] [2017-05-25 19:04:14,253] cherrypy.error: [25/May/2017:19:04:14] ENGINE Started monitor thread ‘_TimeoutMonitor’.
[INFO] [2017-05-25 19:04:14,503] cherrypy.error: [25/May/2017:19:04:14] ENGINE Serving on http://0.0.0.0:8008
[INFO] [2017-05-25 19:04:14,503] cherrypy.error: [25/May/2017:19:04:14] ENGINE Bus STARTED
(lost system prompt - had to close cmd window)

C:\Users\CCP Administraotr.kalite\server.log is empty

C:\Users\CCP Administraotr.kalite\logs\djangolog.txt:
[INFO] [2017-05-25 19:15:19,674] cherrypy.error: [25/May/2017:19:15:19] ENGINE Listening for SIGTERM.
[INFO] [2017-05-25 19:15:19,674] cherrypy.error: [25/May/2017:19:15:19] ENGINE Bus STARTING
[INFO] [2017-05-25 19:15:19,674] cherrypy.error: [25/May/2017:19:15:19] Loading and serving the Django application
[INFO] [2017-05-25 19:15:19,690] cherrypy.error: [25/May/2017:19:15:19] ENGINE Started monitor thread ‘_TimeoutMonitor’.
[INFO] [2017-05-25 19:15:19,940] cherrypy.error: [25/May/2017:19:15:19] ENGINE Serving on http://0.0.0.0:8008
[INFO] [2017-05-25 19:15:19,940] cherrypy.error: [25/May/2017:19:15:19] ENGINE Bus STARTED

Scott (619-852-7633)

Output looks normal though.

At this point, are you able to use KA Lite?

Benjamin, what does “Use KA Lite” mean if the server isn’t started???
:O)

In Chrome, http:/127.0.0.1:8008 says “This site can’t be reached. 127.0.0.1 refused to connect.”
I get this error after starting KA-lite, both before and after starting the server.
:O)

In this case, have you started the server from command line? Because looking at the command line output you posted, the server is started (leave the command line open, closing it will stop the server again).

Specifically,

  1. Re-boot (Windows 10 Professional)

  2. Sign on as Administrator

  3. With File Manager, navigate to C:\Python27\Scripts

  4. Get command prompt (shift-right-click open area; select “Open command window here”)

  5. C:\Python27\Scripts>kalite start
    Running ‘kalite start’ as daemon (system service)
    Going to daemon mode, logging to C:\Users\CCP Administrator.kalite\server.log
    To access KA Lite from another connected computer, try the following addresses(es):
    http://192.168.1.179:8008
    To access KA Lite from this machine, try the following address:
    http://127.0.0.1:8008/

[INFO] [2017-…,299] cherrypy.error: [02/Jun…] ENGINE Listening for SIGTERM
[INFO] [2017-…,315] cherrypy.error: [02/Jun…] ENGINE Bus STARTING
[INFO] [2017-…,315] cherrypy.error: [02/Jun…] loading and serving the Django application
[INFO] [2017-…,331] cherrypy.error: [02/Jun…] ENGINE Started monitor thread '_TimeoutMonitor".
[INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE Serving on http://0.0.0.0:8008
[INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE bus STARTED

(wrote down time of last cherrypy.error message: 02/Jun/2017:08:29:01)
(lost focus in command window; KA-Lite icon NOT in system tray{

  1. See what is happening in Task Manager (Ctrl-Alt-Delete)
    Sort on Processes; two instances of python.exe, no instance of KAlite

  2. Open chrome browser to http://127.0.0.1:8008
    “python.exe has stopped working” error message

  3. Selected “Close Program” in python error message
    The two python.exe processes were removed in Task Manager.

  4. Closed all open windows.
    Event Viewer | Custom Views | Administrative Events | sort on Date and Time
    (two events after 02/Jun/2017:08:29:01 = “6/2/2017 8:29:01 AM)”

    Error: DistributedCOM
    The application-specific permission settings do not grant Local Activation permission for the
    COM Server application with CLSID … and APPID … to the user
    NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost(Using LRPC) running in the
    application container Unavailable SID (Unavailable). This security permission can be
    modified using the Component Services adminstrative tool.

    Error: Application Error
    Faulty application name: python.exe
    Faulty module name: _hashlib.pyd
    Exception code: 0xc0000005

  5. The .kalite\server.log is empty.

  6. The .kalite\logs\django.log:
    [INFO] [2017-…,299] cherrypy.error: [02/Jun…] ENGINE Listening for SIGTERM
    [INFO] [2017-…,315] cherrypy.error: [02/Jun…] ENGINE Bus STARTING
    [INFO] [2017-…,315] cherrypy.error: [02/Jun…] loading and serving the Django application
    [INFO] [2017-…,331] cherrypy.error: [02/Jun…] ENGINE Started monitor thread '_TimeoutMonitor".
    [INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE Serving on http://0.0.0.0:8008
    [INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE bus STARTED

Specifically,

  1. Re-boot (Windows 10 Professional)

  2. Sign on as Administrator

  3. With File Manager, navigate to C:\Python27\Scripts

  4. Get command prompt (shift-right-click open area; select “Open command window here”)

  5. C:\Python27\Scripts>kalite start
    Running ‘kalite start’ as daemon (system service)
    Going to daemon mode, logging to C:\Users\CCP Administrator.kalite\server.log
    To access KA Lite from another connected computer, try the following addresses(es):
    http://192.168.1.179:8008
    To access KA Lite from this machine, try the following address:
    http://127.0.0.1:8008/

[INFO] [2017-…,299] cherrypy.error: [02/Jun…] ENGINE Listening for SIGTERM
[INFO] [2017-…,315] cherrypy.error: [02/Jun…] ENGINE Bus STARTING
[INFO] [2017-…,315] cherrypy.error: [02/Jun…] loading and serving the Django application
[INFO] [2017-…,331] cherrypy.error: [02/Jun…] ENGINE Started monitor thread '_TimeoutMonitor".
[INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE Serving on http://0.0.0.0:8008
[INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE bus STARTED

(wrote down time of last cherrypy.error message: 02/Jun/2017:08:29:01)
(lost focus in command window; KA-Lite icon NOT in system tray{

  1. See what is happening in Task Manager (Ctrl-Alt-Delete)
    Sort on Processes; two instances of python.exe, no instance of KAlite

  2. Open chrome browser to http://127.0.0.1:8008
    “python.exe has stopped working” error message

  3. Selected “Close Program” in python error message
    The two python.exe processes were removed in Task Manager.

  4. Closed all open windows.
    Event Viewer | Custom Views | Administrative Events | sort on Date and Time
    (two events after 02/Jun/2017:08:29:01 = “6/2/2017 8:29:01 AM)”

    Error: DistributedCOM
    The application-specific permission settings do not grant Local Activation permission for the
    COM Server application with CLSID … and APPID … to the user
    NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost(Using LRPC) running in the
    application container Unavailable SID (Unavailable). This security permission can be
    modified using the Component Services adminstrative tool.

    Error: Application Error
    Faulty application name: python.exe
    Faulty module name: _hashlib.pyd
    Exception code: 0xc0000005

  5. The .kalite\server.log is empty.

  6. The .kalite\logs\django.log:
    [INFO] [2017-…,299] cherrypy.error: [02/Jun…] ENGINE Listening for SIGTERM
    [INFO] [2017-…,315] cherrypy.error: [02/Jun…] ENGINE Bus STARTING
    [INFO] [2017-…,315] cherrypy.error: [02/Jun…] loading and serving the Django application
    [INFO] [2017-…,331] cherrypy.error: [02/Jun…] ENGINE Started monitor thread '_TimeoutMonitor".
    [INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE Serving on http://0.0.0.0:8008
    [INFO] [2017-…,676] cherrypy.error: [02/Jun…] ENGINE bus STARTED

  7. Open a Task Manager Window (Ctrl-Alt-Del)
    sort Processes column
    scroll down to where KAlite.exe and python.exe will be (to see what is happening)

  8. Close Task Manager

  9. Open a Task Manager Window (Ctrl-Alt-Del)
    sort Processes column
    scroll down to where KAlite.exe and python.exe will be (to see what is happening)

  10. Close Task Manager

Your description of steps is excellent, thanks for being so detailed!

A quick clarification: The task tray icon is not KA Lite itself but a utility to start/stop KA Lite. Running it from command line is an alternative to using the system tray - but this method shows us detailed output.

At present, I think there’s a problem in the daemon mode, and maybe something that’s specific to Windows 10. So I wanna know why KA Lite doesn’t work when you navigate to the KA Lite URL in your browser, while KA Lite says it’s running in the background. It seems it might crash at the very first page visit.

In this step4, try running kalite start --foreground. This way it won’t go to daemon mode, it will just start and keep running as long as the command line is open. While it’s running, try navigating to http://127.0.0.1:8008 in your browser. If it still doesn’t work, please paste the command line output, perhaps it contains the reason of a crash…

===================================================================
19th attempt

Specifically,

  1. Re-boot (Windows 10 Professional)
  2. Sign on as Administrator
  3. With File Manager, navigate to C:\Python27\Scripts
  4. Get command prompt (shift-right-click open area; select “Open command window here”)
  5. C:\Python27\Scripts>kalite start --foreground

Running ‘kalite start’ in foreground…
To access KA Lite from another connected computer, try the following addresses(es):
http://192.168.1.179:8008
To access KA Lite from this machine, try the following address:
http://127.0.0.1:8008/

[INFO] [2017-…,608] cherrypy.error: [03/Jun…] ENGINE Listening for SIGTERM
[INFO] [2017-…,624] cherrypy.error: [03/Jun…] ENGINE Bus STARTING
[INFO] [2017-…,624] cherrypy.error: [03/Jun…] loading and serving the Django application
[INFO] [2017-…,640] cherrypy.error: [03/Jun…] ENGINE Started monitor thread '_TimeoutMonitor".
[INFO] [2017-…,890] cherrypy.error: [03/Jun…] ENGINE Serving on http://0.0.0.0:8008
[INFO] [2017-…,890] cherrypy.error: [03/Jun…] ENGINE bus STARTED

(wrote down time of last cherrypy.error message: 03/Jun/2017:07:38:51)

  1. Open chrome browser to http://127.0.0.1:8008
    “python.exe has stopped working” error message


    Exactly the same as running kalite as a daemon.
    No futher output on console.


  2. See what is happening in Task Manager (Ctrl-Alt-Delete)
    Sort on Processes; two instances of python.exe, no instance of KAlite
    (same as in daemon mode)

  3. Event Viewer | Custom Views | Administrative Events | sort on Date and Time
    (same two events after 03/Jun/2017:07:38:51 = “6/3/2017 7:38:51 AM” as daemon mode)

    Error: Application Error
    Faulty application name: python.exe
    Faulty module name: _hashlib.pyd
    Exception code: 0xc0000005

    Error: DistributedCOM
    The application-specific permission settings do not grant Local Activation permission for the
    COM Server application with CLSID … and APPID … to the user
    NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost(Using LRPC) running in the
    application container Unavailable SID (Unavailable). This security permission can be
    modified using the Component Services adminstrative tool.

  4. The .kalite\server.log is empty.

  5. The .kalite\logs\django.log contains the same as console output:
    [INFO]…
    :O(

You could try investigating this part, are you familiar with the Python command line?

You should be able to start python by

  1. Open up a command line (as you did before) and just type python [ENTER]
  2. Type two commands, first one for importing hashlib followed by [ENTER] and then the second line to try invoking hashlib and see if it actually works:
>>> import hashlib
>>> hashlib.md5("test").hexdigest()

Thanks again. Also, in case you wonder - we haven’t seen this issue on other platforms, and we have re-verified that it works fine on Windows 10 64 bit (not a pro licensed though).

Just reading a similar bug report from Windows 10 where the path for Python libraries seemed to have been confused due to co-existing 64 and 32 bit installations… You could try fetching the Windows x86-64 MSI installer here:

Also, make extra sure that you have just one Python environment installed.

Upgraded to Python 2.7.13 from https://www.python.org/downloads/release/python-2713/
version “Windows x86-64 MSI installer” (all defaults)

It worked!!! Benjamin, I love you!!!
I can step down from the bridge now,

1 Like

Awesome, wow, I have to say I was just reaching there :slight_smile: Pretty sure it must have been either the previous installation being broken or 32 bit.

Thanks for your patience and persistence!

Created an FAQ update to enlighten future users: https://github.com/learningequality/ka-lite/pull/5470