<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14207</bug_id>
          
          <creation_ts>2021-01-29 07:58:34 +0000</creation_ts>
          <short_desc>pseudo abort with wic images</short_desc>
          <delta_ts>2021-05-21 08:10:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Pseudo</product>
          <component>pseudo</component>
          <version>3.2.1</version>
          <rep_platform>NUC</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>3.4 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Rameshkrishnan Geddy Sekar">rameshkrishnanx.geddy.sekar</reporter>
          <assigned_to name="Chee Yang">chee.yang.lee</assigned_to>
          <cc>chee.yang.lee</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>tim.orling</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>89078</commentid>
    <comment_count>0</comment_count>
      <attachid>4765</attachid>
    <who name="Rameshkrishnan Geddy Sekar">rameshkrishnanx.geddy.sekar</who>
    <bug_when>2021-01-29 07:58:34 +0000</bug_when>
    <thetext>Created attachment 4765
On the attached file i have both persistent.bbclass and persistent-data.wks.in contents. please add them in meta/classes and scripts/lib/wic/canned-wks/ directories

We are getting a pseudo abort while building wic images using gatesgarth branch. I have attached a simpler version of wks and bbclass that we use. 

This issue isn&apos;t present in dunfell. Current master
 also has this issue.

Console Error:
| output: mke2fs 1.45.6 (20-Mar-2020)
| Discarding device blocks: done
| Creating filesystem with 157892 1k blocks and 19840 inodes
| Filesystem UUID: 2b06a58d-ba0c-410f-8e0b-84d285bdfb3f
| Superblock backups stored on blocks:
|       8193, 24577, 40961, 57345, 73729
|
| Allocating group tables: done
| Writing inode tables: done
| Creating journal (4096 blocks): done
| Copying files into the device: abort()ing pseudo client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.
| Check logfile: /infrastructure/rgeddysx/OE-CORE/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/tmp-wic/pseudo1/pseudo.log
| Aborted
|
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/infrastructure/rgeddysx/OE-CORE/oe-core/meta/recipes-core/images/core-image-minimal.bb:do_image_wic) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 2736 tasks of which 1 didn&apos;t need to be rerun and 1 failed.

Below are the steps to reproduce the issue:
#git clone git://git.openembedded.org/openembedded-core-contrib -b stable/gatesgarth-next oe-core
#cd oe-core
#git clone git://git.openembedded.org/bitbake -b 1.48
#cd ..
#mkdir build
#cd build
#. ../oe-core/oe-init-build-env .
## Added persistent.bbclass and &quot;persistent-data.wks.in&quot; in the respective dir
## Add the below lines in local.conf
PACKAGE_CLASSES ?= &quot;package_rpm&quot; (should be rpm . by default it is ipk)
IMAGE_FSTYPES = &quot;wic wic.bmap&quot;
EFI_PREFIX = &quot;/boot/efi&quot;
WKS_FILE = &quot;persistent-data.wks.in&quot;
IMGCLASSES_append = &quot; persistent&quot;
IMAGE_ROOTFS_EXCLUDE_PATH_append = &quot; etc/&quot;
IMAGE_FEATURES += &quot; package-management&quot;

Run the target
#bitbake core-image-minimal</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89079</commentid>
    <comment_count>1</comment_count>
    <who name="Rameshkrishnan Geddy Sekar">rameshkrishnanx.geddy.sekar</who>
    <bug_when>2021-01-29 08:01:49 +0000</bug_when>
    <thetext>Changed the Product from OE-Core to Pseudo since the bug is more related to Pseudo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89113</commentid>
    <comment_count>2</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2021-02-02 00:51:54 +0000</bug_when>
    <thetext>happen on oe-core master too
meta                 = &quot;HEAD:3a4fed4ae0e8a0d1bd62ea5fa1ef12925e1f20f5&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89116</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-02-02 16:25:06 +0000</bug_when>
    <thetext>Could you share the contents of the log file as mentioned in the error: 

