Bug 2985

Summary: Hob can not create image due to permissions error while creating cooker log.
Product: [Build System, Metadata & Runtime] Hob Reporter: Andreea Brandusa Proca <andreea.b.proca>
Component: hobAssignee: Jessica <jessica.zhang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: alexandru.c.georgescu, andreea.b.proca, cristian.iorga, laurentiu.serban, poky.bs.watcher, poky.watcher, richard.purdie, sgw, valentin.popa
Version: 1.3   
Target Milestone: 1.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Andreea Brandusa Proca 2012-08-22 08:31:44 UTC
In commit 603f6c631e9454d10517599e229943f2b26d08a5 the following issue occurred:
step 1 : hob is started and machine type is selected (other than quemux86)
step 2 : an image type is selected and "build image" button is pressed
step 3 : this error appears : 
andreea@andreea-Vostro-460:~/yocto/master_hob/build$ hob
Pseudo is not present but is required, building this first before the main build
Parsing recipes: 100% |######################################################################################################################################################################| Time: 00:00:46
Parsing of 825 .bb files complete (0 cached, 825 parsed). 1124 targets, 19 skipped, 0 masked, 0 errors.

Build Configuration:
BB_VERSION        = "1.15.3"
TARGET_ARCH       = "i586"
TARGET_OS         = "linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.2+snapshot-20120822"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta
meta-yocto        = "master:603f6c631e9454d10517599e229943f2b26d08a5"

NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 63 tasks of which 0 didn't need to be rerun and all succeeded.
Traceback (most recent call last):
  File "/home/andreea/yocto/master_hob/bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py", line 436, in just_bake_button_clicked_cb
    self.builder.just_bake()
  File "/home/andreea/yocto/master_hob/bitbake/lib/bb/ui/crumbs/builder.py", line 1045, in just_bake
    self.fast_generate_image_async(True)
  File "/home/andreea/yocto/master_hob/bitbake/lib/bb/ui/crumbs/builder.py", line 526, in fast_generate_image_async
    self.do_log(self.current_logfile)
  File "/home/andreea/yocto/master_hob/bitbake/lib/bb/ui/crumbs/builder.py", line 1318, in do_log
    self.consolelog = logging.FileHandler(consolelogfile)
  File "/usr/lib/python2.7/logging/__init__.py", line 897, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.7/logging/__init__.py", line 916, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: '/home/andreea/yocto/master_hob/build/tmp/log/cooker/qemuarm/20120822091542.log'
Comment 1 Saul Wold 2012-08-22 18:30:50 UTC
Is there anything in /home/andreea/yocto/master_hob/build/tmp/log or below?  What permission are on this directory?
Comment 2 Laurentiu Serban 2012-08-22 22:44:32 UTC
Hello Saul,
I reproduced the bug on my machine.
Here is the answer to your question.
Apparently hob tries to access a directory before creating it.
I hope this helps

/home/lserban/work/hob_test/build
lserban@laurentiu-02:~/work/hob_test/build$ ls
bitbake.lock  conf  downloads  pseudodone  sstate-cache  tmp
lserban@laurentiu-02:~/work/hob_test/build$ cd tmp/log/
lserban@laurentiu-02:~/work/hob_test/build/tmp/log$ ls -al
total 12
drwxrwxr-x 3 lserban lserban 4096 Aug 23 02:34 .
drwxrwxr-x 9 lserban lserban 4096 Aug 23 02:39 ..
drwxrwxr-x 3 lserban lserban 4096 Aug 23 02:34 cooker



lserban@laurentiu-02:~/work/hob_test/build/tmp/log/cooker$ ls -al
total 12
drwxrwxr-x 3 lserban lserban 4096 Aug 23 02:34 .
drwxrwxr-x 3 lserban lserban 4096 Aug 23 02:34 ..
drwxrwxr-x 2 lserban lserban 4096 Aug 23 02:39 qemux86
lserban@laurentiu-02:~/work/hob_test/build/tmp/log/cooker$

By the way, in the latest master commit the issue is not reproducible anymore.
I could reproduce it only on commit 603f6c631e9454d10517599e229943f2b26d08a5
Comment 3 Richard Purdie 2012-08-23 14:37:46 UTC
This was fixed in http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=fddc16989ddb181800eb6ec383b431e00d79f286 . If the problem is still there please reopen but I think this is fixed now.
Comment 4 Alexandru Georgescu 2012-09-24 11:49:04 UTC
I have verified with e5c3513ca8abb21eb5e9b8c19d1b9199b14ae07c commit.