Bug 1217540

Summary: create deployment logs under /var/log
Product: Red Hat Quickstart Cloud Installer Reporter: Dafna Ron <dron>
Component: Installation - RHEVAssignee: John Matthews <jmatthew>
Status: CLOSED DEFERRED QA Contact: Tasos Papaioannou <tpapaioa>
Severity: high Docs Contact: Dan Macpherson <dmacpher>
Priority: unspecified    
Version: 1.0CC: bthurber, dajohnso, jmatthew, jsaucier, tpapaioa
Target Milestone: TP2Keywords: Triaged
Target Release: 1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-25 17:27:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1278053    
Attachments:
Description Flags
Foreman production.log error stack none

Description Dafna Ron 2015-04-30 15:20:03 UTC
Description of problem:

I found it hard to understand where the deployment logs are located. 
It would help if we can create a deployment log per deployment under the /var/log/<deployment_name>/xxx.log

Version-Release number of selected component (if applicable):

fusor-initial-setup-0.0.21-4.el7eso.noarch
fusor-installer-0.0.14-1.el7eso.noarch

How reproducible:

100%

Steps to Reproduce:
1. run a deployment that would fail
2. look for the location of the logs in the server
3.

Actual results:

the logs are not located under /var/log

Expected results:

logs should be accessible and organized per deployment under a known location that would allow an easy debugging


Additional info:

Comment 1 dgao 2015-12-02 13:35:33 UTC
Initial attempt at this is captured in: 

https://github.com/fusor/fusor/pull/526

Comment 2 Jean-Francois Saucier 2015-12-07 19:31:09 UTC
I just tried to run an ISO install (https://engineering.redhat.com/trac/RHCI/wiki/Guides/ISO_Install) with the latest ISO image (RHCI-6.0-RHEL-7-20151204.t.1-RHCI-x86_64-dvd1.iso).

I created a simle RHEV + Cloudforms deployment named "rhevtest1". When I clicked on "Deploy", I got the following message :

Permission denied - /usr/share/foreman/log/rhevtest1-1

I will attach the relevant portion of production.log with the error stack. This error was not present when using the ISO RHCI-6.0-RHEL-7-20151022.t.3-RHCI-x86_64-dvd1.iso.

Comment 3 Jean-Francois Saucier 2015-12-07 19:31:38 UTC
Created attachment 1103363 [details]
Foreman production.log error stack

Comment 4 John Matthews 2015-12-07 19:40:26 UTC
Jean-Francois, thank you for the note and the log snippet.

David Gao,
Please try an ISO install and see if the issue is related to SELinux, we may need to include another rule in https://github.com/fusor/fusor-selinux


From Jean-Francois log snippet:

2015-12-07 14:18:02 [I] Processing by Fusor::Api::V21::DeploymentsController#deploy as JSON
2015-12-07 14:18:02 [I]   Parameters: {"api_version"=>"v21", "id"=>"1", "deployment"=>{}}
2015-12-07 14:18:02 [E] Errno::EACCES: Permission denied - /usr/share/foreman/log/rhevtest1-1
/opt/rh/ruby193/root/usr/share/gems/gems/fusor_server-0.0.1/lib/init_log.rb:22:in `mkdir'
/opt/rh/ruby193/root/usr/share/gems/gems/fusor_server-0.0.1/lib/init_log.rb:22:in `log_change_deployment'
/opt/rh/ruby193/root/usr/share/gems/gems/fusor_server-0.0.1/app/controllers/fusor/api/v2/deployments_controller.rb:55:in `deploy'

Comment 5 Jean-Francois Saucier 2015-12-07 19:53:14 UTC
I forgot to add the selinux audit log, sorry.

Here is a snippet from the audit.log :

type=AVC msg=audit(1449515882.169:708): avc:  denied  { create } for  pid=26901 comm="ruby" name="rhevtest1-1" scontext=system_u:system_r:passenger_t:s0 tcontext=system_u:object_r:foreman_log_t:s0 tclass=dir
type=SYSCALL msg=audit(1449515882.169:708): arch=c000003e syscall=83 success=no exit=-13 a0=7f81f49409e0 a1=1ff a2=1 a3=0 items=0 ppid=1 pid=26901 auid=4294967295 uid=994 gid=994 euid=994 suid=994 fsuid=994 egid=994 sgid=994 fsgid=994 tty=(none) ses=4294967295 comm="ruby" exe="/opt/rh/ruby193/root/usr/bin/ruby" subj=system_u:system_r:passenger_t:s0 key=(null)

Comment 6 John Matthews 2015-12-07 20:12:27 UTC
Thank you!, the AVC denial helped.


Jason Montleon added the below commit for us which we hope will address the AVC denial.

https://github.com/fusor/fusor-
selinux/commit/21824262c80823b73599319bb9339a1dea09d52c

A new compose will be created this afternoon with this fix.

Comment 7 John Matthews 2015-12-07 22:10:11 UTC
We've built compose RHCI-6.0-RHEL-7-20151207.t.0 to address the AVC denial seen in comment #5.

Comment 8 Jean-Francois Saucier 2015-12-08 13:34:29 UTC
I can confirm that this bug is fixed in RHCI-6.0-RHEL-7-20151207.t.0 compose, thank you.

Comment 9 Tasos Papaioannou 2016-01-08 19:32:40 UTC
VERIFIED on RHCI-6.0-RHEL-7-20160107.t.1

Comment 11 Sudhir Mallamprabhakara 2019-02-25 17:27:22 UTC
QCI has sunset. Closing the BZ's.