/infrastructure/rgeddysx/OE-CORE/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/tmp-wic/pseudo1/pseudo.log</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89118</commentid>
    <comment_count>4</comment_count>
    <who name="Rameshkrishnan Geddy Sekar">rameshkrishnanx.geddy.sekar</who>
    <bug_when>2021-02-02 16:50:40 +0000</bug_when>
    <thetext>Though the console says,

Check logfile: /infrastructure/rgeddysx/OE-CORE/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/tmp-wic/pseudo1/pseudo.log

But the same tmp-wic folder is missing in the build directory.
It might have got cleanedup otherwise with do_image_wic task on failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89124</commentid>
    <comment_count>5</comment_count>
      <attachid>4769</attachid>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2021-02-03 02:41:13 +0000</bug_when>
    <thetext>Created attachment 4769
Pseudo log file

attached pseudo log.
i comment out this line so wic keeps the tmp and log files.

+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -275,7 +275,7 @@ class DirectPlugin(ImagerPlugin):
                 shutil.move(path, os.path.join(self.outdir, fname))

         # remove work directory
-        shutil.rmtree(self.workdir, ignore_errors=True)
+        #shutil.rmtree(self.workdir, ignore_errors=True)

 # Overhead of the MBR partitioning scheme (just one sector)
 MBR_OVERHEAD = 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89131</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-02-04 00:02:14 +0000</bug_when>
    <thetext>To summarise, you&apos;re splitting out part of the rootfs into a separate data directory which is in its own wic partition. The pseudo log is helpful as it is saying:

path mismatch [2 links]: ino 258881762 db &apos;/var/lib/rpm/.dbenv.lock&apos; req &apos;/data/persistent/var/lib/rpm/.dbenv.lock&apos;.

i.e. that a file is in the pseudo database  as being in one location but on disk its been moved.

I notice this path looks the same as the symlink trick that the attached class is adding. The issue is likely somewhere in and around how pseudo is monitoring these different paths and this rpm trick not being something used elsewhere.

It does sound more like a misconfiguration/misuse of pseudo rather than a bug in pseudo itself but it will need further debugging.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89180</commentid>
    <comment_count>7</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2021-02-09 09:53:25 +0000</bug_when>
    <thetext>current workaround is to switch the task (do_persistent_fixup) from IMAGE_PREPROCESS_COMMAND to &quot;after do_rootfs before do_flush_pseudodb&quot;. 

IMAGE_PREPROCESS_COMMAND are part of do_image. Gatesgarth after &quot;classes/image_types_wic: Reorder do_flush_pseudodb&quot;[1], 
the pseudodb flushed before do_image. While in dunfell(3.1.5), pseudodb are flush after do_image. i think this is why it error in gatesgarth but not in dunfell. 



task_order on dunfell(3.1.5):
do_rootfs (68770): log.do_rootfs.68770
do_image_qa (76656): log.do_image_qa.76656
do_write_qemuboot_conf (76660): log.do_write_qemuboot_conf.76660
do_image (76667): log.do_image.76667
do_write_wks_template (77027): log.do_write_wks_template.77027
do_rootfs_wicenv (77028): log.do_rootfs_wicenv.77028
do_flush_pseudodb (77029): log.do_flush_pseudodb.77029
do_image_ext4 (77032): log.do_image_ext4.77032
do_image_tar (77039): log.do_image_tar.77039
do_image_wic (77045): log.do_image_wic.77045


[1] https://git.openembedded.org/openembedded-core/commit/meta/classes?h=gatesgarth&amp;id=445b0a9544b55735496bbb23dbff3399b3b9e9a4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90451</commentid>
    <comment_count>8</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2021-05-21 08:10:31 +0000</bug_when>
    <thetext>Close this as not a bug, not issue with pseudo tools.
This is more to problem with configuration for task sequence.

the activity moving files in rootfs should be done in ROOTFS command like  ROOTFS_POSTPROCESS_COMMAND, ROOTFS_POSTINSTALL_COMMAND, add to do_rootfs or set the task in between do_rootfs and do_flush_pseudodb.

