Created attachment 2746 [details] This patch fixes the problem described in the ticket. An image that I am trying to build fails with the following error: The stack trace of python calls that resulted in this exception/failure was: File: 'do_rootfs', lineno: 17, function: <module> 0013: # generate final images 0014: create_image(d) 0015: 0016: *** 0017:do_rootfs(d) 0018: File: 'do_rootfs', lineno: 14, function: do_rootfs 0010: # generate rootfs 0011: create_rootfs(d) 0012: 0013: # generate final images *** 0014: create_image(d) 0015: 0016: 0017:do_rootfs(d) 0018: File: '/poky/meta/lib/oe/image.py', lineno: 380, function: create_image 0376: execute_pre_post_process(self.d, post_process_cmds) 0377: 0378: 0379:def create_image(d): *** 0380: Image(d).create() 0381: 0382:if __name__ == "__main__": 0383: """ 0384: Image creation can be called independent from bitbake environment. File: '/poky/meta/lib/oe/image.py', lineno: 374, function: create 0370: bb.fatal(result) 0371: 0372: for image_type, subimages, script in image_cmds: 0373: bb.note("Creating symlinks for %s image ..." % image_type) *** 0374: self._create_symlinks(subimages) 0375: 0376: execute_pre_post_process(self.d, post_process_cmds) 0377: 0378: File: '/poky/meta/lib/oe/image.py', lineno: 205, function: _create_symlinks 0201: if os.path.exists(img_name + ".rootfs." + type): 0202: dst = link_name + "." + type 0203: src = img_name + ".rootfs." + type 0204: bb.note("Creating symlink: %s -> %s" % (dst, src)) *** 0205: os.symlink(src, dst) 0206: 0207: if manifest_name is not None and \ 0208: os.path.exists(manifest_name) and \ 0209: not os.path.exists(link_name + ".manifest"): Exception: OSError: [Errno 17] File exists The destination link indeed does exist in the deploy directory, can't say when it was created (I did a clean build from scratch). I figured it won't hurt to delete the link before recreating it, the attached patch fixes the problem for me.
We need more info to better debug and fix this. Is there a way we could reliably reproduce the problem? Which MACHINE are you using? Which IMAGE_FSTYPES? What was the file that failed?
(In reply to comment #1) > We need more info to better debug and fix this. Is there a way we could > reliably reproduce the problem? Well, the configuration uses our own layers, I guess I could try to find a similar machine and build stock poky to make it reproducible for you; here it worked fine with Yocto 1.7 and failed after a switch to Yocto master/2.0 We do not use any custom fs generation classes for this machine though, so that part should really be "stock OE". > Which MACHINE are you using? A custom spinoff config from at91sam9g20ek, there should not be anything fancy there: https://git.digitalstrom.org/dss-oe/dss-oe/blob/master/yocto/dS/meta-digitalstrom-devel/conf/machine/dss11-1gb-t1.conf The stock image with which I can reproduce the problem is core-image-minimal, it fails the same way with our custom image too. > Which IMAGE_FSTYPES? Checked with bitbake -e to make sure no one messes with it: IMAGE_FSTYPES="ubi" > What was the file that failed? The log output: NOTE: Creating symlink: core-image-minimal-dss11-1gb-t1.ubi -> core-image-minimal-dss11-1gb-t1-20150924145517.rootfs.ubi Matches to: 0204: bb.note("Creating symlink: %s -> %s" % (dst, src)) *** 0205: os.symlink(src, dst) The content of my /build/deploy/images/dss11-1gb-t1/ directory a the time of build failure is: [jin@builder dss11-1gb-t1]$ ls -all core-image-minimal-dss11-1gb-t1* -rw------- 1 jin jin 931 Sep 24 16:55 core-image-minimal-dss11-1gb-t1-20150924145517.rootfs.manifest -rw-r--r-- 1 jin jin 11534336 Sep 24 16:55 core-image-minimal-dss11-1gb-t1-20150924145517.rootfs.ubi -rw-r--r-- 1 jin jin 10321920 Sep 24 16:55 core-image-minimal-dss11-1gb-t1-20150924145517.rootfs.ubifs lrwxrwxrwx 1 jin jin 57 Sep 24 16:55 core-image-minimal-dss11-1gb-t1.ubi -> core-image-minimal-dss11-1gb-t1-20150924145517.rootfs.ubi lrwxrwxrwx 1 jin jin 59 Sep 24 16:55 core-image-minimal-dss11-1gb-t1.ubifs -> core-image-minimal-dss11-1gb-t1-20150924145517.rootfs.ubifs So for some reason the core-image-minimal-dss11-1gb-t1.ubi link already exists (there where no core-image* fiels/links in deploy dir when I started the build). Hope that helps, otherwise let me know if you need more info/debugging, thanks!
Did you have http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master&id=9241ec579309e9d27e9391815a167911d20b38c1 applied in your test
(In reply to comment #3) > Did you have > http://git.yoctoproject.org/cgit.cgi/poky/commit/ > ?h=master&id=9241ec579309e9d27e9391815a167911d20b38c1 applied in your test Sorry I did not, my state was from the date of the ticket submission, this commit indeed does fix the problem for me! Thank you!