Search code examples
pythoncommand-lineembeddedyoctobitbake

bitbake encounters with error after starting Toaster


I've successfully used Yocto to create an image for an IoT gateway based on imx8 processor. Before starting the Toaster, everything is ok and I can do every bitbake command, successfully in the command line, however, after starting the Toaster to have web access to the command line build, every bitbake command terminates with the following error, even after stopping the Toaster.

For more information, I post all the output from a fresh Yocto project because it may help to find the answer, as follows.

It should be noted that it complains about No such file or directory, however, the directory exists.

$ MACHINE=iot-gate-imx8 DISTRO=fsl-imx-xwayland source compulab-setup-env -b build
 Build directory is  build
/home/reza/compulab-freescale-bsp

Welcome to Freescale Community BSP

The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

Your build environment has been configured with:

    MACHINE=iot-gate-imx8
    SDKMACHINE=i686
    DISTRO=fsl-imx-xwayland
    EULA=1
BSPDIR=
BUILD_DIR=.
meta-freescale directory found
$ ~/compulab-freescale-bsp/build$ source toaster start
The system will start.
Check if toaster can listen on localhost:8000
OK
Operations to perform:
  Apply all migrations: admin, auth, bldcontrol, contenttypes, orm, sessions
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying admin.0002_logentry_remove_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying contenttypes.0002_remove_content_type_name... OK
  Applying auth.0002_alter_permission_name_max_length... OK
  Applying auth.0003_alter_user_email_max_length... OK
  Applying auth.0004_alter_user_username_opts... OK
  Applying auth.0005_alter_user_last_login_null... OK
  Applying auth.0006_require_contenttypes_0002... OK
  Applying auth.0007_alter_validators_add_error_messages... OK
  Applying auth.0008_alter_user_username_max_length... OK
  Applying auth.0009_alter_user_last_name_max_length... OK
  Applying auth.0010_alter_group_name_max_length... OK
  Applying auth.0011_update_proxy_permissions... OK
  Applying orm.0001_initial... OK
  Applying bldcontrol.0001_initial... OK
  Applying bldcontrol.0002_auto_20160120_1250... OK
  Applying bldcontrol.0003_add_cancelling_state... OK
  Applying bldcontrol.0004_auto_20160523_1446... OK
  Applying bldcontrol.0005_reorder_buildrequest_states... OK
  Applying bldcontrol.0006_brlayer_local_source_dir... OK
  Applying bldcontrol.0007_brlayers_optional_gitinfo... OK
  Applying orm.0002_customimagerecipe... OK
  Applying orm.0003_customimagepackage... OK
  Applying orm.0004_provides... OK
  Applying orm.0005_task_field_separation... OK
  Applying orm.0006_add_cancelled_state... OK
  Applying orm.0007_auto_20160523_1446... OK
  Applying orm.0008_refactor_artifact_models... OK
  Applying orm.0009_target_package_manifest_path... OK
  Applying orm.0010_delete_layer_source_references... OK
  Applying orm.0011_delete_layersource... OK
  Applying orm.0012_use_release_instead_of_up_branch...Converting all layer version up_branches to releases
 OK
  Applying orm.0013_recipe_parse_progress_fields... OK
  Applying orm.0014_allow_empty_buildname... OK
  Applying orm.0015_layer_local_source_dir... OK
  Applying orm.0016_clone_progress... OK
  Applying orm.0017_distro_clone... OK
  Applying orm.0018_project_specific... OK
  Applying orm.0019_django_2_2... OK
  Applying sessions.0001_initial... OK

Build configuration saved
Loading default settings
Installed 7 object(s) from 1 fixture(s)
Loading poky configuration
Installed 36 object(s) from 1 fixture(s)
Importing custom settings if present
NOTE: optional fixture 'custom' not found

Fetching information from the layer index, please wait.
You can re-update any time later by running bitbake/lib/toaster/manage.py lsupdates

