puppetinabox / controlrepo

39 stars 23 forks source link

Missing dependencies for passenger #53

Closed Wicaeed closed 8 years ago

Wicaeed commented 8 years ago

I am showing the following error during the run of the bootstrap.sh script: http://pastebin.com/c3kZNtqZ

I can do a yum search passenger and get no results with both the puppet and epel repos enabled.

Can confirm that if I manually enable the passenger repo (https://www.phusionpassenger.com/library/install/apache/install/oss/el6/) and follow the install instructions, I can bypass this error, however it requires that you either disable SeLinux, or update to a newer kernel version.

rnelson0 commented 8 years ago

@Wicaeed Can you add the output of puppet module list --modulepath=/root/bootstrap/modules?

rnelson0 commented 8 years ago

@Wicaeed also what OS and version are you using?

Wicaeed commented 8 years ago

Here you go:

puppet module list --modulepath=/root/bootstrap/modules/root/bootstrap/modules
├── croddy-make (v0.0.5)
├── gentoo-portage (v2.3.0)
├── hunner-hiera (v1.1.1)
├── puppetlabs-apache (v1.6.0)
├── puppetlabs-apt (v1.8.0)
├── puppetlabs-concat (v1.2.4)
├── puppetlabs-firewall (v1.7.1)
├── puppetlabs-gcc (v0.3.0)
├── puppetlabs-git (v0.4.0)
├── puppetlabs-inifile (v1.4.2)
├── puppetlabs-pe_gem (v0.1.1)
├── puppetlabs-postgresql (v3.4.2)
├── puppetlabs-puppetdb (v3.0.1)
├── puppetlabs-ruby (v0.4.0)
├── puppetlabs-stdlib (v4.9.0)
├── puppetlabs-vcsrepo (v1.3.1)
├── stahnma-epel (v1.0.2)
├── stephenrjohnson-puppet (v1.3.1)
└── zack-r10k (v2.5.4)

Curiously it looks like gem is the provider for passenger (I think) in the puppetlabs/passenger module, although I think it does make mention of EPEL needing to be enabled as well. However EPEL doesn't know about passenger either:

yum repolist
Loaded plugins: fastestmirror, refresh-packagekit, security, versionlock
Loading mirror speeds from cached hostfile
 * base: repos.lax.quadranet.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirrors.tummy.com
 * updates: mirror.supremebytes.com
repo id                                                                                                                                    repo name                                                                                                                                                              status
base                                                                                                                                       CentOS-6 - Base                                                                                                                                                         6,575
epel                                                                                                                                       Extra Packages for Enterprise Linux 6 - x86_64                                                                                                                         11,747
extras                                                                                                                                     CentOS-6 - Extras                                                                                                                                                          44
puppetlabs-deps                                                                                                                            Puppet Labs Dependencies El 6 - x86_64                                                                                                                                     77
puppetlabs-products                                                                                                                        Puppet Labs Products El 6 - x86_64                                                                                                                                        535
updates                                                                                                                                    CentOS-6 - Updates                                                                                                                                                        488
repolist: 19,466
[root@puppet etc]# yum search passenger
Loaded plugins: fastestmirror, refresh-packagekit, security, versionlock
Loading mirror speeds from cached hostfile
 * base: mirror.supremebytes.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: centos.eecs.wsu.edu
 * updates: mirror.supremebytes.com
Warning: No matches found for: passenger
No Matches found
rnelson0 commented 8 years ago

@Wicaeed try yum search mod_passenger instead of passenger.

Apache is what installs mod_passenger but I see no mention of the package as a dependency for the file. Regardless, the package SHOULD be available in EPEL:

[root@puppet apache]# yum list mod_passenger
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.keystealth.org
 * epel: dl.fedoraproject.org
 * extras: lug.mtu.edu
 * updates: mirror.ancl.hawaii.edu
Installed Packages
mod_passenger.x86_64                                                                               3.0.21-11.el6                                                                                @epel

Can you verify its availability? Can you run the bootstrap again and see if it finds it now? If it's a fail-on-first-run issue, I think I might know why.

Wicaeed commented 8 years ago

Hmm, verified on a fresh install of CentOS 6.5 after enabling epel repo (and also after running yum update to go to CentOS 6.7), and also in the IRC channel #centos that epel doesn't contain mod_passenger.x86_64

Also not listed at http://koji.fedoraproject.org/koji/packages?start=850&order=package_name&prefix=m&inherited=1

rnelson0 commented 8 years ago

@Wicaeed I see a lot of evidence that mod_passenger was in EPEL (http://nytefyre.net/2012/10/puppet-via-apache-using-passenger-from-epel/, http://rpm.pbone.net/index.php3/stat/4/idpl/25413631/dir/redhat_el_6/com/mod_passenger-3.0.21-11.el6.x86_64.rpm.html, and of course yum list mod_passenger on my master) though it's clearly not there now. I took a snapshot and removed mod_passenger on my master and of course could not reinstall it. Very disappointing. So it looks like we'll have to find another source for this. The phusion version is incompatible with CentOS 6.x, I don't see a way around that easily.

What are your feelings on disabling SELinux on the master?

rnelson0 commented 8 years ago

I will have to try http://yum.theforeman.org/nightly/el6/x86_64/mod_passenger-4.0.18-9.9.el6.x86_64.rpm (from https://media-glass.es/2014/07/27/upgrading-servers-centos-7/) and see if that works.

Wicaeed commented 8 years ago

I was able to install mod_passenger from the nightly repos:

yum -y install http://yum.theforeman.org/nightly/el6/x86_64/rubygem-passenger-native-libs-4.0.18-9.9.el6.x86_64.rpm http://yum.theforeman.org/nightly/el6/x86_64/rubygem-passenger-native-4.0.18-9.9.el6.x86_64.rpm http://yum.theforeman.org/nightly/el6/x86_64/rubygem-passenger-4.0.18-9.9.el6.x86_64.rpm http://yum.theforeman.org/nightly/el6/x86_64/mod_passenger-4.0.18-9.9.el6.x86_64.rpm

It actually doesn't complain when you have SELinux enforcing, but it does appear to require it to be set to disabled in order for puppet to successfully run.

rnelson0 commented 8 years ago

I hate computers.

Looks like the options are

Long term, I'd like to look at CentOS7 and see how it would help, but the last option may be the best because who knows how passenger is supported by any given OS anyway?

What do you think @Wicaeed @seanscottking ?

Wicaeed commented 8 years ago

I think the obvious workaround here is to disable SELinux and add a requirement that mod passenger be installed beforehand. Obviously not practical (or recommended) for a production installation, but I think this project is really good for just showing puppet noobs what a Puppet deployment can really do, as opposed to just vaguely hinting at it in the Puppet docs.

I think the extremely long term fix would be to move to Puppet Server since the method of using the Puppet Master with Apache and passenger seems to be a bit outdated (https://media-glass.es/2015/07/12/update-to-puppet-install-script/) but that sounds like it would require quite a bit of work.

rnelson0 commented 8 years ago

Oh, yes, good call. Duh. Puppet4 is the end goal anyway, something I can hopefully work on over the holiday break.

rnelson0 commented 8 years ago

@Wicaeed I updated https://github.com/puppetinabox/controlrepo/wiki/Pre-Requisites. Does that look adequate to you? If so, I will close this out and add a milestone for moving to puppetserver.

rnelson0 commented 8 years ago

@Wicaeed If the mod_passenger from phusion + disablign SELinux works, can you provide a brief description of that process so I can add it to the wiki?

I also need to know if the updated bootstrap works once you provide mod_passenger, for #44. The lack of errors leads me to believe so but would like to very. If not, let me know what other changes you made and I will get them in place as well.

Thanks!

Wicaeed commented 8 years ago

I actually tried installing mod_passenger from the instructions here first: https://www.phusionpassenger.com/library/install/nginx/install/oss/el6/

I ran into an issue where the puppetlabs-apache module would not start since the version of phusion passenger is 5.x and is not supported on the puppetlabs module. The new version has deprecated some of the mod_passenger.conf opions included in the puppetlabs-apache version.

Installing from the foreman nightly did not run into this issue, so I would recommend that if it's an option.

rnelson0 commented 8 years ago

Documentation changed to point to foreman nightlys and that install guide.

Just to confirm: using the foreman nightlights and installing mod_passenger first results in no errors when using the updated bootstrap.sh. Correct?

Wicaeed commented 8 years ago

I'm starting with the following state:

In all I ran into a few errors:

Error: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:47:in `initialize': No such file or directory - /etc/mcollective/server_public.pem (Errno::ENOENT)
    from /usr/local/bin/webhook:47:in `open'
    from /usr/local/bin/webhook:47
[FAILED]
Error: /Stage[main]/R10k::Webhook/Service[webhook]/ensure: change from stopped to running failed: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:47:in `initialize': No such file or directory - /etc/mcollective/server_public.pem (Errno::ENOENT)
    from /usr/local/bin/webhook:47:in `open'
    from /usr/local/bin/webhook:47
[FAILED]

And this at the end:

Info: /Stage[main]/Puppet::Passenger/File[puppet_passenger.conf]: Scheduling refresh of Service[httpd]
Info: Class[Apache::Service]: Scheduling refresh of Service[httpd]
Error: /Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Starting httpd: [Fri Nov 06 14:18:23 2015] [warn] module passenger_module is already loaded, skipping
Syntax error on line 5 of /etc/httpd/conf.d/puppet_passenger.conf:
Invalid command 'RackAutoDetect', perhaps misspelled or defined by a module not included in the server configuration
[FAILED]
Error: /Stage[main]/Apache::Service/Service[httpd]: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Starting httpd: [Fri Nov 06 14:18:23 2015] [warn] module passenger_module is already loaded, skipping
Syntax error on line 5 of /etc/httpd/conf.d/puppet_passenger.conf:
Invalid command 'RackAutoDetect', perhaps misspelled or defined by a module not included in the server configuration
[FAILED]
Notice: Finished catalog run in 568.13 seconds
Error: Could not send report: Connection refused - connect(2)
Starting puppet agent:                                     [  OK  ]

So I retract my earlier statement about mod_passenger being compatible with the version of puppetlabs-apache :(

rnelson0 commented 8 years ago

Can you change the Apache version in th bootstrap to 1.6.0 (latest) and see if that improves anything?

On Friday, November 6, 2015, Wicaeed notifications@github.com wrote:

I'm starting with the following state:

In all I ran into a few errors:

Error: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:47:in initialize': No such file or directory - /etc/mcollective/server_public.pem (Errno::ENOENT) from /usr/local/bin/webhook:47:inopen' from /usr/local/bin/webhook:47 [FAILED] Error: /Stage[main]/R10k::Webhook/Service[webhook]/ensure: change from stopped to running failed: Could not start Service[webhook]: Execution of '/sbin/service webhook start' returned 1: Starting webhook: /usr/local/bin/webhook:47:in initialize': No such file or directory - /etc/mcollective/server_public.pem (Errno::ENOENT) from /usr/local/bin/webhook:47:inopen' from /usr/local/bin/webhook:47 [FAILED]

And this at the end:

Info: /Stage[main]/Puppet::Passenger/File[puppet_passenger.conf]: Scheduling refresh of Service[httpd] Info: Class[Apache::Service]: Scheduling refresh of Service[httpd] Error: /Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Starting httpd: [Fri Nov 06 14:18:23 2015] [warn] module passenger_module is already loaded, skipping Syntax error on line 5 of /etc/httpd/conf.d/puppet_passenger.conf: Invalid command 'RackAutoDetect', perhaps misspelled or defined by a module not included in the server configuration [FAILED] Error: /Stage[main]/Apache::Service/Service[httpd]: Could not start Service[httpd]: Execution of '/sbin/service httpd start' returned 1: Starting httpd: [Fri Nov 06 14:18:23 2015] [warn] module passenger_module is already loaded, skipping Syntax error on line 5 of /etc/httpd/conf.d/puppet_passenger.conf: Invalid command 'RackAutoDetect', perhaps misspelled or defined by a module not included in the server configuration [FAILED] Notice: Finished catalog run in 568.13 seconds Error: Could not send report: Connection refused - connect(2) Starting puppet agent: [ OK ]```

So I retract my earlier statement about mod_passenger being compatible with the version of puppetlabs-apache :(

— Reply to this email directly or view it on GitHub https://github.com/puppetinabox/controlrepo/issues/53#issuecomment-154560530 .

Rob Nelson rnelson0@gmail.com

Wicaeed commented 8 years ago

Looks to already be at latest when it is installed by stephenrjohnson/puppet

[root@puppet controlrepo]# puppet module install --modulepath=/root/bootstrap/modules stephenrjohnson/puppet --version 1.3.1
Notice: Preparing to install into /root/bootstrap/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/root/bootstrap/modules
└─┬ stephenrjohnson-puppet (v1.3.1)
  ├─┬ puppetlabs-apache (v1.6.0)
  │ └── puppetlabs-concat (v1.2.4)
  ├── puppetlabs-apt (v1.8.0)
  ├── puppetlabs-inifile (v1.4.2)
  ├── puppetlabs-puppetdb (v3.0.1)
  └── puppetlabs-stdlib (v4.9.0)
rnelson0 commented 8 years ago

@Wicaeed I'm going to close this out as I cannot fix it due to the loss of passenger in epel. I'm working on #55 and hope to resolve this by the new year. If you have any stopgap solutions, please submit a PR or open a new ticket pointing me in the right direction and I can judge the effort required for it against going to puppet 4.