Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1136282 - `foreman-rake bootdisk:generate:generic` fails with: Permission denied - bootdisk_<fqdn>.iso
`foreman-rake bootdisk:generate:generic` fails with: Permission denied - boot...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Provisioning (Show other bugs)
6.0.3
Unspecified Unspecified
unspecified Severity medium (vote)
: Unspecified
: Unused
Assigned To: Dominic Cleal
Tazim Kolhar
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-02 05:33 EDT by Jan Hutař
Modified: 2017-02-23 16:00 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-12 01:15:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 7370 None None None 2016-04-22 12:58 EDT
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 05:04:35 EDT

  None (edit)
Description Jan Hutař 2014-09-02 05:33:24 EDT
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
Comment 2 Jan Hutař 2014-09-02 05:35:21 EDT
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.
Comment 3 Lukas Zapletal 2014-09-02 09:21:38 EDT
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
Comment 4 Mike McCune 2014-09-02 15:19:33 EDT
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
Comment 5 Dominic Cleal 2014-09-08 03:40:56 EDT
Created redmine issue http://projects.theforeman.org/issues/7370 from this bug
Comment 6 Bryan Kearney 2014-10-03 08:05:49 EDT
Moving to POST since upstream bug http://projects.theforeman.org/issues/7370 has been closed
-------------
Dominic Cleal
Applied in changeset commit:foreman_bootdisk|c010a67fada33276da4dd9164d6580f16d476904.
Comment 9 Tazim Kolhar 2015-03-09 08:12:47 EDT
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
Comment 10 Bryan Kearney 2015-08-11 09:37:37 EDT
This bug is slated to be released with Satellite 6.1.
Comment 11 errata-xmlrpc 2015-08-12 01:15:57 EDT
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

Note You need to log in before you can comment on or make changes to this bug.