Red Hat Bugzilla – Bug 1136282
`foreman-rake bootdisk:generate:generic` fails with: Permission denied - bootdisk_<fqdn>.iso
Last modified: 2017-02-23 16:00:14 EST
Description of problem: `foreman-rake bootdisk:generate:generic` fails with: "Permission denied - bootdisk_<fqdn>.iso" Version-Release number of selected component (if applicable): Satellite-6.0.4-RHEL-6-20140829.0 How reproducible: always Steps to Reproduce: 1. Take an empty Satellite 6 2. foreman-rake bootdisk:generate:generic --trace Actual results: # foreman-rake bootdisk:generate:generic --trace ** Invoke bootdisk:generate:generic (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute bootdisk:generate:generic Size of boot image is 4 sectors -> No emulation Total translation table size: 2048 Total rockridge attributes bytes: 0 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 339 extents written (0 MB) rake aborted! Permission denied - bootdisk_<fqdn>.iso /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1371:in `initialize' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1371:in `open' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1371:in `block in copy_file' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1370:in `open' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1370:in `copy_file' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:477:in `copy_file' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:396:in `block in cp' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1515:in `block in fu_each_src_dest' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1531:in `fu_each_src_dest0' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:1513:in `fu_each_src_dest' /opt/rh/ruby193/root/usr/share/ruby/fileutils.rb:395:in `cp' /opt/rh/ruby193/root/usr/share/gems/gems/foreman_bootdisk-2.0.6/lib/tasks/bootdisk.rake:21:in `block (4 levels) in <top (required)>' /opt/rh/ruby193/root/usr/share/gems/gems/foreman_bootdisk-2.0.6/app/services/bootdisk/iso_generator.rb:42:in `block in generate' /opt/rh/ruby193/root/usr/share/ruby/tmpdir.rb:83:in `mktmpdir' /opt/rh/ruby193/root/usr/share/gems/gems/foreman_bootdisk-2.0.6/app/services/bootdisk/iso_generator.rb:12:in `generate' /opt/rh/ruby193/root/usr/share/gems/gems/foreman_bootdisk-2.0.6/lib/tasks/bootdisk.rake:19:in `block (3 levels) in <top (required)>' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in `invoke_with_call_chain' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in `invoke_task' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block (2 levels) in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `each' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in `top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in `block in run' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in `standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run' /opt/rh/ruby193/root/usr/bin/rake:32:in `<main>' Tasks: TOP => bootdisk:generate:generic Expected results: Usable ISO should be generated
Sorry, expected result (due to fact we are on Sat6 without any repos synced) should be some reasonable error message. ISO can not be generated because we do not have the content.
I can confirm, this is because foreman-rake runs as "foreman" effective user. Unfortunately changing to /tmp does not help, it looks like it wants to create some kind of temporary file somewhere. We should respect the $PWD when copying the file. Workaround: [root@dell-pe2950-01 ~]# foreman-rake bootdisk:generate:generic OUTPUT=/tmp/my.iso Size of boot image is 4 sectors -> No emulation Total translation table size: 2048 Total rockridge attributes bytes: 0 Total directory bytes: 0 Path table size(bytes): 10 Max brk space used 0 339 extents written (0 MB) Wrote /tmp/my.iso
WORKAROUND: User should specify an output directory on where to write the ISO file where the foreman user has permission to write to. A good example of this is /tmp
Created redmine issue http://projects.theforeman.org/issues/7370 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/7370 has been closed ------------- Dominic Cleal Applied in changeset commit:foreman_bootdisk|c010a67fada33276da4dd9164d6580f16d476904.
VERIFIED: # foreman-rake bootdisk:generate:generic --trace ** Invoke bootdisk:generate:generic (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute bootdisk:generate:generic Size of boot image is 4 sectors -> No emulation Total translation table size: 2048 Total rockridge attributes bytes: 0 Total directory bytes: 290 Path table size(bytes): 10 Max brk space used 0 339 extents written (0 MB) Wrote /tmp/bootdisk_2365076133.dom.com.iso
This bug is slated to be released with Satellite 6.1.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2015:1592