Bug 10481 - [Test Case 1059] Parselogs is failing on genericx86 (32 and 64 bits) WIC giving error: GPT: Use GNU Parted to correct GPT errors.
Summary: [Test Case 1059] Parselogs is failing on genericx86 (32 and 64 bits) WIC givi...
Status: RESOLVED FIXED
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-runtime (show other bugs)
Version: 2.2
Hardware: All x86
: Medium normal
Target Milestone: 2.3 M1
Assignee: Jair Gonzalez
QA Contact: Juan Ramos
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-10-21 19:41 UTC by Jair Gonzalez
Modified: 2016-12-13 13:16 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
results-bitbake-worker_X86-wic_mmax32.log (6.90 KB, text/x-log)
2016-10-21 19:41 UTC, Jair Gonzalez
no flags Details
results-bitbake-worker_x86-64-wic_mmax64.log (6.96 KB, text/x-log)
2016-10-24 16:28 UTC, Jair Gonzalez
no flags Details
results-bitbake-worker_x86-64-wic_nuc.log (10.42 KB, text/x-log)
2016-10-24 20:49 UTC, Jair Gonzalez
no flags Details
results-bitbake-worker_x86-wic_mmax32_2.2rc6.log (6.89 KB, text/x-log)
2016-10-26 22:51 UTC, Jair Gonzalez
no flags Details
results-bitbake-worker_x86-64_wic_mmax64_2.2rc6.log (6.96 KB, application/octet-stream)
2016-10-27 17:20 UTC, Juan Ramos
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jair Gonzalez 2016-10-21 19:41:19 UTC
Created attachment 3485 [details]
results-bitbake-worker_X86-wic_mmax32.log

STATUS: FAILED
BUILD: 2.2.rc4(M4): 4b94b498e21aeba945fe7e72a6b7c4bb0314fb83
ENVIRONMENT: genericx86-WIC - on MMAX32bit
STEPS TO REPRODUCE: 
  
 Parse dmesg log and all log files in /var/log for keywords like: "error" , "failed" , "cannot", "can't" etc.
Filter out the known and invalid errors or errors that appear in certain situations and need to be ignored.



EXPECTED OUTCOME: 
  
 No errors or fails should be present in logs

ACTUAL:
-----------------------
Central error: [    4.928340] GPT: Use GNU Parted to correct GPT errors.
***********************
[    4.413554] scsi 0:0:0:0: Direct-Access     Kingston HyperX Fury 3.0  PMAP PQ: 0 ANSI: 6
[    4.846201] sd 0:0:0:0: [sda] 30736384 512-byte logical blocks: (15.7 GB/14.7 GiB)
[    4.854883] sd 0:0:0:0: [sda] Write Protect is off
[    4.858917] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[    4.860387] sd 0:0:0:0: [sda] No Caching mode page found
[    4.865001] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    4.910903] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    4.917912] GPT:5378309 != 30736383
[    4.920433] GPT:Alternate GPT header not at the end of the disk.
[    4.925833] GPT:5378309 != 30736383
[    4.928340] GPT: Use GNU Parted to correct GPT errors.
[    4.932776]  sda: sda1 sda2 sda3
[    4.940844] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    4.980221] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    4.987561] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[    4.995385] devtmpfs: mounted
[    4.997695] Freeing unused kernel memory: 748K (c1c10000 - c1ccb000)
[    5.003735] Write protecting the kernel text: 9032k
[    5.008065] Write protecting the kernel read-only data: 2560k
[    5.249274] Adding 45052k swap on /dev/sda3.  Priority:-1 extents:1 across:45052k 
[    5.346028] udevd[141]: starting version 3.2

