Bug 768307

Summary: install script fails: in logs cmod 0666 needed for /usr/share/katello/log/production.log
Product: Red Hat Satellite Reporter: Garik Khachikyan <gkhachik>
Component: InstallerAssignee: Lukas Zapletal <lzap>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: bkearney, mkoci, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:14:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 747354    

Description Garik Khachikyan 2011-12-16 09:56:19 UTC
Description of problem:
on latest git built rpms installation process fails.
Not much information but: 
--- thin-log.5000.log
>> Writing PID to tmp/pids/thin.5000.pid
>> Changing process privilege to katello:katello
Rails Error: Unable to access log file. Please ensure that /usr/share/katello/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
>> Exiting!
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/buffered_logger.rb:133:in `initialize': Permission denied - log/production_delayed_jobs.log (Errno::EACCES)
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/buffered_logger.rb:133:in `open'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/buffered_logger.rb:133:in `open_log'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/buffered_logger.rb:51:in `initialize'
        from /usr/share/katello/config/initializers/delayed_job.rb:2:in `new'
        from /usr/share/katello/config/initializers/delayed_job.rb:2
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `load'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `load'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:227:in `load_dependency'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:235:in `load'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:201
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:200:in `each'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/engine.rb:200
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `instance_exec'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:25:in `run'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:50:in `run_initializers'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `each'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/initializable.rb:49:in `run_initializers'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:134:in `initialize!'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `send'
        from /usr/lib/ruby/gems/1.8/gems/railties-3.0.10/lib/rails/application.rb:77:in `method_missing'
        from /usr/share/katello/config/environment.rb:5
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/share/katello/config.ru:3
        from /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/builder.rb:51:in `instance_eval'
        from /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/builder.rb:51:in `initialize'
        from /usr/share/katello/config.ru:1:in `new'
        from /usr/share/katello/config.ru:1

---

Version-Release number of selected component (if applicable):
katello-cli-0.1.29-1.git.0.e3ec54b.el6.noarch
katello-certs-tools-1.0.1-1.el6.noarch
katello-glue-pulp-0.1.145-1.git.3.d6e0a39.el6.noarch
katello-httpd-ssl-key-pair-1.0-1.noarch
katello-repos-0.1.4-1.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-configure-0.1.37-1.git.11.fac6c90.el6.noarch
katello-common-0.1.145-1.git.3.d6e0a39.el6.noarch
katello-0.1.145-1.git.3.d6e0a39.el6.noarch
katello-trusted-ssl-cert-1.0-1.noarch
katello-glue-candlepin-0.1.145-1.git.3.d6e0a39.el6.noarch
katello-all-0.1.145-1.git.3.d6e0a39.el6.noarch
katello-cli-common-0.1.29-1.git.0.e3ec54b.el6.noarch
katello-glue-foreman-0.1.145-1.git.3.d6e0a39.el6.noarch


How reproducible:
1/1 attempt.

Steps to Reproduce:
1. make katello install process. Follow the logs in: /var/log/katello
2.
3.
  
Actual results:
install fails

Expected results:
no errors, installation clean

Additional info:
high priority - install fails

Comment 1 Lukas Zapletal 2011-12-16 10:07:23 UTC
rake aborted!
Permission denied - /etc/katello/katello.yml
/usr/lib/ruby/1.8/yaml.rb:143:in `initialize'
/usr/lib/ruby/1.8/yaml.rb:143:in `open'
/usr/lib/ruby/1.8/yaml.rb:143:in `load_file'
/usr/share/katello/config/application.rb:54
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/usr/share/katello/Rakefile:4
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/rake_module.rb:25:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:495:in `raw_load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:78:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:77:in `load_rakefile'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:61:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2/bin/rake:32
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Comment 2 Lukas Zapletal 2011-12-16 10:19:07 UTC
edca126 puppet - migrate script depends on katello.yml
d666a7f Automatic commit of package [katello-configure] release [0.1.39-1

Comment 3 Garik Khachikyan 2011-12-16 12:00:31 UTC
# REOPEN

next step error:
--- thin-log*

>> Writing PID to tmp/pids/thin.5003.pid
>> Changing process privilege to katello:katello
>> Exiting!
/usr/lib/ruby/1.8/yaml.rb:143:in `initialize': Permission denied - /etc/katello/katello.yml (Errno::EACCES)
        from /usr/lib/ruby/1.8/yaml.rb:143:in `open'
        from /usr/lib/ruby/1.8/yaml.rb:143:in `load_file'
        from /usr/share/katello/config/application.rb:54
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/share/katello/config/environment.rb:2
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /usr/share/katello/config.ru:3
        from /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/builder.rb:51:in `instance_eval'
        from /usr/lib/ruby/gems/1.8/gems/rack-1.3.0/lib/rack/builder.rb:51:in `initialize'
        from /usr/share/katello/config.ru:1:in `new'
        from /usr/share/katello/config.ru:1

Comment 4 Garik Khachikyan 2011-12-16 12:02:17 UTC
and may I ask why katello-configure.conf; katello.yml have: 0600 there ?
---

ls -la /etc/katello/
total 44
drwxr-xr-x.   2 root root  4096 Dec 16 06:30 .
drwxr-xr-x. 102 root root 12288 Dec 16 06:32 ..
-rw-r--r--.   1 root root   160 Dec 15 20:07 client.conf
-rw-r--r--.   1 root root  1899 Dec 16 06:21 environment.rb
-rw-------.   1 root root   137 Dec 16 06:30 katello-configure.conf
-rw-------.   1 root root  4045 Dec 16 06:21 katello.yml
-rw-r--r--.   1 root root   751 Dec 16 04:50 mapping.yml
-rw-r--r--.   1 root root    11 Dec 16 06:30 ssl_ca_password-file
-rw-r--r--.   1 root root   243 Dec 16 04:50 thin.yml

packages:
katello-0.1.145-1.git.7.af9dfee.el6.noarch

Comment 5 Garik Khachikyan 2011-12-16 12:07:47 UTC
extract from: katello-configure/main.log

^[[0;37mdebug: /File[/etc/katello/thin.yml]/seluser: Found seluser default 'system_u' for /etc/katello/thin.yml^[[0m
^[[0;37mdebug: /File[/etc/katello/thin.yml]/selrole: Found selrole default 'object_r' for /etc/katello/thin.yml^[[0m
^[[0;37mdebug: /File[/etc/katello/thin.yml]/seltype: Found seltype default 'etc_t' for /etc/katello/thin.yml^[[0m
^[[0;37mdebug: /File[/etc/katello/thin.yml]/selrange: Found selrange default 's0' for /etc/katello/thin.yml^[[0m
^[[0;37mdebug: /File[/var/log/katello]/seluser: Found seluser default 'system_u' for /var/log/katello^[[0m
^[[0;37mdebug: /File[/var/log/katello]/selrole: Found selrole default 'object_r' for /var/log/katello^[[0m
^[[0;37mdebug: /File[/var/log/katello]/seltype: Found seltype default 'var_log_t' for /var/log/katello^[[0m
^[[0;37mdebug: /File[/var/log/katello]/selrange: Found selrange default 's0' for /var/log/katello^[[0m
Parameter require failed: No title provided and "katello" is not a valid resource reference

Comment 6 Lukas Zapletal 2011-12-16 15:35:37 UTC
Problem is this piece:

  define config_file($source = "", $template = "") {
    file {$name:
      content => $template ? {
        "" => undef,
        default =>  template($template)
      },
      source => $source ? {
        "" => undef,
        default => $source,
      },
    }
  }

we do not define owner and mode for our config files deployed by Puppet. I think it would be good idea to do that.

Comment 7 Lukas Zapletal 2011-12-16 16:01:49 UTC
c7ee187 766933 - katello.yml now deployed with correct perms

I recommend also to verify:

https://bugzilla.redhat.com/show_bug.cgi?id=766933

Comment 8 Sachin Ghai 2011-12-22 10:03:23 UTC
Today I installed new build of katello:

[root@dhcp201-162 ~]# rpm -qa | grep katello
katello-0.1.154-1.el6.noarch
katello-trusted-ssl-cert-1.0-1.noarch
katello-cli-common-0.1.30-1.el6.noarch
katello-glue-pulp-0.1.154-1.el6.noarch
katello-configure-0.1.46-1.el6.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-glue-candlepin-0.1.154-1.el6.noarch
katello-all-0.1.154-1.el6.noarch
katello-repos-0.1.4-1.el6.noarch
katello-cli-0.1.30-1.el6.noarch
katello-glue-foreman-0.1.154-1.el6.noarch
katello-common-0.1.154-1.el6.noarch
katello-certs-tools-1.0.1-1.el6.noarch
katello-httpd-ssl-key-pair-1.0-1.noarch
[root@dhcp201-162 ~]# 



[root@dhcp201-162 ~]# cat /var/log/katello/thin-log.5000.log | grep error
[root@dhcp201-162 ~]# rpm -qa | grep katello-0
katello-0.1.154-1.el6.noarch
[root@dhcp201-162 ~]# ll /etc/katello/katello.yml 
-rw-------. 1 katello katello 4017 Dec 22 11:55 /etc/katello/katello.yml
[root@dhcp201-162 ~]# ll /etc/katello/katello-configure.conf 
-rw-------. 1 root root 0 Dec 22 11:54 /etc/katello/katello-configure.conf
[root@dhcp201-162 ~]# ll /var/log/katello/production.log 
-rw-r--r--. 1 katello root 615398 Dec 22 15:24 /var/log/katello/production.log
[root@dhcp201-162 ~]# 


katello.yml has correct permissions set and didn't face any issue during installation. Installation was clean. So moving this to verified.