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

Kolibri errors under Windows Python 3.6 and 3.7 #194

Open
mrpau-richard opened this issue Jul 2, 2019 · 8 comments
Open

Kolibri errors under Windows Python 3.6 and 3.7 #194

mrpau-richard opened this issue Jul 2, 2019 · 8 comments

Comments

@mrpau-richard
Copy link
Contributor

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:

  • Kolibri version: kolibri-0.12.5-py2.py3-none-any.whl
  • Operating system: Windows 7 32bit
  • Browser
@lyw07
Copy link

lyw07 commented Jul 2, 2019

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
Copy link
Contributor Author

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
Copy link
Member

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

@radinamatic
Copy link
Member

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:

  • Windows switched to another locale (non-Latin one if possible)
  • With non-English locale Windows AND Python 3.7 installed before Kolibri

Thank you!

@rtibbles
Copy link
Member

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
Copy link
Member

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
Copy link
Member

pcenov commented Sep 2, 2021

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
Copy link
Member

jredrejo commented Dec 9, 2021

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

@jredrejo jredrejo transferred this issue from learningequality/kolibri Dec 9, 2021
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

6 participants