puppetlabs / puppetlabs-apache

Puppet module for the Apache httpd server, maintained by Puppet, Inc.
https://forge.puppet.com/modules/puppetlabs/apache
Apache License 2.0
364 stars 1.08k forks source link

Issue with mod php on Redhat 9 #2261

Closed david22swan closed 2 years ago

david22swan commented 2 years ago

Due to an unknown cause, when php is installed on RedHat 9 the libphp.so file is not getting dropped into the modules folder, causing httpd to run into problems. Logging onto a box, this issue seems to be replicated when running yum install php locally on it and as such seems like it may be a result of outside factors rather than the module itself. An example of the error thrown by the test's is shown below:

1) apache::mod::php class default php config succeeds in puppeting php
     On host `34.83.143.56'
     Failure/Error: apply_manifest(pp, catch_failures: true)
     RuntimeError:
       apply manifest failed
       `LC_ALL=en_US.UTF-8  puppet apply manifest_20220704_2060_13txnko.pp --trace --detailed-exitcodes`
       with exit code 6 (expected: [0, 2])
       ====== Start output of failed Puppet apply ======
Error: /Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: Systemd restart for httpd failed!
       journalctl log for httpd:
       Jul 04 11:19:49 litmus-69bec483df[41](https://github.com/puppetlabs/puppetlabs-apache/runs/7179341467?check_suite_focus=true#step:13:42)28aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:19:50 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:19:50 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:19:50 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:19:50 litmus-69bec483df4128aa httpd[66593]: Server configured, listening on: port 80
       Jul 04 11:19:50 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:20:03 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:20:04 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:20:04 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:21:12 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:21:12 litmus-69bec483df4128aa httpd[68949]: Server configured, listening on: port 80
       Jul 04 11:21:12 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:21:41 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:21:[42](https://github.com/puppetlabs/puppetlabs-apache/runs/7179341467?check_suite_focus=true#step:13:43) litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:21:42 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:21:42 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:21:42 litmus-69bec483df4128aa httpd[69687]: Server configured, listening on: port 80
       Jul 04 11:21:42 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:22:05 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:22:06 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:22:06 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:22:06 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:22:06 litmus-69bec483df4128aa httpd[70223]: Server configured, listening on: port 80
       Jul 04 11:22:06 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:22:14 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:22:15 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:22:15 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:22:15 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:22:15 litmus-69bec483df4128aa httpd[70463]: Server configured, listening on: port 80
       Jul 04 11:22:15 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:22:23 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:22:24 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:22:24 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:22:24 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:22:24 litmus-69bec483df4128aa httpd[70703]: Server configured, listening on: port 80
       Jul 04 11:22:24 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:22:40 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:22:41 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:22:41 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:22:41 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:22:41 litmus-69bec483df4128aa httpd[71125]: Server configured, listening on: port 80
       Jul 04 11:22:41 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:22:54 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       Jul 04 11:22:55 litmus-69bec483df4128aa systemd[1]: httpd.service: Deactivated successfully.
       Jul 04 11:22:55 litmus-69bec483df4128aa systemd[1]: Stopped The Apache HTTP Server.
       Jul 04 11:22:55 litmus-69bec483df4128aa systemd[1]: Starting The Apache HTTP Server...
       Jul 04 11:22:55 litmus-69bec483df4128aa httpd[71428]: [Mon Jul 04 11:22:55.366520 2022] [core:error] [pid 71428:tid 71428] (EAI 2)Name or service not known: AH00547: Could not resolve host name defaults.example.com -- ignoring!
       Jul 04 11:22:55 litmus-69bec483df4128aa httpd[71428]: Server configured, listening on: port 80
       Jul 04 11:22:55 litmus-69bec483df4128aa systemd[1]: Started The Apache HTTP Server.
       Jul 04 11:23:08 litmus-69bec483df4128aa systemd[1]: Stopping The Apache HTTP Server...
       /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:382:in `block in run'
       /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:734:in `exit_on_fail'
       /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:382:in `run'
       /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:1[43](https://github.com/puppetlabs/puppetlabs-apache/runs/7179341467?check_suite_focus=true#step:13:44):in `run'
       /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:77:in `execute'
       /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
Notice: Compiled catalog for litmus-69bec483df4128aa.c.ia-content.internal in environment production in 0.89 seconds
Notice: /Stage[main]/Main/Host[php.example.com]/ensure: created
Notice: /Stage[main]/Apache/Concat[/etc/httpd/conf/ports.conf]/File[/etc/httpd/conf/ports.conf]/content: content changed '{md5}7c4742adc3e33066c74a24c77716ccce' to '{md5}334fa5cddbf9a408ea1ca7a1666b1fc4'
Notice: /Stage[main]/Apache::Mod::Php/Apache::Mod[php]/Package[php]/ensure: created
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.d/25-example.com.conf]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.d/php.conf]/ensure: removed
Notice: /Stage[main]/Apache::Mod::Php/File[php.conf]/ensure: defined content as '{md5}2[44](https://github.com/puppetlabs/puppetlabs-apache/runs/7179341467?check_suite_focus=true#step:13:45)20bffd2939b1fe3ff0ca36dbad419'
Notice: /Stage[main]/Apache::Mod::Php/Apache::Mod[php]/File[php.load]/ensure: defined content as '{md5}d234f2a6e40434420801081a9d3e2a52'
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.modules.d/md.conf]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.modules.d/md.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.modules.d/socache_shmcb.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.modules.d/ssl.conf]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.modules.d/ssl.load]/ensure: removed
Notice: /Stage[main]/Apache/File[/etc/httpd/conf.modules.d/watchdog.load]/ensure: removed
Notice: /Stage[main]/Main/Apache::Vhost[php.example.com]/File[/var/www/php]/ensure: created
Notice: /Stage[main]/Main/File[/var/www/php/index.php]/ensure: defined content as '{md5}48101bbdd897877cc62b8704a293a436'
Notice: /Stage[main]/Main/Apache::Vhost[php.example.com]/Concat[25-php.example.com.conf]/File[/etc/httpd/conf.d/25-php.example.com.conf]/ensure: defined content as '{md5}c3159181a4fcf04060de7ed8a736d3f1'
Notice: Applied catalog in 9.39 seconds
       ====== End output of failed Puppet apply ======
     # ./vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.0/lib/puppet_litmus/puppet_helpers.rb:[45](https://github.com/puppetlabs/puppetlabs-apache/runs/7179341467?check_suite_focus=true#step:13:46)4:in `report_puppet_apply_error'
     # ./vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.0/lib/puppet_litmus/puppet_helpers.rb:133:in `block in apply_manifest'
     # ./vendor/bundle/ruby/2.7.0/gems/honeycomb-beeline-2.11.0/lib/honeycomb/client.rb:65:in `start_span'
     # ./vendor/bundle/ruby/2.7.0/gems/puppet_litmus-0.34.0/lib/puppet_litmus/puppet_helpers.rb:[52](https://github.com/puppetlabs/puppetlabs-apache/runs/7179341467?check_suite_focus=true#step:13:53):in `apply_manifest'
     # ./spec/acceptance/mod_php_spec.rb:24:in `block (3 levels) in <top (required)>'

The relevant test's have temporarily been disabled on Redhat 9, but this is an issue that will need solved sooner rather than later.

ekohl commented 2 years ago

Due to an unknown cause, when php is installed on RedHat 9 the libphp.so file is not getting dropped into the modules folder, causing httpd to run into problems.

It appears EL 9 has dropped support for mod_php and you must consume it via php-fpm.