2023-01-10 10:05:34,502 INFO Fetching metadata for dunfell HEAD master gatesgarth
/2023-01-10 10:07:07,841 INFO Processing releases
Updating Releases 100%
2023-01-10 10:07:07,844 INFO Processing layers
Updating layers 100%
2023-01-10 10:07:08,166 INFO Processing layer versions
Updating layer versions 100%
2023-01-10 10:07:08,993 INFO Processing layer version dependencies
2023-01-10 10:07:09,082 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:61 meta-mel (master)
2023-01-10 10:07:09,090 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:65 meta-baryon (master)
2023-01-10 10:07:09,104 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:76 meta-netmodule (master)
2023-01-10 10:07:09,131 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:52 lv:97 meta-openstack (master)
2023-01-10 10:07:09,134 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:52 lv:98 meta-openstack-compute-deploy (master)
2023-01-10 10:07:09,139 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:52 lv:99 meta-openstack-controller-deploy (master)
2023-01-10 10:07:09,144 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:52 lv:100 meta-openstack-qemu (master)
2023-01-10 10:07:09,183 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:122 meta-crosswalk (master)
2023-01-10 10:07:09,194 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:129 meta-cgl (master)
2023-01-10 10:07:09,274 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:175 meta-openbmc (master)
2023-01-10 10:07:09,283 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:36 lv:178 meta-agl-demo (master)
2023-01-10 10:07:09,285 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:178 meta-agl-demo (master)
2023-01-10 10:07:09,317 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:36 lv:204 meta-lxde (master)
2023-01-10 10:07:09,328 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:40 lv:208 meta-toradex-demos (master)
2023-01-10 10:07:09,330 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:56 lv:208 meta-toradex-demos (master)
2023-01-10 10:07:09,355 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:215 meta-bc (master)
2023-01-10 10:07:09,410 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:239 meta-sdl (master)
2023-01-10 10:07:09,451 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:256 meta-meson (master)
2023-01-10 10:07:09,543 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:511 lv:292 meta-webosose (master)
2023-01-10 10:07:09,816 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:76 lv:406 meta-mediatek (master)
2023-01-10 10:07:09,876 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:346 lv:447 meta-intel (gatesgarth)
2023-01-10 10:07:09,877 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:345 lv:447 meta-intel (gatesgarth)
2023-01-10 10:07:10,013 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:33 lv:471 meta-chromebook (gatesgarth)
2023-01-10 10:07:10,075 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:345 lv:621 meta-intel (dunfell)
2023-01-10 10:07:10,248 WARNING Cannot find layer version (ls:<orm.management.commands.lsupdates.Command object at 0x7faeaa1e4130>),up_id:33 lv:623 meta-chromebook (dunfell)
Updating Layer version dependencies 100%
2023-01-10 10:07:11,235 INFO Processing distro information
Updating distros 100%
2023-01-10 10:07:11,459 INFO Processing machine information
Updating machines 100%
2023-01-10 10:07:13,203 INFO Processing recipe information
Updating recipes 100%
Starting webserver...
Toaster development webserver started at http://localhost:8000

You can now run 'bitbake <target>' on the command line and monitor your build in Toaster.
You can also use a Toaster project to configure and run a build.

