Bug 1600579 - mod_proxy_hcheck Doesn't perform checks in VirtualHost
Summary: mod_proxy_hcheck Doesn't perform checks in VirtualHost
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: httpd
Version: httpd24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.6
Assignee: Luboš Uhliarik
QA Contact: Branislav Náter
Lenka Špačková
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-12 14:20 UTC by Hisanobu Okuda
Modified: 2023-09-07 19:14 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-01 12:06:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache Bugzilla 60757 0 None None None 2018-07-12 14:20:53 UTC
Red Hat Knowledge Base (Solution) 3635291 0 None None None 2020-03-13 21:08:08 UTC

Description Hisanobu Okuda 2018-07-12 14:20:11 UTC
Description of problem:

This is a continuation of https://bz.apache.org/bugzilla/show_bug.cgi?id=60757.

mod_proxy_hcheck is configured in VirtualHost. I expect a watchdog works for VirtualHost and shows a notification like:

[Thu Jul 12 13:32:10.325851 2018] [proxy_hcheck:debug] [pid 2867] mod_proxy_hcheck.c(1033): AH03265: watchdog callback registered (_proxy_hcheck_ for 127.0.0.1)

However, in fact it shows the failure message:

[Thu Jul 12 13:39:13.729415 2018] [proxy_hcheck:trace4] [pid 2939] mod_proxy_hcheck.c(1018): AH10019: Missing unique per-server context: 127.0.0.1 (5563982bee48:556398236400) (no hchecks)

The configuration is as follows:

<VirtualHost 127.0.0.1:80>
  ProxyRequests off
  ProxyPreserveHost On
  ServerName  127.0.0.1
  #ProxyHCExpr ok23 {%{REQUEST_STATUS} =~ /^[23]/}
  #ProxyHCTemplate hcinterval=5
  <Proxy balancer://jbosscluster>
    BalancerMember http://redhat.com:80/ route=p01 hcmethod=TCP hcinterval=5
    BalancerMember http://jboss.org:80/ route=p02 hcmethod=TCP hcinterval=5
    ProxySet lbmethod=byrequests
    Require all granted
  </Proxy>
  ProxyPass / balancer://jbosscluster/
  ProxyPassReverse / balancer://jbosscluster/
  <Proxy *>
    Require all denied
  </Proxy>
  <Location ~ "/*">
    Require all granted
  </Location>
  LogLevel proxy_hcheck:TRACE8 proxy:TRACE2 watchdog:TRACE2
</VirtualHost>

Uncommenting ProxyHCExpr or ProxyHCTemplate, it works as expected.


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

httpd24-httpd-2.4.27-8.el7.1.x86_64

How reproducible:

Steps to Reproduce:
1. Add the above config in /opt/rh/httpd24/root/etc/httpd/conf.d/
2. Restart the server
3. See error_log

Actual results:

[Thu Jul 12 13:32:10.325851 2018] [proxy_hcheck:debug] [pid 2867] mod_proxy_hcheck.c(1033): AH03265: watchdog callback registered (_proxy_hcheck_ for 127.0.0.1)

Expected results:

[Thu Jul 12 13:39:13.729415 2018] [proxy_hcheck:trace4] [pid 2939] mod_proxy_hcheck.c(1018): AH10019: Missing unique per-server context: 127.0.0.1 (5563982bee48:556398236400) (no hchecks)


Additional info:

If neither of the above 2 directive is defined in VirtualHost, hc_create_config is not invoked. As a result, the root sctx_t instance is reused for each VirtualHost:

Breakpoint 1, hc_post_config (p=<optimized out>, plog=<optimized out>, ptemp=<optimized out>, main_s=<optimized out>) at mod_proxy_hcheck.c:1015
1015            if (s != ctx->s) {
(gdb) print s.server_hostname 
$1 = 0x5555558a00b0 "172.17.0.2"
(gdb) print s                 
$2 = (server_rec *) 0x55555580b400
(gdb) print ctx.s
$3 = (server_rec *) 0x55555580b400
(gdb) c
Continuing.

Breakpoint 1, hc_post_config (p=<optimized out>, plog=<optimized out>, ptemp=<optimized out>, main_s=<optimized out>) at mod_proxy_hcheck.c:1015
1015            if (s != ctx->s) {
(gdb) print s.server_hostname 
$4 = 0x555555899ed0 "127.0.0.1"
(gdb) print s
$5 = (server_rec *) 0x555555893e48
(gdb) print ctx.s
$6 = (server_rec *) 0x55555580b400    <<<<====reused
(gdb)

Comment 15 errata-xmlrpc 2020-12-01 12:06:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (httpd24 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5280


Note You need to log in before you can comment on or make changes to this bug.