Awais, Additionally, I reviewed the toaster-requirements.txt file and noticed that the MySQLdb module is missing. While this might not cause an issue, if you do encounter MySQLdb problems, you can resolve it by running:
$ pip3 install mysql-python # In virtualenv Please see: https://stackoverflow.com/a/15312750 Thanks Alassane ----- Original Message ----- From: "Alassane Yattara" <[email protected]> To: "Awais Belal" <[email protected]> Cc: "toaster" <[email protected]> Sent: Monday, October 21, 2024 6:20:39 PM Subject: Re: [Toaster] Toaster compatibility issues Hello Awais, The error you're encountering occurs because you're using a virtual environment (which is a good practice and also recommended), but you forgot to install the required Python libraries to run Toaster. Toaster requires additional Python dependencies to function. These dependencies are defined in a file called toaster-requirements.txt, located in the bitbake directory at the root of the Source Directory (e.g., poky/bitbake/toaster-requirements.txt). You need to run one more step before starting Toaster: pip3 install -r bitbake/toaster-requirements.txt. For more details, please refer to this link: https://docs.yoctoproject.org/4.3.4/toaster-manual/start.html#establishing-toaster-system-dependencies Steps: $ cd /projects/project2/ $ source poky/oe-init build $ source venv/bin/activate $ pip3 install -r bitbake/toaster-requirements.txt # From root directory 'poky/' $ source toaster start noweb No, The issue isn't related to the Poky version change. Thanks Alassane ----- Original Message ----- From: "Awais Belal" <[email protected]> To: "toaster" <[email protected]> Sent: Monday, October 21, 2024 4:25:50 PM Subject: [Toaster] Toaster compatibility issues Hello, We are using an implementation of a build server which utilizes toaster for build artifact/stage presentation. In order to achieve this we run a main instance with nobuild which lives outside of our build environments i.e. [ https://docs.yoctoproject.org/4.3.4/toaster-manual/setup-and-use.html#setting-up-toaster-without-a-build-server | https://docs.yoctoproject.org/4.3.4/toaster-manual/setup-and-use.html#setting-up-toaster-without-a-build-server ] as we only want the web interface to catch and show our command line builds cd /var/www/toaster/ source poky/oe-init-build-env source toaster start nobuild then from our build environments we run a noweb instance i.e. [ https://docs.yoctoproject.org/4.3.4/toaster-manual/setup-and-use.html#setting-up-toaster-without-a-web-server | https://docs.yoctoproject.org/4.3.4/toaster-manual/setup-and-use.html#setting-up-toaster-without-a-web-server ] source /projects/project1/poky/oe-init-build-env source toaster start noweb bitbake target source toaster stop and all is good. This works well where projects as well as the main instance of poky used to launch the webserver share the same version, say gatesgarth. However, then comes a time where one of the projects moves on to a later version of poky, say scarthgap, and the noweb launch starts having issues. We setup a venv in that particular build env and install all the toaster reqs. Starting the noweb instance at this point $ cd /projects/project2/ $ source poky/oe-init build $ source venv/bin/activate $ source toaster start noweb The system will start. Traceback (most recent call last): File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 15, in <module> import MySQLdb as Database ModuleNotFoundError: No module named 'MySQLdb' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/projects/project2/sources/poky/bitbake/bin/../lib/toaster/manage.py", line 16, in <module> execute_from_command_line(sys.argv) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/projects/project2/build/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 395, in execute django.setup() File "/projects/project2/build/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate app_config.import_models() File "/projects/project2/build/venv/lib/python3.6/site-packages/django/apps/config.py", line 301, in import_models self.models_module = import_module(models_module_name) File "/projects/project2/build/venv/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/projects/project2/build/venv/lib/python3.6/site-packages/django/contrib/auth/models.py", line 3, in <module> from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager File "/projects/project2/build/venv/lib/python3.6/site-packages/django/contrib/auth/base_user.py", line 48, in <module> class AbstractBaseUser(models.Model): File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/models/base.py", line 122, in __new__ new_class.add_to_class('_meta', Options(meta, app_label)) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/models/base.py", line 326, in add_to_class value.contribute_to_class(cls, name) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/models/options.py", line 207, in contribute_to_class self.db_table = truncate_name(self.db_table, connection.ops.max_name_length()) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/utils/connection.py", line 15, in __getattr__ return getattr(self._connections[self._alias], item) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/utils/connection.py", line 62, in __getitem__ conn = self.create_connection(alias) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/utils.py", line 204, in create_connection backend = load_backend(db['ENGINE']) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/utils.py", line 111, in load_backend return import_module('%s.base' % backend_name) File "/projects/project2/build/venv/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/projects/project2/build/venv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 20, in <module> ) from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient? Failed migrations, halting system start Failed start. Any ideas what might be going wrong here? Also, any suggestions of doing this in a way that could save us from compatibility issues when the poky version moves?
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#6168): https://lists.yoctoproject.org/g/toaster/message/6168 Mute This Topic: https://lists.yoctoproject.org/mt/109134636/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/toaster/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
