Page MenuHomePhabricator

deployment-prometheus02 puppet failures due to Apache not recognizing "RewriteRule"
Closed, ResolvedPublic

Description

taavi@deployment-prometheus02:~$ sudo run-puppet-agent
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for deployment-prometheus02.deployment-prep.eqiad.wmflabs
Info: Applying configuration version '(9dbe9c68ed) root - profile::etcd::v3: use puppet certs for standalone cluster'
Notice: The LDAP client stack for this host is: classic/sudoldap
Notice: /Stage[main]/Profile::Ldap::Client::Labs/Notify[LDAP client stack]/message: defined 'message' as 'The LDAP client stack for this host is: classic/sudoldap'
Error: Could not start Service[apache2]: Execution of '/usr/sbin/service apache2 start' returned 1: Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
Error: /Stage[main]/Httpd/Service[apache2]/ensure: change from 'stopped' to 'running' failed: Could not start Service[apache2]: Execution of '/usr/sbin/service apache2 start' returned 1: Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details. (corrective)
Info: Stage[main]: Unscheduling all events on Stage[main]
Notice: Applied catalog in 7.75 seconds
taavi@deployment-prometheus02:~$ sudo service apache2 status
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-03-06 08:14:11 UTC; 9s ago
  Process: 15867 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Mar 06 08:14:11 deployment-prometheus02 systemd[1]: Starting The Apache HTTP Server...
Mar 06 08:14:11 deployment-prometheus02 apachectl[15867]: AH00526: Syntax error on line 18 of /etc/apache2/prometheus.d/beta.conf:
Mar 06 08:14:11 deployment-prometheus02 apachectl[15867]: Invalid command 'RewriteRule', perhaps misspelled or defined by a module not included in the server configuration
Mar 06 08:14:11 deployment-prometheus02 apachectl[15867]: Action 'start' failed.
Mar 06 08:14:11 deployment-prometheus02 apachectl[15867]: The Apache error log may have more information.
Mar 06 08:14:11 deployment-prometheus02 systemd[1]: apache2.service: Control process exited, code=exited status=1
Mar 06 08:14:11 deployment-prometheus02 systemd[1]: Failed to start The Apache HTTP Server.
Mar 06 08:14:11 deployment-prometheus02 systemd[1]: apache2.service: Unit entered failed state.
Mar 06 08:14:11 deployment-prometheus02 systemd[1]: apache2.service: Failed with result 'exit-code'.

I guess it needs mod_rewrite enabled somehow?

Event Timeline

Change 668995 had a related patch set uploaded (by Majavah; owner: Majavah):
[operations/puppet@production] Add apache2 mod_rewrite to beta prometheus

https://gerrit.wikimedia.org/r/668995

Fix cherrypicked on beta, leaving open until it's merged on the actual operations/puppet repo

Change 668995 merged by Legoktm:
[operations/puppet@production] Add apache2 mod_rewrite to beta prometheus

https://gerrit.wikimedia.org/r/668995