***********************
Log: /home/jairdeje/source/TR_2016-10-18/poky-wic32/build/tmp/work/genericx86-poky-linux/core-image-sato-sdk/1.0-r0/dmesg_output.log
-----------------------
Central error: [    4.928340] GPT: Use GNU Parted to correct GPT errors.
***********************
[    4.413554] scsi 0:0:0:0: Direct-Access     Kingston HyperX Fury 3.0  PMAP PQ: 0 ANSI: 6
[    4.846201] sd 0:0:0:0: [sda] 30736384 512-byte logical blocks: (15.7 GB/14.7 GiB)
[    4.854883] sd 0:0:0:0: [sda] Write Protect is off
[    4.858917] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[    4.860387] sd 0:0:0:0: [sda] No Caching mode page found
[    4.865001] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    4.910903] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    4.917912] GPT:5378309 != 30736383
[    4.920433] GPT:Alternate GPT header not at the end of the disk.
[    4.925833] GPT:5378309 != 30736383
[    4.928340] GPT: Use GNU Parted to correct GPT errors.
[    4.932776]  sda: sda1 sda2 sda3
[    4.940844] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    4.980221] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    4.987561] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[    4.995385] devtmpfs: mounted
[    4.997695] Freeing unused kernel memory: 748K (c1c10000 - c1ccb000)
[    5.003735] Write protecting the kernel text: 9032k
[    5.008065] Write protecting the kernel read-only data: 2560k
[    5.249274] Adding 45052k swap on /dev/sda3.  Priority:-1 extents:1 across:45052k 
[    5.346028] udevd[141]: starting version 3.2

***********************
Comment 1 Jair Gonzalez 2016-10-24 16:28:00 UTC
Created attachment 3487 [details]
results-bitbake-worker_x86-64-wic_mmax64.log
Comment 2 Jair Gonzalez 2016-10-24 16:30:37 UTC
The parselog test case is also failing on MMAX64bit WIC with similar error messages:


STATUS: FAILED
BUILD: 2.2.rc4(M4): 4b94b498e21aeba945fe7e72a6b7c4bb0314fb83
ENVIRONMENT: genericx86-WIC - on MMAX32bit
STEPS TO REPRODUCE: 
  
 Parse dmesg log and all log files in /var/log for keywords like: "error" , "failed" , "cannot", "can't" etc.
Filter out the known and invalid errors or errors that appear in certain situations and need to be ignored.



EXPECTED OUTCOME: 
  
 No errors or fails should be present in logs

ACTUAL:
-----------------------
Central error: [    5.959503] GPT: Use GNU Parted to correct GPT errors.
***********************
[    5.383262] scsi 0:0:0:0: Direct-Access     Kingston HyperX Fury 3.0  PMAP PQ: 0 ANSI: 6
[    5.827509] sd 0:0:0:0: [sda] 30736384 512-byte logical blocks: (15.7 GB/14.7 GiB)
[    5.842385] sd 0:0:0:0: [sda] Write Protect is off
[    5.851917] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[    5.853767] sd 0:0:0:0: [sda] No Caching mode page found
[    5.863892] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    5.919733] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    5.932314] GPT:5621105 != 30736383
[    5.940437] GPT:Alternate GPT header not at the end of the disk.
[    5.951407] GPT:5621105 != 30736383
[    5.959503] GPT: Use GNU Parted to correct GPT errors.
[    5.969471]  sda: sda1 sda2 sda3
[    5.982969] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    6.060104] EXT4-fs (sda2): INFO: recovery required on readonly filesystem
[    6.072742] EXT4-fs (sda2): write access will be enabled during recovery
[    6.285961] EXT4-fs (sda2): recovery complete
[    6.303349] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    6.316159] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[    6.334193] devtmpfs: mounted
[    6.345903] Freeing unused kernel memory: 1320K (ffffffff81f1d000 - ffffffff82067000)
[    6.358884] Write protecting the kernel read-only data: 14336k

***********************
Log: /home/jairdeje/source/TR_2016-10-18/poky-wic64/build/tmp/work/genericx86_64-poky-linux/core-image-sato-sdk/1.0-r0/dmesg_output.log
-----------------------
Central error: [    5.959503] GPT: Use GNU Parted to correct GPT errors.
***********************
[    5.383262] scsi 0:0:0:0: Direct-Access     Kingston HyperX Fury 3.0  PMAP PQ: 0 ANSI: 6
[    5.827509] sd 0:0:0:0: [sda] 30736384 512-byte logical blocks: (15.7 GB/14.7 GiB)
[    5.842385] sd 0:0:0:0: [sda] Write Protect is off
[    5.851917] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[    5.853767] sd 0:0:0:0: [sda] No Caching mode page found
[    5.863892] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    5.919733] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    5.932314] GPT:5621105 != 30736383
[    5.940437] GPT:Alternate GPT header not at the end of the disk.
[    5.951407] GPT:5621105 != 30736383
[    5.959503] GPT: Use GNU Parted to correct GPT errors.
[    5.969471]  sda: sda1 sda2 sda3
[    5.982969] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    6.060104] EXT4-fs (sda2): INFO: recovery required on readonly filesystem
[    6.072742] EXT4-fs (sda2): write access will be enabled during recovery
[    6.285961] EXT4-fs (sda2): recovery complete
[    6.303349] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    6.316159] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[    6.334193] devtmpfs: mounted
[    6.345903] Freeing unused kernel memory: 1320K (ffffffff81f1d000 - ffffffff82067000)
[    6.358884] Write protecting the kernel read-only data: 14336k

