Bug 6804

Summary: do_rootfs fails for btrfs image build
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Costin <costin.c.constantin>
Component: coreAssignee: Saul Wold <sgw>
Status: RESOLVED FIXED QA Contact: Costin <costin.c.constantin>
Severity: normal    
Priority: Medium CC: alejandro.hernandez, alexandru.c.georgescu, bogdanx.a.voiculescu, ionutx.chisanovici, meta.mr.watcher, meta.watcher
Version: 1.7   
Target Milestone: 1.8   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: Regression (Used to work)
Verified: Documentation change: Don't know
Attachments:
Description Flags
log file
none
local.conf
none
bblayers.conf
none
steps performed
none
do_rootfs_log
none
log.do_rootfs none

Description Costin 2014-10-06 14:12:56 UTC
Hello,

Though it may look similar to bug 5146 considering do_rootfs failure while building core-image-minimal, the error output is different this time:

meta-yocto-bsp    = "(detachedfrom5367855):5367855fe56db0c09b8fa7bb423b9de18d11eecc"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Error: The image creation script '/home/autobuilder/2poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/create_image.btrfs' returned 134:
mkfs.btrfs: extent-tree.c:2682: btrfs_reserve_extent: Assertion `!(ret)' failed.
SMALL VOLUME: forcing mixed metadata/data groups
SMALL VOLUME: forcing mixed metadata/data groups

WARNING! - Btrfs v3.14.2-dirty IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

Turning ON incompat feature 'mixed-bg': mixed data and metadata block groups
Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
Created a data/metadata chunk of size 3735552
fs created label (null) on /home/autobuilder/2poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86-20141006135218.rootfs.btrfs
	nodesize 4096 leafsize 4096 sectorsize 4096 size 36.00MiB
Btrfs v3.14.2-dirty
Aborted (core dumped)
WARNING: exit code 134 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/autobuilder/2poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.4830
ERROR: Task 7 (/home/autobuilder/2poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2081 tasks of which 1897 didn't need to be rerun and 1 failed.
No currently running tasks (2080 of 2082)

In conf/local.conf:

MACHINE =?? "qemux86"
...
IMAGE_FSTYPES = "btrfs"
KERNEL_FEATURES_append = " cfg/fs/btrfs " 


poky: 5367855fe56db0c09b8fa7bb423b9de18d11eecc

Attached is the full log file.

Regards,

Costin
Comment 1 Costin 2014-10-06 14:14:23 UTC
Created attachment 2169 [details]
log file
Comment 2 Saul Wold 2014-10-07 03:24:48 UTC
I think I will need more details, because I just tried master 

meta-yocto-bsp    
meta-skeleton     = "master:505a6b696ae990442de720e5e1135a3e44d5f75c"
meta-intel        = "master:8e5fe6c0f5cf710e1a46c5f203e52f069874768a"

and it built and booted correctly, this was with qemux86-64, I will try qemux86
Comment 3 Saul Wold 2014-10-07 16:38:12 UTC
Booted OK with qemux86 also, so I need some additional information as to the failure and reproducability.

Maybe it's the OS you are building on?  I am building on F19 currently.
Comment 4 Costin 2014-10-08 08:05:33 UTC
Hello,

I built it on Ubuntu 14.04 with a fresh clone of poky.

Costin
Comment 5 Costin 2014-10-14 14:45:32 UTC
Hello,

Tested again on Ubuntu 14.04 LTS and have the same issue (this time with qemuarm).

poky: ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4

I tried on 3 different systems (2x Ububtu 14.04 and 1x Fedora 20)

I will also try on a new freshly installed system to exclude an issue from my local stations.

Costin
Comment 6 Saul Wold 2014-10-17 16:48:25 UTC
I am still having trouble with this one, if you have a machine I can log into and see the failure that might be helpful given I can't reproduce it here.
Comment 7 Saul Wold 2014-10-17 16:51:13 UTC
Can you provide your full "BUILD CONFIG" (the top of build after bitbake starts) along with your config files (local.conf, bblayers.conf)  Thanks
Comment 8 Costin 2014-10-21 12:43:11 UTC
Hello,

Attached are the local.conf, bblayer.conf and steps I perform to set up env before starting to build. Downwards is the header after bitbake starts. The poky hash used is the latest assigned to QA for tests.


"
cosscat@ubnt:/media/poky/poky/build$ bitbake core-image-minimal
Parsing recipes: 100% |##################################################################################################################################################################################################| ETA:  00:00:00
Parsing of 888 .bb files complete (0 cached, 888 parsed). 1284 targets, 40 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.24.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.7"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "(detachedfrom924da20):924da20c6f2f183fa7e930e4c3c6b14c090acbe5"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: validating kernel config, see log.do_kernel_configcheck for details
ERROR: Error: The image creation script '/media/poky/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/create_image.btrfs' returned 134:
mkfs.btrfs: extent-tree.c:2682: btrfs_reserve_extent: Assertion `!(ret)' failed.
SMALL VOLUME: forcing mixed metadata/data groups
SMALL VOLUME: forcing mixed metadata/data groups