in wks,
use --rootfs-dir when the rootfs is build/prepared at other path with its own pseudo.db.
use --change-directory for a partition to take a subdirectory within current rootfs (/data in this case) while keeping the correct uid/gid. 
it should use --change-directory in this case. 

part /data --source rootfs --fstype=ext4 --label data --align 4096 --use-uuid --change-directory=data  --fsoptions rw,noatime</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4765</attachid>
            <date>2021-01-29 07:58:34 +0000</date>
            <delta_ts>2021-01-29 07:58:34 +0000</delta_ts>
            <desc>On the attached file i have both persistent.bbclass and persistent-data.wks.in contents. please add them in meta/classes and scripts/lib/wic/canned-wks/ directories</desc>
            <filename>bbclass and wks file.txt</filename>
            <type>text/plain</type>
            <size>2814</size>
            <attacher name="Rameshkrishnan Geddy Sekar">rameshkrishnanx.geddy.sekar</attacher>
            
              <data encoding="base64">PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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09URlN9L2RhdGEgLS1mc29w
dGlvbnMgcncsbm9hdGltZQ0KI3BhcnQgc3dhcCAtLXBhcnQtdHlwZT0iMDY1N0ZENkQtQTRBQi00
M0M0LTg0RTUtMDkzM0M4NEI0RjRGIiAtLXVzZS11dWlkIC0tYWxpZ24gNDA5NiAtLWxhYmVsIHN3
YXAgLS1mc3R5cGUgc3dhcA0KYm9vdGxvYWRlciAtLXB0YWJsZSBncHQgLS10aW1lb3V0PTUgLS1h
cHBlbmQ9IiR7QVBQRU5EfSINCg0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PQ0K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4769</attachid>
            <date>2021-02-03 02:41:13 +0000</date>
            <delta_ts>2021-02-03 02:41:13 +0000</delta_ts>
            <desc>Pseudo log file</desc>
            <filename>pseudo.log</filename>
            <type>application/octet-stream</type>
            <size>589</size>
            <attacher name="Chee Yang">chee.yang.lee</attacher>
            
              <data encoding="base64">ZGVidWdfbG9nZmlsZTogZmQgMgpwaWQgMTUwMzYgW3BhcmVudCAxNTAzNV0sIGRvaW5nIG5ldyBw
aWQgc2V0dXAgYW5kIHNlcnZlciBzdGFydApTZXR1cCBjb21wbGV0ZSwgc2VuZGluZyBTSUdVU1Ix
IHRvIHBpZCAxNTAzNS4KcGF0aCBtaXNtYXRjaCBbMiBsaW5rc106IGlubyAyNTg4ODE3NjIgZGIg
Jy9kYXRhLzRUL29wZW5lbWJlZGRlZC1jb3JlL2J1aWxkL3RtcC1nbGliYy93b3JrL3FlbXV4ODZf
NjQtb2UtbGludXgvY29yZS1pbWFnZS1taW5pbWFsLzEuMC1yMC90bXAtd2ljL3Jvb3RmczEvdmFy
L2xpYi9ycG0vLmRiZW52LmxvY2snIHJlcSAnL2RhdGEvNFQvb3BlbmVtYmVkZGVkLWNvcmUvYnVp
bGQvdG1wLWdsaWJjL3dvcmsvcWVtdXg4Nl82NC1vZS1saW51eC9jb3JlLWltYWdlLW1pbmltYWwv
MS4wLXIwL3RtcC13aWMvcm9vdGZzMS9kYXRhL3BlcnNpc3RlbnQvdmFyL2xpYi9ycG0vLmRiZW52
LmxvY2snLgpkYiBjbGVhbnVwIGZvciBzZXJ2ZXIgc2h1dGRvd24sIDAxOjQ5OjQxLjU1NwptZW1v
cnktdG8tZmlsZSBiYWNrdXAgY29tcGxldGUsIDAxOjQ5OjQxLjU1OC4KZGIgY2xlYW51cCBmaW5p
c2hlZCwgMDE6NDk6NDEuNTU4Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>