***********************
2 errors found in logs.
Comment 3 Jair Gonzalez 2016-10-24 16:33:11 UTC
ERRATA: In my previous message, the environment should specify:


STATUS: FAILED
BUILD: 2.2.rc4(M4): 4b94b498e21aeba945fe7e72a6b7c4bb0314fb83
ENVIRONMENT: genericx86-64-WIC - on MMAX64bit
STEPS TO REPRODUCE:
Comment 4 Jair Gonzalez 2016-10-24 20:48:13 UTC
This issue is also reproducible on a NUC (model NUC6i5SYH) within the following environment:


STATUS: FAILED
BUILD: 2.2.rc4(M4): 4b94b498e21aeba945fe7e72a6b7c4bb0314fb83
ENVIRONMENT: genericx86-64-WIC - on NUC
STEPS TO REPRODUCE:
  
 Parse dmesg log and all log files in /var/log for keywords like: "error" , "failed" , "cannot", "can't" etc.
Filter out the known and invalid errors or errors that appear in certain situations and need to be ignored.



EXPECTED OUTCOME: 
  
 No errors or fails should be present in logs

ACTUAL:

***********************
Central error: [    3.308380] GPT: Use GNU Parted to correct GPT errors.
***********************
[    3.267271] scsi 1:0:0:0: Direct-Access     Kingston HyperX Fury 3.0  PMAP PQ: 0 ANSI: 6
[    3.273997] sd 1:0:0:0: [sdb] 30736384 512-byte logical blocks: (15.7 GB/14.7 GiB)
[    3.280544] sd 1:0:0:0: [sdb] Write Protect is off
[    3.285259] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[    3.286629] sd 1:0:0:0: [sdb] No Caching mode page found
[    3.287855] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[    3.302228] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    3.303838] GPT:5621105 != 30736383
[    3.305312] GPT:Alternate GPT header not at the end of the disk.
[    3.306924] GPT:5621105 != 30736383
[    3.308380] GPT: Use GNU Parted to correct GPT errors.
[    3.309929]  sdb: sdb1 sdb2 sdb3
[    3.316102] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[    3.383033] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[    3.386679] VFS: Mounted root (ext4 filesystem) readonly on device 8:18.
[    3.395279] devtmpfs: mounted
[    3.403013] Freeing unused kernel memory: 1320K (ffffffff81f1d000 - ffffffff82067000)
[    3.407788] Write protecting the kernel read-only data: 14336k
[    3.413256] Freeing unused kernel memory: 880K (ffff880001f24000 - ffff880002000000)
[    3.424961] Freeing unused kernel memory: 1132K (ffff8800022e5000 - ffff880002400000)
[    3.621440] Adding 8272892k swap on /dev/sda3.  Priority:-1 extents:1 across:8272892k SS

***********************
Central error: [    3.308380] GPT: Use GNU Parted to correct GPT errors.
***********************
[    3.267271] scsi 1:0:0:0: Direct-Access     Kingston HyperX Fury 3.0  PMAP PQ: 0 ANSI: 6
[    3.273997] sd 1:0:0:0: [sdb] 30736384 512-byte logical blocks: (15.7 GB/14.7 GiB)
[    3.280544] sd 1:0:0:0: [sdb] Write Protect is off
[    3.285259] sd 1:0:0:0: [sdb] Mode Sense: 23 00 00 00
[    3.286629] sd 1:0:0:0: [sdb] No Caching mode page found
[    3.287855] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[    3.302228] GPT:Primary header thinks Alt. header is not at the end of the disk.
[    3.303838] GPT:5621105 != 30736383
[    3.305312] GPT:Alternate GPT header not at the end of the disk.
[    3.306924] GPT:5621105 != 30736383
[    3.308380] GPT: Use GNU Parted to correct GPT errors.
[    3.309929]  sdb: sdb1 sdb2 sdb3
[    3.316102] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[    3.383033] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null)
[    3.386679] VFS: Mounted root (ext4 filesystem) readonly on device 8:18.
[    3.395279] devtmpfs: mounted
[    3.403013] Freeing unused kernel memory: 1320K (ffffffff81f1d000 - ffffffff82067000)
[    3.407788] Write protecting the kernel read-only data: 14336k
[    3.413256] Freeing unused kernel memory: 880K (ffff880001f24000 - ffff880002000000)
[    3.424961] Freeing unused kernel memory: 1132K (ffff8800022e5000 - ffff880002400000)
[    3.621440] Adding 8272892k swap on /dev/sda3.  Priority:-1 extents:1 across:8272892k SS