Successful start.
$ ~/compulab-freescale-bsp/build$ bitbake core-image-full-cmdline
**NOTE: ToasterUI waiting for events
WARNING: Unable to get checksum for u-boot-compulab-fw-utils-cross SRC_URI entry cl_setenv: file could not be found
WARNING: Unable to get checksum for u-boot-compulab-fw-utils SRC_URI entry cl_setenv: file could not be found
NOTE: Resolving any missing task queue dependencies
ERROR: Execution of event handler 'defaulttoaster_layerinfo_dumpdata' failed
Traceback (most recent call last):
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 78, in _get_layer_dict(layer_path='\t/home/reza/compulab-freescale-bsp/sources/meta-compulab'):
             layer_info['layer_index_url'] = layer_url.format(layer=layer_url_name)
    >        layer_info['version'] = _get_layer_version_information(layer_path)
     
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 61, in _get_layer_version_information(layer_path='\t/home/reza/compulab-freescale-bsp/sources/meta-compulab'):
             layer_version_info = {}
    >        layer_version_info['branch'] = _get_git_branch(layer_path)
             layer_version_info['commit'] = _get_git_revision(layer_path)
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 35, in _get_git_branch(layer_path='\t/home/reza/compulab-freescale-bsp/sources/meta-compulab'):
         def _get_git_branch(layer_path):
    >        branch = subprocess.Popen("git symbolic-ref HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0]
             branch = branch.decode('utf-8')
  File "/usr/lib/python3.8/subprocess.py", line 858, in Popen.__init__(args='git symbolic-ref HEAD 2>/dev/null ', bufsize=-1, executable=None, stdin=None, stdout=-1, stderr=None, preexec_fn=None, close_fds=True, shell=True, cwd='\t/home/reza/compulab-freescale-bsp/sources/meta-compulab', env=None, universal_newlines=None, startupinfo=None, creationflags=0, restore_signals=True, start_new_session=False, pass_fds=(), encoding=None, errors=None, text=None):
     
    >            self._execute_child(args, executable, preexec_fn, close_fds,
                                     pass_fds, cwd, env,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in Popen._execute_child(args=['/bin/sh', '-c', 'git symbolic-ref HEAD 2>/dev/null '], executable=b'/bin/sh', preexec_fn=None, close_fds=True, pass_fds=(), cwd='\t/home/reza/compulab-freescale-bsp/sources/meta-compulab', env=None, startupinfo=None, creationflags=0, shell=True, p2cread=-1, p2cwrite=-1, c2pread=21, c2pwrite=55, errread=-1, errwrite=-1, restore_signals=True, start_new_session=False):
                             err_msg = os.strerror(errno_num)
    >                    raise child_exception_type(errno_num, err_msg, err_filename)
                     raise child_exception_type(err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '\t/home/reza/compulab-freescale-bsp/sources/meta-compulab'
ERROR: Command execution failed: Traceback (most recent call last):
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/command.py", line 117, in runAsyncCommand
    commandmethod(self.cmds_async, self, options)
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/command.py", line 587, in buildTargets
    command.cooker.buildTargets(pkgs_to_build, task)
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/cooker.py", line 1520, in buildTargets
    taskdata, runlist = self.buildTaskData(targets, task, self.configuration.abort)
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/cooker.py", line 723, in buildTaskData
    bb.event.fire(bb.event.TreeDataPreparationCompleted(len(fulltargetlist)), self.data)
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/event.py", line 216, in fire
    fire_class_handlers(event, d)
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/event.py", line 123, in fire_class_handlers
    execute_handler(name, handler, event, d)
  File "/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/event.py", line 93, in execute_handler
    ret = handler(event)
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 88, in defaulttoaster_layerinfo_dumpdata
    llayerinfo[layer] = _get_layer_dict(layer)
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 78, in _get_layer_dict
    layer_info['version'] = _get_layer_version_information(layer_path)
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 61, in _get_layer_version_information
    layer_version_info['branch'] = _get_git_branch(layer_path)
  File "/home/reza/compulab-freescale-bsp/sources/poky/meta/classes/toaster.bbclass", line 35, in _get_git_branch
    branch = subprocess.Popen("git symbolic-ref HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0]
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '\t/home/reza/compulab-freescale-bsp/sources/meta-compulab'
NOTE: Build exited with errorcode 1
NOTE: buildinfohelper: All events saved
NOTE: Logging error 2: {'build': <Build: 1 Project object (1) core-image-full-cmdline>, 'level': 1, 'message': 'Unable to get checksum for u-boot-compulab-fw-utils-cross SRC_URI entry cl_setenv: file could not be found', 'pathname': '/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/__init__.py', 'lineno': 158}
NOTE: Logging error 2: {'build': <Build: 1 Project object (1) core-image-full-cmdline>, 'level': 1, 'message': 'Unable to get checksum for u-boot-compulab-fw-utils SRC_URI entry cl_setenv: file could not be found', 'pathname': '/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/__init__.py', 'lineno': 158}
NOTE: Logging error 2: {'build': <Build: 1 Project object (1) core-image-full-cmdline>, 'level': 2, 'message': "Execution of event handler 'defaulttoaster_layerinfo_dumpdata' failed", 'pathname': '/home/reza/compulab-freescale-bsp/sources/poky/bitbake/lib/bb/event.py', 'lineno': 98}
NOTE: ToasterUI build done, brbe: None
WARNING: Return value is 0

After starting the Toaster, the web page is: enter image description here and after having the above-listed command line build (e.g. bitbake some-target) it changes as follows, and shows the above command line error: enter image description here


Solution

  • It sources from a wrong “\t” before path. I resolved this by adding the following line before getlayer_version_information to correct this problem.

    layer_path = layer_path.lstrip()
    

    I think this problem originated from different poky branch, because after starting the Toaster, it download from the dunfell while according to the vendor document the hardknott branch is selected.