WARNING! - Btrfs v3.14.2-dirty IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

Turning ON incompat feature 'mixed-bg': mixed data and metadata block groups
Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
Created a data/metadata chunk of size 3735552
fs created label (null) on /media/poky/poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86-20141021103831.rootfs.btrfs
	nodesize 4096 leafsize 4096 sectorsize 4096 size 36.00MiB
Btrfs v3.14.2-dirty
Aborted (core dumped)
WARNING: exit code 134 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /media/poky/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.2865
ERROR: Task 7 (/media/poky/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2081 tasks of which 1866 didn't need to be rerun and 1 failed.
No currently running tasks (2081 of 2082)

Summary: 1 task failed:
  /media/poky/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
cosscat@ubnt:/media/poky/poky/build$ 

"


I forgot to add from the start that this is related to TC283: " btrfs format image could be booted up"

TC content:
"
1. set IMAGE_FSTYPES = "btrfs" and KERNEL_FEATURES_append = " cfg/fs/btrfs " in local.conf
2. build core-image-minimal image and boot it up
"

Expected results: "btrfs format image could be booted up"

Costin
Comment 9 Costin 2014-10-21 12:44:25 UTC
Created attachment 2204 [details]
local.conf
Comment 10 Costin 2014-10-21 12:44:53 UTC
Created attachment 2205 [details]
bblayers.conf
Comment 11 Costin 2014-10-21 13:00:24 UTC
Created attachment 2206 [details]
steps performed
Comment 12 Costin 2014-10-29 08:06:27 UTC
Hello,

Tested to create a btrfs image on Daisy branch (1.6.2) hash: 313864bf528696a72c3ee6b3dec1a0c7b0b223f6.  Everything went smooth, so I believe something happened in 1.7

Costin
Comment 13 Saul Wold 2014-11-11 22:26:19 UTC
A newer version of btrfs-tools explictly requires larger sized images. 
core-image-minimal is not large enough for btrfs. I am testing with that 
version now, but for now I am going to close this and recommend that we use 
larger sized images to test with. They need to be great than 165M.
Comment 14 Costin 2014-12-10 11:17:47 UTC
Hello,

Taking into account the last comment, I tested for: core-image-minimal, core-image-base, core-image-sato, core-image-sato-sdk and all behaved the same:


ERROR: Error: The image creation script '/home/autobuilder/2poky/build/tmp/work/qemux86-poky-linux/core-image-sato-sdk/1.0-r0/temp/create_image.btrfs' returned 1:
'/home/autobuilder/2poky/build/tmp/deploy/images/qemux86/core-image-sato-sdk-qemux86-20141210102941.rootfs.btrfs' is too small to make a usable filesystem
Minimum size for each btrfs device is 16777216.
SMALL VOLUME: forcing mixed metadata/data groups
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/autobuilder/2poky/build/tmp/work/qemux86-poky-linux/core-image-sato-sdk/1.0-r0/temp/log.do_rootfs.30505
ERROR: Task 7 (/home/autobuilder/2poky/meta/recipes-sato/images/core-image-sato-sdk.bb, do_rootfs) failed with exit code '1'

Costin
Comment 15 Costin 2014-12-10 11:18:55 UTC
Hello,

Forgot to add build details:

Build Configuration:
BB_VERSION        = "1.25.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.04"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.7"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "(detachedfromb813bde):b813bdebb36501500e86fea5f7e15b4b15ea0902"

Costin
Comment 16 Saul Wold 2015-01-30 04:11:17 UTC
It seems to me that setting the size is not working correctly and we can not 
use it for small images, I am testing some theories to see if I can make it 
fail gracefully for small images.
Comment 17 Saul Wold 2015-02-02 15:42:34 UTC
Try this one more time.  BTRFS will not build small filesystems, so we will 
still have issues with core-image-minimal.  One thought I had was to WARN when 
the FS size is too small

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=47a55255fe78d4f0c14c0e25319164e66581199a
Comment 18 Ionut Chisanovici 2015-02-05 15:01:40 UTC
Hi Saul,

This issue is reappearing for 1.8 M2 RC2, commit:22c38e2d8a058619e3d05534b5e830b750aa4241 only this time the error message is a little bit changed:

ERROR: Error: The image creation script '/home/ionut/work/poky_1.8/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/create_image.btrfs' returned 1:
8981+0 records in
8981+0 records out
9196544 bytes (9.2 MB) copied, 0.0177575 s, 518 MB/s
'/home/ionut/work/poky_1.8/poky/build/tmp/deploy/images/qemux86/core-image-minimal-qemux86-20150205143956.rootfs.btrfs' is too small to make a usable filesystem
Minimum size for each btrfs device is 16777216.
SMALL VOLUME: forcing mixed metadata/data groups
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/ionut/work/poky_1.8/poky/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_rootfs.14956
ERROR: Task 7 (/home/ionut/work/poky_1.8/poky/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'

Build Configuration were:
BB_VERSION        = "1.25.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.10"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.7"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "(detachedfrom22c38e2):22c38e2d8a058619e3d05534b5e830b750aa4241"

Local conf:

IMAGE_FSTYPES = "btrfs"
KERNEL_FEATURES_append = " cfg/fs/btrfs "

Attached the log.

Cheers,
Ionut C
Comment 19 Ionut Chisanovici 2015-02-05 15:02:44 UTC
Created attachment 2395 [details]
do_rootfs_log
Comment 20 Ionut Chisanovici 2015-02-10 12:06:08 UTC
This is verified in master, commit: 870323cac1e40e8f95ea7bd6f425a85dcfbab612
Test case was updated to build core-image-sato.

Cheers,
Ionut C
Comment 21 Ionut Chisanovici 2015-02-10 12:07:42 UTC
verified.
Comment 22 Ionut Chisanovici 2015-02-26 10:38:40 UTC
Hi Saul,

The issue is now present for core-image-sato as well:

ERROR: Error: The image creation script '/home/ionut/work/poky_1.8/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/temp/create_image.btrfs' returned 1:
ERROR: Rootfs is too small for BTRFS (Rootfs Actual Size: 577898, BTRFS Minimum Size: 16777216)
WARNING: exit code 1 from a shell command.

ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/ionut/work/poky_1.8/poky/build/tmp/work/qemux86-poky-linux/core-image-sato/1.0-r0/temp/log.do_rootfs.19037
ERROR: Task 7 (/home/ionut/work/poky_1.8/poky/meta/recipes-sato/images/core-image-sato.bb, do_rootfs) failed with exit code '1'


Commit: 40d80f9e019118ac7bcd268f21e350bc154a4a63
Attached log.do_rootfs.

Build Configuration:
BB_VERSION        = "1.25.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Ubuntu-14.10"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.7"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "(detachedfrom40d80f9):40d80f9e019118ac7bcd268f21e350bc154a4a63"

Cheers,
Ionut C
Comment 23 Ionut Chisanovici 2015-02-26 10:39:59 UTC
Created attachment 2423 [details]
log.do_rootfs
Comment 25 Saul Wold 2015-03-12 19:56:03 UTC
see proir comment
Comment 26 Alexandru Georgescu 2015-05-12 08:43:14 UTC
Costin, can you verify?