***********************
Comment 5 Jair Gonzalez 2016-10-24 20:49:33 UTC
Created attachment 3493 [details]
results-bitbake-worker_x86-64-wic_nuc.log
Comment 6 Jair Gonzalez 2016-10-26 22:51:49 UTC
Created attachment 3502 [details]
results-bitbake-worker_x86-wic_mmax32_2.2rc6.log
Comment 7 Jair Gonzalez 2016-10-26 22:54:38 UTC
This issue was also reproducible on 2.2 rc6 (WIC):

STATUS: FAILED
BUILD: 2.2.rc6: dc8508f609974cc99606b9042bfa7f870ce80228
ENVIRONMENT: genericx86-WIC - on MMAX32bit

I have attached the log for further reference.
Comment 8 Juan Ramos 2016-10-27 17:20:35 UTC
Created attachment 3504 [details]
results-bitbake-worker_x86-64_wic_mmax64_2.2rc6.log
Comment 9 Ed Bartosh 2016-10-28 11:04:48 UTC
I don’t think it’s a but.
The reason of It happens because image doesn’t have the same size as the media. And it shouldn't as at the moment when image is created there is no information about the media it will be flashed to.
Comment 10 Ed Bartosh 2016-10-31 11:57:12 UTC
I should probably give more details:

1. Check if wic image is ok by printing partitions using parted utility:
$ oe-run-native parted tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.wic print 
WARNING: You are not superuser.  Watch out for permissions.
Model:  (file)
Disk /home/ed/git/yocto/poky/build-genericx86-64/tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64-20161024073137.rootfs.wic: 97.8MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name     Flags
 1      1049kB  25.3MB  24.3MB  fat16           primary  legacy_boot
 2      26.2MB  51.6MB  25.4MB  ext4            primary
 3      51.6MB  97.7MB  46.1MB  linux-swap(v1)  primary

as you see the image is correct and parted doesn't print any errors.

2. Flash the image to usb stick:
sudo dd if=tmp/deploy/images/genricx86-64/core-image-minimal-genericx86-64-20161024073137.rootfs.wic of=/dev/sdb

190944+0 records in
190944+0 records out
97763328 bytes (98 MB) copied, 116.131 s, 842 kB/s

3. Run parted the same way as on step 1 for the USB image:
sudo /usr/sbin/parted /dev/sdb print
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving the
backup to the end (and removing the old backup)?

As you see parted prints error similar to the errors from dmesg output.

So, the problem appears only when image is flashed to the device because image and device sizes don't match.

There are three possible solutions for this I can think of:
1. whitelist the error as it's harmless.
2. Try to produce an image the same size as the USB stick used to boot DUT.
3. run parted after flashing an image to USB device to correct errors.

Any other ideas?
Comment 11 Ed Bartosh 2016-10-31 12:33:32 UTC
sgdisk utility can be used to fix this issue:

# sgdisk --move-second-header /dev/sdb
The operation has completed successfully.

# parted /dev/sdb print
Model: Generic STORAGE DEVICE (scsi)
Disk /dev/sdb: 3951MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name     Flags
 1      1049kB  25.3MB  24.3MB  fat16           primary  legacy_boot
 2      26.2MB  51.6MB  25.4MB  ext4            primary
 3      51.6MB  97.7MB  46.1MB  linux-swap(v1)  primary


Summary:
2 preferred ways to fix this issue are:
1. Ignore/whitelist GPT warnings as the device is fully functional
2. Move backup gpt header to the end of device after flashing using sgdisk --move-second-header <device>

Both ways were successfully tested on MinnowBoard Max.
Comment 12 Benjamin Esquivel 2016-11-03 14:37:35 UTC
As per Saul's request on the bug triage meeting, this issue will be white-listed.