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

0.16.0 RC1 fails if Samba/Ansible/etc are installed (e.g. with python3-markdown) on the same OS #11895

Closed
holta opened this issue Feb 16, 2024 · 30 comments
Assignees
Labels
P0 - critical Priority: Release blocker or regression

Comments

@holta
Copy link

holta commented Feb 16, 2024

Confirmed on both Debian 12 and Ubuntu — here's an example on a Debian 12.5 VM where the Kolibri 0.16.0 RC1 .deb was installed.

Logs below: Hopefully @rtibbles and @jredrejo can tell if a quick fix is possible or not!

root@deb12:~# /usr/bin/kolibri --version
kolibri, version 0.16.0rc1

root@deb12:~# cat /etc/debian_version
12.5

root@deb12:~# uname -a
Linux box 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux
root@deb12:~# apt list -a kolibri python3-markdown
Listing... Done
kolibri/now 0.16.0rc1-0ubuntu1 all [installed,local]
kolibri/jammy 0.15.12-0ubuntu3 all

python3-markdown/stable,now 3.4.1-2 all [installed,automatic]
root@deb12:~# systemctl status kolibri
× kolibri.service - Kolibri
     Loaded: loaded (/etc/systemd/system/kolibri.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-02-16 17:19:26 EST; 19min ago
    Process: 26446 ExecStart=/usr/bin/kolibri start (code=exited, status=1/FAILURE)
        CPU: 1.411s

Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/serializers.py", line 30, in <module>
Feb 16 17:19:26 box kolibri[26446]:     from rest_framework.compat import Mapping, postgres_fields, unicode_to_repr
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/compat.py", line 176, in <module>
Feb 16 17:19:26 box kolibri[26446]:     if markdown.version <= '2.2':
Feb 16 17:19:26 box kolibri[26446]:        ^^^^^^^^^^^^^^^^
Feb 16 17:19:26 box kolibri[26446]: AttributeError: module 'markdown' has no attribute 'version'
Feb 16 17:19:26 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 16 17:19:26 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 16 17:19:26 box systemd[1]: Failed to start kolibri.service - Kolibri.
Feb 16 17:19:26 box systemd[1]: kolibri.service: Consumed 1.411s CPU time.
root@deb12:~# journalctl -u kolibri
Feb 16 17:19:19 box systemd[1]: Starting kolibri.service - LSB: kolibri daemon, an offline education platform...
Feb 16 17:19:19 box runuser[26031]: pam_unix(runuser:session): session opened for user kolibri(uid=999) by (uid=0)
Feb 16 17:19:19 box runuser[26031]: pam_unix(runuser:session): session closed for user kolibri
Feb 16 17:19:19 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 16 17:19:19 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 16 17:19:19 box systemd[1]: Failed to start kolibri.service - LSB: kolibri daemon, an offline education platform.
Feb 16 17:19:20 box systemd[1]: Starting kolibri.service - LSB: kolibri daemon, an offline education platform...
Feb 16 17:19:20 box runuser[26158]: pam_unix(runuser:session): session opened for user kolibri(uid=999) by (uid=0)
Feb 16 17:19:20 box runuser[26158]: pam_unix(runuser:session): session closed for user kolibri
Feb 16 17:19:20 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 16 17:19:20 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 16 17:19:20 box systemd[1]: Failed to start kolibri.service - LSB: kolibri daemon, an offline education platform.
Feb 16 17:19:24 box systemd[1]: Starting kolibri.service - Kolibri...
Feb 16 17:19:26 box kolibri[26446]: INFO     2024-02-16 17:19:26,217 Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
Feb 16 17:19:26 box kolibri[26446]: INFO     2024-02-16 17:19:26,217 Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
Feb 16 17:19:26 box kolibri[26446]: INFO     2024-02-16 17:19:26,217 Option HTTP_PORT in section [Deployment] being overridden by environment variable KOLIBRI_HTTP_PORT
Feb 16 17:19:26 box kolibri[26446]: INFO     2024-02-16 17:19:26,217 Option URL_PATH_PREFIX in section [Deployment] being overridden by environment variable KOLIBRI_URL_PATH_PREFIX
Feb 16 17:19:26 box kolibri[26446]: INFO     2024-02-16 17:19:26,219 Attempting to setup using pre-migrated databases
Feb 16 17:19:26 box kolibri[26446]: ERROR    2024-02-16 17:19:26,291 The job tables were not fully migrated. Tried to create them in the database and an error occurred: module 'markdown' has no attribute 'version'
Feb 16 17:19:26 box kolibri[26446]: Error: Traceback (most recent call last):
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 193, in invoke
Feb 16 17:19:26 box kolibri[26446]:     initialize(**get_initialize_params())
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 287, in initialize
Feb 16 17:19:26 box kolibri[26446]:     ensure_job_tables_created()
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/utils/sanity_checks.py", line 123, in ensure_job_tables_created
Feb 16 17:19:26 box kolibri[26446]:     from kolibri.core.tasks.main import job_storage
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/core/tasks/main.py", line 5, in <module>
Feb 16 17:19:26 box kolibri[26446]:     from kolibri.core.tasks.storage import Storage
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/core/tasks/storage.py", line 27, in <module>
Feb 16 17:19:26 box kolibri[26446]:     from kolibri.core.tasks.job import Job
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/core/tasks/job.py", line 19, in <module>
Feb 16 17:19:26 box kolibri[26446]:     from kolibri.core.tasks.validation import validate_interval
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/core/tasks/validation.py", line 4, in <module>
Feb 16 17:19:26 box kolibri[26446]:     from rest_framework import serializers
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/serializers.py", line 30, in <module>
Feb 16 17:19:26 box kolibri[26446]:     from rest_framework.compat import Mapping, postgres_fields, unicode_to_repr
Feb 16 17:19:26 box kolibri[26446]:   File "/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/compat.py", line 176, in <module>
Feb 16 17:19:26 box kolibri[26446]:     if markdown.version <= '2.2':
Feb 16 17:19:26 box kolibri[26446]:        ^^^^^^^^^^^^^^^^
Feb 16 17:19:26 box kolibri[26446]: AttributeError: module 'markdown' has no attribute 'version'
Feb 16 17:19:26 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 16 17:19:26 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 16 17:19:26 box systemd[1]: Failed to start kolibri.service - Kolibri.
Feb 16 17:19:26 box systemd[1]: kolibri.service: Consumed 1.411s CPU time.

Related:

@rtibbles
Copy link
Member

This bug has been fixed in every version of Python markdown except version 3.0.0 - do you know why this particular package is being pinned to here?

Python-Markdown/markdown@6323ba6

@rtibbles
Copy link
Member

Digging deeper it seems that even for bullseye the latest version of this package should include the bug fix https://packages.debian.org/search?keywords=python3-markdown

@holta
Copy link
Author

holta commented Feb 17, 2024

Huge thanks @rtibbles as you seem well on the way to solving (-: All I know is these 2 fail with 0.16.0 RC 1...

  • python3-markdown 3.4.1 on Debian 12
    root@box:~# apt list python3-markdown
    Listing... Done
    python3-markdown/stable,now 3.4.1-2 all [installed,automatic]
    
  • python3-markdown 3.5.2 on Ubuntu 24.04 (latest pre-release!
    root@box:~# apt list python3-markdown
    Listing... Done
    python3-markdown/noble,now 3.5.2-1 all [installed,automatic]
    

@rtibbles
Copy link
Member

Oh, I see from your traceback that 3.4.2 is the installed version? This is even more confusing.

@holta
Copy link
Author

holta commented Feb 17, 2024

traceback that 3.4.2 is the installed version?

Yeah. (3.4.1 actually, on Debian 12 Bookworm)

@rtibbles
Copy link
Member

The really annoying thing about this is that we don't use the markdown library at all in Kolibri, so that's why we don't bundle it!

If we can't find a way to handle this just by properly pinning dependencies, I have a last ditch workaround in mind.

@holta
Copy link
Author

holta commented Feb 17, 2024

Very Awesome if markdown pollution can be removed entirely! 🙃

@rtibbles
Copy link
Member

OK, yes I see what is happening. The version attribute was reintroduced in 3.0.1 then deprecated and then removed, so it is indeed absent in the latest versions.

I will implement a fix in Kolibri to handle this.

@rtibbles rtibbles added the P0 - critical Priority: Release blocker or regression label Feb 17, 2024
@rtibbles rtibbles self-assigned this Feb 17, 2024
@jredrejo
Copy link
Member

@holta notice we're not going to do a new release for the 0.15.x branch, so I'm thinking of doing a Debian patched package for this. 0.16.x will be patched "upstream"
are you going to use 0.15 for a long time or you plan to move to 0.16.x when it's released?

@holta
Copy link
Author

holta commented Feb 19, 2024

@jredrejo 0.15.x should not be needed, thanks:

0.16.x and 0.17.x are sufficient!

@holta
Copy link
Author

holta commented Feb 19, 2024

0.16.0 RC 2 has a remaining issue:

root@u24:~# /usr/bin/kolibri --version
kolibri, version 0.16.0rc2

root@u24:~# journalctl -u kolibri | pastebinit -b sprunge.us
http://sprunge.us/gEkYDa

Above logging also pasted in here:

Feb 19 18:41:55 box systemd[1]: Starting kolibri.service - LSB: kolibri daemon, an offline education platform...
Feb 19 18:41:55 box runuser[61849]: pam_unix(runuser:session): session opened for user kolibri(uid=997) by (uid=0)
Feb 19 18:41:55 box runuser[61849]: pam_unix(runuser:session): session closed for user kolibri
Feb 19 18:41:55 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 19 18:41:55 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 19 18:41:55 box systemd[1]: Failed to start kolibri.service - LSB: kolibri daemon, an offline education platform.
Feb 19 18:41:56 box systemd[1]: Starting kolibri.service - LSB: kolibri daemon, an offline education platform...
Feb 19 18:41:56 box runuser[62146]: pam_unix(runuser:session): session opened for user kolibri(uid=997) by (uid=0)
Feb 19 18:41:56 box runuser[62146]: pam_unix(runuser:session): session closed for user kolibri
Feb 19 18:41:56 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 19 18:41:56 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 19 18:41:56 box systemd[1]: Failed to start kolibri.service - LSB: kolibri daemon, an offline education platform.
Feb 19 18:42:04 box systemd[1]: Starting kolibri.service - Kolibri...
Feb 19 18:42:05 box kolibri[62511]: INFO     2024-02-19 18:42:05,501 Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG
Feb 19 18:42:05 box kolibri[62511]: INFO     2024-02-19 18:42:05,502 Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE
Feb 19 18:42:05 box kolibri[62511]: INFO     2024-02-19 18:42:05,502 Option HTTP_PORT in section [Deployment] being overridden by environment variable KOLIBRI_HTTP_PORT
Feb 19 18:42:05 box kolibri[62511]: INFO     2024-02-19 18:42:05,502 Option URL_PATH_PREFIX in section [Deployment] being overridden by environment variable KOLIBRI_URL_PATH_PREFIX
Feb 19 18:42:05 box kolibri[62511]: INFO     2024-02-19 18:42:05,503 Attempting to setup using pre-migrated databases
Feb 19 18:42:05 box kolibri[62511]: /usr/lib/python3/dist-packages/kolibri/dist/rest_framework/utils/serializer_helpers.py:107: SyntaxWarning: "is" with a literal. Did you mean "=="?
Feb 19 18:42:05 box kolibri[62511]:   if value is None or value is '':
Feb 19 18:42:06 box kolibri[62511]: INFO     2024-02-19 18:42:06,035 Running Kolibri with the following settings: kolibri.deployment.default.settings.base
Feb 19 18:42:06 box kolibri[62511]: Error: Traceback (most recent call last):
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 193, in invoke
Feb 19 18:42:06 box kolibri[62511]:     initialize(**get_initialize_params())
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 296, in initialize
Feb 19 18:42:06 box kolibri[62511]:     _setup_django()
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 154, in _setup_django
Feb 19 18:42:06 box kolibri[62511]:     django.setup()
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/__init__.py", line 27, in setup
Feb 19 18:42:06 box kolibri[62511]:     apps.populate(settings.INSTALLED_APPS)
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/registry.py", line 116, in populate
Feb 19 18:42:06 box kolibri[62511]:     app_config.ready()
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/core/apps.py", line 52, in ready
Feb 19 18:42:06 box kolibri[62511]:     registered_plugins.register_non_plugins(settings.INSTALLED_APPS)
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/plugins/registry.py", line 150, in register_non_plugins
Feb 19 18:42:06 box kolibri[62511]:     initialize_kolibri_plugin(app)
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/plugins/utils/__init__.py", line 156, in initialize_kolibri_plugin
Feb 19 18:42:06 box kolibri[62511]:     plugin_module = importlib.import_module(plugin_module_name)
Feb 19 18:42:06 box kolibri[62511]:                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
Feb 19 18:42:06 box kolibri[62511]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 19 18:42:06 box kolibri[62511]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 19 18:42:06 box kolibri[62511]:   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
Feb 19 18:42:06 box kolibri[62511]:   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
Feb 19 18:42:06 box kolibri[62511]:   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
Feb 19 18:42:06 box kolibri[62511]:   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
Feb 19 18:42:06 box kolibri[62511]:   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
Feb 19 18:42:06 box kolibri[62511]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/core/content/kolibri_plugin.py", line 8, in <module>
Feb 19 18:42:06 box kolibri[62511]:     from kolibri.core.content.tasks import enqueue_automatic_resource_import_if_needed
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/core/content/tasks.py", line 18, in <module>
Feb 19 18:42:06 box kolibri[62511]:     from kolibri.core.content.utils.content_request import incomplete_removals_queryset
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/core/content/utils/content_request.py", line 34, in <module>
Feb 19 18:42:06 box kolibri[62511]:     from kolibri.core.content.utils.resource_import import (
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/core/content/utils/resource_import.py", line 36, in <module>
Feb 19 18:42:06 box kolibri[62511]:     from kolibri.utils import file_transfer as transfer
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 26, in <module>
Feb 19 18:42:06 box kolibri[62511]:     import OpenSSL
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/OpenSSL/__init__.py", line 8, in <module>
Feb 19 18:42:06 box kolibri[62511]:     from OpenSSL import SSL, crypto
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/OpenSSL/SSL.py", line 19, in <module>
Feb 19 18:42:06 box kolibri[62511]:     from OpenSSL.crypto import (
Feb 19 18:42:06 box kolibri[62511]:   File "/usr/lib/python3/dist-packages/OpenSSL/crypto.py", line 3263, in <module>
Feb 19 18:42:06 box kolibri[62511]:     utils.deprecated(
Feb 19 18:42:06 box kolibri[62511]: TypeError: deprecated() got an unexpected keyword argument 'name'
Feb 19 18:42:06 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 19 18:42:06 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 19 18:42:06 box systemd[1]: Failed to start kolibri.service - Kolibri.
Feb 19 18:42:06 box systemd[1]: kolibri.service: Consumed 2.335s CPU time.

@rtibbles
Copy link
Member

Hi @holta I have replicated this locally, and hopefully fixed it in this Pull Request: #11905 - in about 30 minutes, the assets (including a debian package) for the PR will be posted in a comment, would you be able to download the debian file from there (it will come bundled inside a zip) and test that this resolves the issue you're seeing here?

@holta
Copy link
Author

holta commented Feb 20, 2024

@rtibbles

Send URL to the .deb package if possible?

@rtibbles
Copy link
Member

@holta
Copy link
Author

holta commented Feb 20, 2024

Public URL if possible?

root@u24:~# wget https://github.com/learningequality/kolibri/suites/20912179106/artifacts/1258052959
--2024-02-19 21:13:08--  https://github.com/learningequality/kolibri/suites/20912179106/artifacts/1258052959
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-02-19 21:13:08 ERROR 404: Not Found.

@rtibbles
Copy link
Member

@holta
Copy link
Author

holta commented Feb 20, 2024

Above .deb file installs and works ✅

@rtibbles
Copy link
Member

Fantastic, thanks for verifying - hopefully rc3 will be the winner!

@bjester
Copy link
Member

bjester commented Feb 20, 2024

Closed by #11905

@bjester bjester closed this as completed Feb 20, 2024
@holta
Copy link
Author

holta commented Feb 24, 2024

@rtibbles can you take a quick look below, just to make sure everything's good enough with 0.16.0 as attempted via https://github.com/learningequality/kolibri/releases/download/v0.16.0/kolibri_0.16.0-0ubuntu1_all.deb ?

Error seems to be: No module named 'django.utils.six.moves'

(Is it possible Kolibri 0.16.x does not yet fully support Python 3.12?)

TASK [kolibri : Provision Kolibri, while setting: facility name, admin acnt / password, preset type, and language] **************************************************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": true, "cmd": ""/usr/bin/kolibri" manage provisiondevice --facility "Kolibri-in-a-Box" --superusername "Admin" --superuserpassword "changeme" --preset "formal" --language_id "en" #--preset "formal" --language_id "en" --verbosity 0 --noinput\n", "delta": "0:00:01.290657", "end": "2024-02-24 13:03:57.007717", "msg": "non-zero return code", "rc": 1, "start": "2024-02-24 13:03:55.717060", "stderr": "Traceback (most recent call last):\n File "/usr/bin/kolibri", line 33, in \n sys.exit(load_entry_point('kolibri==0.16.0', 'console_scripts', 'kolibri')())\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/usr/bin/kolibri", line 25, in importlib_load_entry_point\n return next(matches).load()\n ^^^^^^^^^^^^^^^^^^^^\n File "/usr/lib/python3.12/importlib/metadata/init.py", line 205, in load\n module = import_module(match.group('module'))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File "", line 1387, in _gcd_import\n File "", line 1360, in _find_and_load\n File "", line 1331, in _find_and_load_unlocked\n File "", line 935, in _load_unlocked\n File "", line 995, in exec_module\n File "", line 488, in _call_with_frames_removed\n File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 12, in \n from django.core.management import execute_from_command_line\n File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/init.py", line 10, in \n from django.apps import apps\n File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/init.py", line 1, in \n from .config import AppConfig\n File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/config.py", line 4, in \n from django.core.exceptions import ImproperlyConfigured\n File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/exceptions.py", line 5, in \n from django.utils.encoding import force_text\n File "/usr/lib/python3/dist-packages/kolibri/dist/django/utils/encoding.py", line 11, in \n from django.utils.six.moves.urllib.parse import quote, unquote\nModuleNotFoundError: No module named 'django.utils.six.moves'", "stderr_lines": ["Traceback (most recent call last):", " File "/usr/bin/kolibri", line 33, in ", " sys.exit(load_entry_point('kolibri==0.16.0', 'console_scripts', 'kolibri')())", " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", " File "/usr/bin/kolibri", line 25, in importlib_load_entry_point", " return next(matches).load()", " ^^^^^^^^^^^^^^^^^^^^", " File "/usr/lib/python3.12/importlib/metadata/init.py", line 205, in load", " module = import_module(match.group('module'))", " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", " File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module", " return _bootstrap._gcd_import(name[level:], package, level)", " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^", " File "", line 1387, in _gcd_import", " File "", line 1360, in _find_and_load", " File "", line 1331, in _find_and_load_unlocked", " File "", line 935, in _load_unlocked", " File "", line 995, in exec_module", " File "", line 488, in _call_with_frames_removed", " File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 12, in ", " from django.core.management import execute_from_command_line", " File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/init.py", line 10, in ", " from django.apps import apps", " File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/init.py", line 1, in ", " from .config import AppConfig", " File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/config.py", line 4, in ", " from django.core.exceptions import ImproperlyConfigured", " File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/exceptions.py", line 5, in ", " from django.utils.encoding import force_text", " File "/usr/lib/python3/dist-packages/kolibri/dist/django/utils/encoding.py", line 11, in ", " from django.utils.six.moves.urllib.parse import quote, unquote", "ModuleNotFoundError: No module named 'django.utils.six.moves'"], "stdout": "", "stdout_lines": []}

Excerpt from journalctl -u kolibri :

Feb 24 13:03:51 box systemd[1]: Starting kolibri.service - Kolibri...
Feb 24 13:03:51 box kolibri[55562]: Traceback (most recent call last):
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/bin/kolibri", line 33, in <module>
Feb 24 13:03:51 box kolibri[55562]:     sys.exit(load_entry_point('kolibri==0.16.0', 'console_scripts', 'kolibri')())
Feb 24 13:03:51 box kolibri[55562]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/bin/kolibri", line 25, in importlib_load_entry_point
Feb 24 13:03:51 box kolibri[55562]:     return next(matches).load()
Feb 24 13:03:51 box kolibri[55562]:            ^^^^^^^^^^^^^^^^^^^^
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
Feb 24 13:03:51 box kolibri[55562]:     module = import_module(match.group('module'))
Feb 24 13:03:51 box kolibri[55562]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
Feb 24 13:03:51 box kolibri[55562]:     return _bootstrap._gcd_import(name[level:], package, level)
Feb 24 13:03:51 box kolibri[55562]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Feb 24 13:03:51 box kolibri[55562]:   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
Feb 24 13:03:51 box kolibri[55562]:   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
Feb 24 13:03:51 box kolibri[55562]:   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
Feb 24 13:03:51 box kolibri[55562]:   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
Feb 24 13:03:51 box kolibri[55562]:   File "<frozen importlib._bootstrap_external>", line 995, in exec_module
Feb 24 13:03:51 box kolibri[55562]:   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 12, in <module>
Feb 24 13:03:51 box kolibri[55562]:     from django.core.management import execute_from_command_line
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py", line 10, in <module>
Feb 24 13:03:51 box kolibri[55562]:     from django.apps import apps
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/__init__.py", line 1, in <module>
Feb 24 13:03:51 box kolibri[55562]:     from .config import AppConfig
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/config.py", line 4, in <module>
Feb 24 13:03:51 box kolibri[55562]:     from django.core.exceptions import ImproperlyConfigured
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/exceptions.py", line 5, in <module>
Feb 24 13:03:51 box kolibri[55562]:     from django.utils.encoding import force_text
Feb 24 13:03:51 box kolibri[55562]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/utils/encoding.py", line 11, in <module>
Feb 24 13:03:51 box kolibri[55562]:     from django.utils.six.moves.urllib.parse import quote, unquote
Feb 24 13:03:51 box kolibri[55562]: ModuleNotFoundError: No module named 'django.utils.six.moves'
Feb 24 13:03:51 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
Feb 24 13:03:51 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
Feb 24 13:03:51 box systemd[1]: Failed to start kolibri.service - Kolibri.
root@u24:~# python3 --version
Python 3.12.2
root@u24:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu Noble Numbat (development branch)"
root@u24:~# hostnamectl
 Static hostname: box
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: 7a3d1f28a7fd4c97a0f1e93bf8ae69d8
         Boot ID: e711e5e242344d81a0cce0ae2680f4f5
  Virtualization: kvm
Operating System: Ubuntu Noble Numbat (development branch)
          Kernel: Linux 6.6.0-14-generic
    Architecture: x86-64
 Hardware Vendor: QEMU
  Hardware Model: Standard PC _Q35 + ICH9, 2009_
Firmware Version: unknown
   Firmware Date: Wed 2022-02-02
    Firmware Age: 2y 3w 1d

@rtibbles
Copy link
Member

Kolibri does not support Python 3.12, no. It is explicitly pinned below 3.12: https://github.com/learningequality/kolibri/blob/release-v0.16.x/setup.py#L111

It seems likely we can only do this in 0.17 where we have dropped support for Python 2.7.

@holta
Copy link
Author

holta commented Feb 25, 2024

Thanks @rtibbles for clarifying.

One side effect:

Kolibri 0.17.x pre-releases will become popular on Ubuntu 24.04 (Python 3.12) after that is released around "Earth Day" in late April (:

Related:

@MisRob
Copy link
Member

MisRob commented Feb 27, 2024

Testing Slack notification

@holta
Copy link
Author

holta commented Feb 27, 2024

Testing Slack notification

The spammy emails from kolibri repos seem to be gone for the moment!?

Though recurred in recent days:

X-Github-Sender: rtibbles
Reply-To: "learningequality/kolibri" <kolibri@noreply.github.com>
List-Archive: https://github.com/learningequality/kolibri
Date: Sat, 24 Feb 2024 19:02:55 -0800
List-Id: learningequality/kolibri <kolibri.learningequality.github.com>

...after the originals 2 weeks ago:

@holta
Copy link
Author

holta commented Feb 29, 2024

@rtibbles

Can you tell why https://github.com/learningequality/kolibri/releases/download/v0.16.0/kolibri_0.16.0-0ubuntu1_all.deb is failing on Ubuntu 23.10 — as logged in /var/log/syslog below?

(Does markdown.version <= '2.2' mean Ubuntu 23.10 is not allowed?)

2024-02-29T18:22:09.350210+00:00 box systemd[1]: Starting kolibri.service - Kolibri...
2024-02-29T18:22:09.478823+00:00 box kolibri[4698]: /usr/bin/kolibri:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
2024-02-29T18:22:09.478939+00:00 box kolibri[4698]:   from pkg_resources import load_entry_point
2024-02-29T18:22:09.547836+00:00 box kolibri[4698]: INFO: No C extensions are available for this platform
2024-02-29T18:22:11.108180+00:00 box kolibri[4698]: #033[37mINFO     2024-02-29 18:22:11,107 Option DEBUG in section [Server] being overridden by environment variable KOLIBRI_DEBUG#033[0m
2024-02-29T18:22:11.108436+00:00 box kolibri[4698]: #033[37mINFO     2024-02-29 18:22:11,107 Option DEBUG_LOG_DATABASE in section [Server] being overridden by environment variable KOLIBRI_DEBUG_LOG_DATABASE#033[0m
2024-02-29T18:22:11.108513+00:00 box kolibri[4698]: #033[37mINFO     2024-02-29 18:22:11,107 Option HTTP_PORT in section [Deployment] being overridden by environment variable KOLIBRI_HTTP_PORT#033[0m
2024-02-29T18:22:11.108570+00:00 box kolibri[4698]: #033[37mINFO     2024-02-29 18:22:11,108 Option URL_PATH_PREFIX in section [Deployment] being overridden by environment variable KOLIBRI_URL_PATH_PREFIX#033[0m
2024-02-29T18:22:11.111462+00:00 box kolibri[4698]: #033[37mINFO     2024-02-29 18:22:11,111 Attempting to setup using pre-migrated databases#033[0m
2024-02-29T18:22:11.581369+00:00 box kolibri[4698]: Error: Traceback (most recent call last):
2024-02-29T18:22:11.581466+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/utils/cli.py", line 193, in invoke
2024-02-29T18:22:11.581509+00:00 box kolibri[4698]:     initialize(**get_initialize_params())
2024-02-29T18:22:11.581557+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 285, in initialize
2024-02-29T18:22:11.581597+00:00 box kolibri[4698]:     _setup_django()
2024-02-29T18:22:11.581638+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/utils/main.py", line 154, in _setup_django
2024-02-29T18:22:11.581717+00:00 box kolibri[4698]:     django.setup()
2024-02-29T18:22:11.581760+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/__init__.py", line 27, in setup
2024-02-29T18:22:11.581803+00:00 box kolibri[4698]:     apps.populate(settings.INSTALLED_APPS)
2024-02-29T18:22:11.581846+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/registry.py", line 108, in populate
2024-02-29T18:22:11.581887+00:00 box kolibri[4698]:     app_config.import_models()
2024-02-29T18:22:11.581929+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/dist/django/apps/config.py", line 202, in import_models
2024-02-29T18:22:11.581973+00:00 box kolibri[4698]:     self.models_module = import_module(models_module_name)
2024-02-29T18:22:11.582017+00:00 box kolibri[4698]:                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T18:22:11.582058+00:00 box kolibri[4698]:   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
2024-02-29T18:22:11.582100+00:00 box kolibri[4698]:     return _bootstrap._gcd_import(name[level:], package, level)
2024-02-29T18:22:11.582145+00:00 box kolibri[4698]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T18:22:11.582185+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
2024-02-29T18:22:11.582225+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
2024-02-29T18:22:11.582265+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
2024-02-29T18:22:11.582305+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
2024-02-29T18:22:11.582345+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
2024-02-29T18:22:11.582385+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2024-02-29T18:22:11.582424+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/core/models.py", line 12, in <module>
2024-02-29T18:22:11.582470+00:00 box kolibri[4698]:     registered_plugins.register_non_plugins(settings.INSTALLED_APPS)
2024-02-29T18:22:11.582510+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/plugins/registry.py", line 150, in register_non_plugins
2024-02-29T18:22:11.582550+00:00 box kolibri[4698]:     initialize_kolibri_plugin(app)
2024-02-29T18:22:11.582601+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/plugins/utils/__init__.py", line 145, in initialize_kolibri_plugin
2024-02-29T18:22:11.582641+00:00 box kolibri[4698]:     plugin_module = importlib.import_module(plugin_name + ".kolibri_plugin")
2024-02-29T18:22:11.582709+00:00 box kolibri[4698]:                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T18:22:11.582750+00:00 box kolibri[4698]:   File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
2024-02-29T18:22:11.582789+00:00 box kolibri[4698]:     return _bootstrap._gcd_import(name[level:], package, level)
2024-02-29T18:22:11.582829+00:00 box kolibri[4698]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-02-29T18:22:11.582868+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
2024-02-29T18:22:11.582906+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
2024-02-29T18:22:11.582946+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
2024-02-29T18:22:11.582985+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
2024-02-29T18:22:11.583024+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
2024-02-29T18:22:11.583063+00:00 box kolibri[4698]:   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2024-02-29T18:22:11.583102+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/core/auth/kolibri_plugin.py", line 3, in <module>
2024-02-29T18:22:11.583140+00:00 box kolibri[4698]:     from kolibri.core.auth.sync_operations import KolibriSingleUserSyncOperation
2024-02-29T18:22:11.583181+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/core/auth/sync_operations.py", line 5, in <module>
2024-02-29T18:22:11.583222+00:00 box kolibri[4698]:     from morango.sync.operations import BaseOperation
2024-02-29T18:22:11.583261+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/dist/morango/sync/operations.py", line 18, in <module>
2024-02-29T18:22:11.583300+00:00 box kolibri[4698]:     from rest_framework.exceptions import ValidationError
2024-02-29T18:22:11.583353+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/exceptions.py", line 18, in <module>
2024-02-29T18:22:11.583393+00:00 box kolibri[4698]:     from rest_framework.compat import unicode_to_repr
2024-02-29T18:22:11.583432+00:00 box kolibri[4698]:   File "/usr/lib/python3/dist-packages/kolibri/dist/rest_framework/compat.py", line 176, in <module>
2024-02-29T18:22:11.583472+00:00 box kolibri[4698]:     if markdown.version <= '2.2':
2024-02-29T18:22:11.583511+00:00 box kolibri[4698]:        ^^^^^^^^^^^^^^^^
2024-02-29T18:22:11.583550+00:00 box kolibri[4698]: AttributeError: module 'markdown' has no attribute 'version'
2024-02-29T18:22:11.754515+00:00 box systemd[1]: kolibri.service: Control process exited, code=exited, status=1/FAILURE
2024-02-29T18:22:11.754629+00:00 box systemd[1]: kolibri.service: Failed with result 'exit-code'.
2024-02-29T18:22:11.754825+00:00 box systemd[1]: Failed to start kolibri.service - Kolibri.
2024-02-29T18:22:11.755139+00:00 box systemd[1]: kolibri.service: Consumed 2.402s CPU time.

@rtibbles
Copy link
Member

This seems to be exactly the same error as I had previously fixed, so I am a little mystified how this might be happening. The fix I applied will guarantee that as long as Kolibri is invoked prior to any markdown import that the error should not occur.

I am going to ask our QA team to replicate - I assume the same setup of python3-markdown being installed locally is occurring.

@holta
Copy link
Author

holta commented Feb 29, 2024

Thanks @rtibbles

(I can ask others to replicate on Ubuntu 23.10 VM's that are essentially instantly created using Multipass, if you need specific diagnostics...)

@holta
Copy link
Author

holta commented Feb 29, 2024

False Alarm:

I spoke with the person installing on Ubuntu 23.10 and he misunderstood the .deb install process, and so miscommunicated his results 😮

I'm asking him to install https://github.com/learningequality/kolibri/releases/download/v0.16.0/kolibri_0.16.0-0ubuntu1_all.deb according to the correct instructions now...

@holta
Copy link
Author

holta commented Feb 29, 2024

Confirmed that 0.16.0 runs on Ubuntu 23.10

He apologizes for the false report.

(He had installed 0.15.12 while erroneously believing he had installed 0.16.0)

@rtibbles
Copy link
Member

Phew, that is a relief!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 - critical Priority: Release blocker or regression
Projects
None yet
Development

No branches or pull requests

5 participants