Skip to content

Instantly share code, notes, and snippets.

@muditchoudhary
Last active October 29, 2023 14:17
Show Gist options
  • Save muditchoudhary/9356b3d817ef8bac99e5e5b296bbdbe2 to your computer and use it in GitHub Desktop.
Save muditchoudhary/9356b3d817ef8bac99e5e5b296bbdbe2 to your computer and use it in GitHub Desktop.
`yarn run devserver-hot` gives error: `AttributeError: module 'le_utils.constants.format_presets' has no attribute 'IMSCP_ZIP'`
(kolibri-py3.9) mudit@mudit-desktop:~/kolibri$ yarn run devserver-hot
yarn run v1.22.19
$ concurrently --passthrough-arguments --kill-others "yarn:watch-hot --watchonly {1}" yarn:python-devserver yarn:hashi-dev --
$ yarn run watch --hot --watchonly
$ kolibri start --debug --foreground --port=8000 --settings=kolibri.deployment.default.settings.dev
$ yarn workspace hashi run dev
$ kolibri-tools build dev --file ./build_tools/build_plugins.txt --cache --hot --watchonly
$ yarn run build-base --mode=development --watch
[python-devserver] DEBUG 2023-10-29 19:36:00,264 Loading kolibri plugin registry...
$ webpack --config ./webpack.config.js --mode=development --watch
[python-devserver] DEBUG 2023-10-29 19:36:01,685 Loaded kolibri plugin: kolibri.plugins.perseus_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,685 kolibri.plugins.perseus_viewer.main added to registry for defined hook: <class 'kolibri.core.content.hooks.ContentRendererHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,685 kolibri.plugins.perseus_viewer.main added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,685 Initializing plugin: kolibri.plugins.perseus_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,691 Loaded kolibri plugin: kolibri.plugins.learn
[python-devserver] DEBUG 2023-10-29 19:36:01,692 kolibri.plugins.learn.LearnRedirect added to registry for defined hook: <class 'kolibri.core.hooks.RoleBasedRedirectHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,692 kolibri.plugins.learn.side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,692 kolibri.plugins.learn.side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,692 kolibri.plugins.learn.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,692 kolibri.plugins.learn.my_downloads_app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,692 kolibri.plugins.learn.LearnContentNodeHook added to registry for defined hook: <class 'kolibri.core.content.hooks.ContentNodeDisplayHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,693 kolibri.plugins.learn.NetworkDiscoveryForSoUDHook added to registry for defined hook: <class 'kolibri.core.discovery.hooks.NetworkLocationDiscoveryHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,693 kolibri.plugins.learn.NetworkBroadcastForSoUDHook added to registry for defined hook: <class 'kolibri.core.discovery.hooks.NetworkLocationBroadcastHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,693 kolibri.plugins.learn.my_downloads_side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,693 kolibri.plugins.learn.my_downloads_side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,693 Initializing plugin: kolibri.plugins.learn
[python-devserver] DEBUG 2023-10-29 19:36:01,695 Loaded kolibri plugin: kolibri.plugins.setup_wizard
[python-devserver] DEBUG 2023-10-29 19:36:01,695 kolibri.plugins.setup_wizard.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,695 kolibri.plugins.setup_wizard.SetupWizardHook added to registry for defined hook: <class 'kolibri.core.device.hooks.SetupHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,695 Initializing plugin: kolibri.plugins.setup_wizard
[python-devserver] DEBUG 2023-10-29 19:36:01,698 Loaded kolibri plugin: kolibri.plugins.user_auth
[python-devserver] DEBUG 2023-10-29 19:36:01,698 kolibri.plugins.user_auth.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,698 kolibri.plugins.user_auth.LogInRedirect added to registry for defined hook: <class 'kolibri.core.hooks.RoleBasedRedirectHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,698 kolibri.plugins.user_auth.login_side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,698 kolibri.plugins.user_auth.login_side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,699 Initializing plugin: kolibri.plugins.user_auth
[python-devserver] DEBUG 2023-10-29 19:36:01,700 Loaded kolibri plugin: kolibri.plugins.facility
[python-devserver] DEBUG 2023-10-29 19:36:01,700 kolibri.plugins.facility.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,700 kolibri.plugins.facility.FacilityRedirect added to registry for defined hook: <class 'kolibri.core.hooks.RoleBasedRedirectHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,701 kolibri.plugins.facility.side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,701 kolibri.plugins.facility.side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,701 Initializing plugin: kolibri.plugins.facility
[python-devserver] DEBUG 2023-10-29 19:36:01,702 Loaded kolibri plugin: kolibri.plugins.epub_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,703 kolibri.plugins.epub_viewer.main added to registry for defined hook: <class 'kolibri.core.content.hooks.ContentRendererHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,703 kolibri.plugins.epub_viewer.main added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,703 Initializing plugin: kolibri.plugins.epub_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,704 Loaded kolibri plugin: kolibri.plugins.slideshow_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,704 kolibri.plugins.slideshow_viewer.main added to registry for defined hook: <class 'kolibri.core.content.hooks.ContentRendererHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,704 kolibri.plugins.slideshow_viewer.main added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,704 Initializing plugin: kolibri.plugins.slideshow_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,706 Loaded kolibri plugin: kolibri.plugins.media_player
[python-devserver] DEBUG 2023-10-29 19:36:01,706 kolibri.plugins.media_player.main added to registry for defined hook: <class 'kolibri.core.content.hooks.ContentRendererHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,706 kolibri.plugins.media_player.main added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,706 Initializing plugin: kolibri.plugins.media_player
[python-devserver] DEBUG 2023-10-29 19:36:01,709 Loaded kolibri plugin: kolibri.plugins.coach
[python-devserver] DEBUG 2023-10-29 19:36:01,710 kolibri.plugins.coach.CoachRedirect added to registry for defined hook: <class 'kolibri.core.hooks.RoleBasedRedirectHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,710 kolibri.plugins.coach.side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,711 kolibri.plugins.coach.side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,711 kolibri.plugins.coach.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,711 kolibri.plugins.coach.NetworkDiscoveryForSoUDHook added to registry for defined hook: <class 'kolibri.core.discovery.hooks.NetworkLocationDiscoveryHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,711 Initializing plugin: kolibri.plugins.coach
[python-devserver] DEBUG 2023-10-29 19:36:01,713 Loaded kolibri plugin: kolibri.plugins.pdf_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,714 kolibri.plugins.pdf_viewer.main added to registry for defined hook: <class 'kolibri.core.content.hooks.ContentRendererHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,714 kolibri.plugins.pdf_viewer.main added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,715 Initializing plugin: kolibri.plugins.pdf_viewer
[python-devserver] DEBUG 2023-10-29 19:36:01,717 Loaded kolibri plugin: kolibri.plugins.default_theme
[python-devserver] DEBUG 2023-10-29 19:36:01,717 kolibri.plugins.default_theme.DefaultThemeHook added to registry for defined hook: <class 'kolibri.core.theme_hook.ThemeHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,717 Initializing plugin: kolibri.plugins.default_theme
[python-devserver] DEBUG 2023-10-29 19:36:01,719 Loaded kolibri plugin: kolibri.plugins.user_profile
[python-devserver] DEBUG 2023-10-29 19:36:01,719 kolibri.plugins.user_profile.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,720 kolibri.plugins.user_profile.user_profile_side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,720 kolibri.plugins.user_profile.user_profile_side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,720 Initializing plugin: kolibri.plugins.user_profile
[python-devserver] DEBUG 2023-10-29 19:36:01,721 Loaded kolibri plugin: kolibri.plugins.device
[python-devserver] DEBUG 2023-10-29 19:36:01,722 kolibri.plugins.device.app added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,722 kolibri.plugins.device.DeviceRedirect added to registry for defined hook: <class 'kolibri.core.hooks.RoleBasedRedirectHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,722 kolibri.plugins.device.side_nav added to registry for defined hook: <class 'kolibri.core.hooks.NavigationHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,722 kolibri.plugins.device.side_nav added to registry for defined hook: <class 'kolibri.core.webpack.hooks.WebpackBundleHook'>
[python-devserver] DEBUG 2023-10-29 19:36:01,722 Initializing plugin: kolibri.plugins.device
[python-devserver] Error: Traceback (most recent call last):
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/cli.py", line 193, in invoke
[python-devserver] initialize(**get_initialize_params())
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/main.py", line 283, in initialize
[python-devserver] _upgrades_before_django_setup(updated, version)
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/main.py", line 210, in _upgrades_before_django_setup
[python-devserver] if OPTIONS["Database"]["DATABASE_ENGINE"] == "sqlite":
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/envs/kolibri-py3.9/lib/python3.9/site-packages/django/utils/functional.py", line 238, in inner
[python-devserver] self._setup()
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/envs/kolibri-py3.9/lib/python3.9/site-packages/django/utils/functional.py", line 386, in _setup
[python-devserver] self._wrapped = self._setupfunc()
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/conf.py", line 54, in __initialize_options
[python-devserver] return read_options_file()
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/options.py", line 870, in read_options_file
[python-devserver] conf = ConfigObj(ini_path, configspec=get_configspec())
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/options.py", line 768, in get_configspec
[python-devserver] for section, opts in option_spec.items():
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/envs/kolibri-py3.9/lib/python3.9/site-packages/django/utils/functional.py", line 238, in inner
[python-devserver] self._setup()
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/envs/kolibri-py3.9/lib/python3.9/site-packages/django/utils/functional.py", line 386, in _setup
[python-devserver] self._wrapped = self._setupfunc()
[python-devserver] File "/home/mudit/kolibri/kolibri/utils/options.py", line 728, in _get_option_spec
[python-devserver] option_spec = extend_config_spec(base_option_spec)
[python-devserver] File "/home/mudit/kolibri/kolibri/plugins/utils/options.py", line 110, in extend_config_spec
[python-devserver] for plugin_instance in registered_plugins:
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/envs/kolibri-py3.9/lib/python3.9/site-packages/django/utils/functional.py", line 238, in inner
[python-devserver] self._setup()
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/envs/kolibri-py3.9/lib/python3.9/site-packages/django/utils/functional.py", line 386, in _setup
[python-devserver] self._wrapped = self._setupfunc()
[python-devserver] File "/home/mudit/kolibri/kolibri/plugins/registry.py", line 177, in __initialize
[python-devserver] registry.register_plugins(config.ACTIVE_PLUGINS)
[python-devserver] File "/home/mudit/kolibri/kolibri/plugins/registry.py", line 117, in register_plugins
[python-devserver] plugin_object = initialize_kolibri_plugin(app)
[python-devserver] File "/home/mudit/kolibri/kolibri/plugins/utils/__init__.py", line 156, in initialize_kolibri_plugin
[python-devserver] plugin_module = importlib.import_module(plugin_module_name)
[python-devserver] File "/home/mudit/.pyenv/versions/3.9.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
[python-devserver] return _bootstrap._gcd_import(name[level:], package, level)
[python-devserver] File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
[python-devserver] File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
[python-devserver] File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
[python-devserver] File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
[python-devserver] File "<frozen importlib._bootstrap_external>", line 850, in exec_module
[python-devserver] File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
[python-devserver] File "/home/mudit/kolibri/kolibri/plugins/html5_viewer/kolibri_plugin.py", line 17, in <module>
[python-devserver] class HTML5AppAsset(content_hooks.ContentRendererHook):
[python-devserver] File "/home/mudit/kolibri/kolibri/plugins/html5_viewer/kolibri_plugin.py", line 22, in HTML5AppAsset
[python-devserver] format_presets.IMSCP_ZIP,
[python-devserver] AttributeError: module 'le_utils.constants.format_presets' has no attribute 'IMSCP_ZIP'
[python-devserver]
[watch-hot] /home/mudit/kolibri/packages/kolibri-tools/lib/webpack_json.py:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
[watch-hot] from pkg_resources import DistributionNotFound
[watch-hot] Gathering relevant modules from ['kolibri.core', 'kolibri.plugins.*']
[watch-hot] Writing webpack_json output to /tmp/2023929-92498-1leso61.3cal.json
[watch-hot] INFO: Writing webpack_json output to /tmp/2023929-92498-1leso61.3cal.json
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[python-devserver] yarn run python-devserver exited with code 1
--> Sending SIGTERM to other processes..
[watch-hot] yarn run watch-hot --watchonly exited with code SIGTERM
--> Sending SIGTERM to other processes..
[hashi-dev] yarn run hashi-dev exited with code SIGTERM
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment