learningequality / kolibri-installer-windows

Repository for Kolibri windows installer
MIT License
5 stars 12 forks source link

Kolibri errors under Windows Python 3.6 and 3.7 #194

Open mrpau-richard opened 5 years ago

mrpau-richard commented 5 years ago

Observed behavior

Kolibri installation on Windows Python 3.6.

The Kolibri server can start and run but it has an OSError: [WinError 6] The handle is invalid error on the daemon.txt file log

This was also reported by @mrpau-julius here

Kolibri installation on Windows Python 3.7.

The Kolibri can't start the server because of these errors

C:\Python37\Scripts>kolibri start
Traceback (most recent call last):
  File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\kolibri.exe\__main__.py", line 5, in <module>
  File "c:\python37\lib\site-packages\kolibri\utils\cli.py", line 10, in <module
>
    from sqlite3 import DatabaseError as SQLite3DatabaseError
  File "c:\python37\lib\sqlite3\__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "c:\python37\lib\sqlite3\dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.

Expected behavior

If we planning to upgrade to this Python versions on Windows, and we should fix this issue first

User-facing consequences

Errors and logs

Steps to reproduce

Context

Tell us about your environment, including:

lyw07 commented 5 years ago

For the python 3.7 issue, what do you get when you run the following command? Thank you!

> python3.7
> import sys
> sys.path

I feel that the issue may be because the libraries are not added to PYTHONPATH.

mrpau-richard commented 5 years ago

These are the outputs when I run the commands in Python 3.7


C:\Python37>python.exe
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Inte
l)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', 'C:\\Python37\\python37.zip', 'C:\\Python37\\DLLs', 'C:\\Python37\\lib', 'C
:\\Python37', 'C:\\Python37\\lib\\site-packages']
rtibbles commented 3 years ago

This specifically seems to be an issue when the Windows language is set to something other than English.

radinamatic commented 3 years ago

Today during the syncing hack session I tested the 0.15 build on Windows 10 previously set to have the Spanish UI, and I encountered no errors during the installation and running of Kolibri with Python 3.6 that comes bundled. That Windows 10 VM did not have previously installed Python.

@pcenov Could you try to replicate this with:

Thank you!

rtibbles commented 3 years ago

I think we observed this in a log recently on @jredrejo's machine while doing some testing on Windows too, specifically the error that can be seen in the attached daemon.txt in the issue:

--- Logging error ---
Traceback (most recent call last):
  File "c:\python36\lib\logging\__init__.py", line 990, in emit
    stream.write(self.terminator)
OSError: [WinError 87] The parameter is incorrect
Call stack:
  File "c:\python36\lib\threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "c:\python36\lib\threading.py", line 916, in _bootstrap_inner
    self.run()
  File "c:\python36\lib\site-packages\kolibri\utils\server.py", line 185, in run
    call_command("ping")
  File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\__init__.py", line 131, in call_command
    return command.execute(*args, **defaults)
  File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "c:\python36\lib\site-packages\kolibri\core\analytics\management\commands\ping.py", line 77, in handle
    logger.info("Attempting a ping.")
Message: 'Attempting a ping.'
Arguments: ()
rtibbles commented 3 years ago

If you could check the daemon.txt specifically to see if it gives errors in another locale - for context the locale was Spanish in the recent example.

pcenov commented 3 years ago

Hi @radinamatic, I'm always able to replicate the OSError: [WinError 6] The handle is invalid using the kolibri-0.15.0a3-unsigned Windows build. I see this error in the daemon.txt log file regardless of the Windows locale (tried both English and Bulgarian) with clean installs of Kolibri. Here are the logs: logs.zip I can't get Kolibri to run without Python 3.6. I have Python 3.7 but it seems Kolibri requires 3.6 to be installed anyways.

jredrejo commented 2 years ago

Moving this to kolibri-installer-windows as it's an error happening only when the windows launcher is used. Launching kolibri in Windows with C:\Python36\Scripts\kolibri.exe start --foreground does not produce these errors