Failed to get layers information

I am getting errors similar to here when adding a custom layer, when trying to build torizon-core-docker

However, I have checked that my layers are version controlled by Git, and am still running into ostreecommit failures like

 DEBUG: Python function extend_recipe_sysroot finished
| WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
| DEBUG: Executing shell function do_image_ostreecommit
| error: Parsing oe.layers=None : 0:expected value
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/beb/npu-test/bsp-synchron/build-torizon/tmp/work/verdin_imx8mp_scu-tdx-linux/torizon-core-docker/1.0-r0/temp/run.do_image_ostreecommit.3317601' failed with exit code 1
ERROR: Task (/home/beb/npu-test/bsp-synchron/build-torizon/conf/../../layers/meta-toradex-torizon/recipes-images/images/torizon-core-docker.bb:do_image_ostreecommit) failed with exit code '1'

Am I correct in thinking that this error is pointing to an issue with my meta-toradex-torizon layer (based on the error)? If so, how would I resolve it

Florence L

1 Like

I’ve been digging into the do_image_ostreecommit function that appears to be failing and trying to understand how it’s parsing my layer structure

How exactly does ostree pull that information?

I’m seeing the same issue, although I’m trying to build for the Apalis-imx8.

I reverted to creating a clean build, without my custom layers, following the instructions here, but I’m still seeing the same problem.

I.e. the exact instructions I’m running:

mgh@testbox:~$ mkdir -p temp/TorizonCore
mgh@testbox:~$ cd temp/TorizonCore/
mgh@testbox:~/temp/TorizonCore$ repo init -u https://git.toradex.com/toradex-manifest.git -b dunfell-5.x.y -m torizoncore/default.xml
mgh@testbox:~/temp/TorizonCore$ repo sync --no-clone-bundle
mgh@testbox:~/temp/TorizonCore$ MACHINE=apalis-imx8 source setup-environment build
mgh@testbox:~/temp/TorizonCore/build$ echo 'ACCEPT_FSL_EULA = "1"' >> conf/local.conf
mgh@testbox:~/temp/TorizonCore/build$ bitbake torizon-core-lite

But that gives me the following error:

| DEBUG: Python function extend_recipe_sysroot finished
| WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>
| DEBUG: Executing shell function do_image_ostreecommit
| error: opendir(objects): No such file or directory
| error: Parsing oe.layers=None : 0:expected value
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/mgh/temp/TorizonCore/build/tmp/work/apalis_imx8-tdx-linux/torizon-core-lite/1.0-r0/temp/run.do_image_ostreecommit.96676' failed with exit code 1
ERROR: Task (/home/mgh/temp/TorizonCore/build/conf/../../layers/meta-toradex-torizon/recipes-images/images/torizon-core-lite.bb:do_image_ostreecommit) failed with exit code '1'

Or, to give the full list of warnings/errors:

WARNING: busybox-1.31.1-r0 do_fetch: Failed to fetch URL https://busybox.net/downloads/busybox-1.31.1.tar.bz2;name=tarball, attempting MIRRORS if available                                                                                  
WARNING: base-passwd-3.5.29-r0 do_patch: Fuzz detected:                                                                                                                                                                                      
                                                                                                                                                                                                                                             
Applying patch missing_systemd_basic.patch                                                                                                                                                                                                   
patching file group.master                                                                                                                                                                                                                   
Hunk #1 succeeded at 36 with fuzz 2.                                                                                                                                                                                                         
                                                                                                                                                                                                                                             
The context lines in the patches can be updated with devtool:                                                                                                                                                                                
                                                                                                                                                                                                                                             
    devtool modify base-passwd                                                                                                                                                                                                               
    devtool finish --force-patch-refresh base-passwd <layer_path>                                                                                                                                                                            
                                                                                                                                                                                                                                             
Don't forget to review changes done by devtool!                                                                                                                                                                                              
                                                                                                                                                                                                                                             
WARNING: base-passwd-3.5.29-r0 do_patch: QA Issue: Patch log indicates that patches do not apply cleanly. [patch-fuzz]                                                                                                                       
WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                                                    
WARNING: torizon-core-lite-1.0-r0 do_rootfs: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                
WARNING: torizon-core-lite-1.0-r0 do_rootfs: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                
WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                                                    
WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                                                    
WARNING: torizon-core-lite-1.0-r0 do_image: Android repo tool failed to run; manifest not copied                                                                                                                                             
WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                                                    
WARNING: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                                                                    
WARNING: torizon-core-lite-1.0-r0 do_image_ostreecommit: Failed to get layers information. Exception: <class 'bb.process.ExecutionError'>                                                                                                    
ERROR: torizon-core-lite-1.0-r0 do_image_ostreecommit: Execution of '/home/mgh/temp/TorizonCore/build/tmp/work/apalis_imx8-tdx-linux/torizon-core-lite/1.0-r0/temp/run.do_image_ostreecommit.96676' failed with exit code 1  
ERROR: Logfile of failure stored in: /home/mgh/temp/TorizonCore/build/tmp/work/apalis_imx8-tdx-linux/torizon-core-lite/1.0-r0/temp/log.do_image_ostreecommit.96676                                                                                                                                                                                                                              

I see the same issue if I try bitbake torizon-core-docker instead.

Note, this was working fine, on the same computer, last time I tried it, a week or so ago. I don’t think anything has changed on my side.

Git parsing my meta-layer directories for rev and branch name also works, which is what I thought ostreecommit was doing.

Is it worth a totally clean build or is there a clean fix?

@Mariusz found the cause, and solution, at least for the problem I was seeing.

The problem was caused by a git update (which all the major distros patched last week).

After running:
find /path/to/torizon/layers/* -maxdepth 0 -type d | xargs -I{} git config --global --add safe.directory {}
the build (bitbake) succeeds.

My issue was partially resolved by the safe.directory fix, but the ultimate workaround for the bug was o go into image_type_torizon.bbclassand simply remove the oe.layers from the metadata in the ostreecommit, after which the build works fine.

What ramifications are there for OTA using actualizr of excluding that metadata?

Hello @beb . The fix is already on github: image_type_torizon: fix issue when generating the image · toradex/meta-toradex-torizon@256b379 · GitHub

We’re having the same issue.

Why would this issue happened when your repo sync happens on special SHA (HASH) of meta-toradex-torizon?

We had it working 2 weeks back perfectly from scratch build and now it is failing. Is there any reason or conclusion?

Hi @dpatel, as @Mariusz has shared this issue should have been resolved with the fix here: image_type_torizon: fix issue when generating the image · toradex/meta-toradex-torizon@256b379 · GitHub

Unless you’re referring to a different issue than the original post.

Best Regards,
Jeremias

We are using latest SHA already to move pass this issue. thanks for sharing the information.

Ok good to hear.