You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2024/07/01 15:19:38 UTC

[Bug 69160] New: Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

            Bug ID: 69160
           Summary: Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi
                    stopped working correctly
           Product: Apache httpd-2
           Version: 2.4.60
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_fcgid
          Assignee: bugs@httpd.apache.org
          Reporter: mgoebel@emich.edu
  Target Milestone: ---

<Location /sympa>
    SetHandler "proxy:unix:/var/run/wwsympa.socket|fcgi://"
    Require all granted
</Location>

returning the following error under 2.4.60

[Mon Jul 01 10:40:01.637494 2024] [proxy_fcgi:error] [pid 3353895:tid 3353959]
[client 164.76.158.240:40890] AH01059: error parsing URL //: Invalid host/port

works perfectly when I downgrade back to 2.4.59 

-----------

not sure if it matters, on RH Enterprise 8

compile options 

  ./configure --prefix=/home/apache2 \
        --enable-rewrite \
        --enable-headers \
        --enable-ssl \
        --with-ssl \
        --enable-rewrite \
        --enable-so \
        --enable-proxy \
        --enable-proxy-fcgi

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

--- Comment #1 from Eric Covener <co...@gmail.com> ---
(In reply to Matthew Goebel from comment #0)
> <Location /sympa>
>     SetHandler "proxy:unix:/var/run/wwsympa.socket|fcgi://"
>     Require all granted
> </Location>
> 

Sorry about this.

I think a dummy host (any token) is usually used after fcgi:// -- does it
resolve it for you?

e.g. 

> SetHandler "proxy:unix:/var/run/wwsympa.socket|fcgi://unused"

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |FixedInTrunk

--- Comment #4 from Yann Ylavic <yl...@gmail.com> ---
Fixed in r1919015.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

--- Comment #9 from Sylvain Beucler <be...@beuc.net> ---
Incidentally, reading your comment, would you recommend the Sympa dev to switch
to:
  ProxyPass /sympa unix:/run/sympa/wwsympa.socket|fcgi://
?

I see both syntaxes are referenced in
https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

--- Comment #10 from Yann Ylavic <yl...@gmail.com> ---
I don't know because the two configurations seem to differ in the environment
variables finally sent too.

For instance if I request "/sympa/index.cgi" with:
# no "unix:" thing here, not relevant since it resolves to the same finally
<Location /sympa>
    SetHandler "proxy:fcgi://localhost"
</Location>
The env is this:
REQUEST_URI="/sympa/index.cgi"
DOCUMENT_ROOT="/var/www/htdocs"
SCRIPT_FILENAME="proxy:fcgi://localhost/var/www/htdocs/sympa"
SCRIPT_NAME="/sympa"
PATH_INFO="/index.cgi"
PATH_TRANSLATED="/var/www/htdocs/index.cgi"

Same request with:
<Location /sympa>
    ProxyPass "fcgi://localhost"
</Location>
The env is now:
REQUEST_URI="/sympa/index.cgi"
DOCUMENT_ROOT="/var/www/htdocs"
SCRIPT_FILENAME="proxy:fcgi://localhost/index.cgi"
SCRIPT_NAME="/sympa/index.cgi"
(note no PATH_INFO nor PATH_TRANSLATED)

To get the same env as with SetHandler, I thought something like "SetEnvIf
Request_URI ^ proxy-fcgi-pathinfo=full" would do but I also need this patch
then:
Index: modules/proxy/mod_proxy_fcgi.c
===================================================================
--- modules/proxy/mod_proxy_fcgi.c      (revision 1919533)
+++ modules/proxy/mod_proxy_fcgi.c      (working copy)
@@ -348,10 +348,11 @@ static apr_status_t send_environment(proxy_conn_re
     fcgi_req_config_t *rconf = ap_get_module_config(r->request_config,
&proxy_fcgi_module);
     fcgi_dirconf_t *dconf = ap_get_module_config(r->per_dir_config,
&proxy_fcgi_module);

-    if (rconf) {
-       if (rconf->need_dirwalk) {
-          ap_directory_walk(r);
-       }
+    if (rconf && rconf->need_dirwalk) {
+        char *saved_filename = r->filename;
+        r->filename = r->uri;
+        ap_directory_walk(r);
+        r->filename = saved_filename;
     }

     /* Strip proxy: prefixes */
--
Otherwise I get nonsensical things like:
PATH_INFO="/localhost/index.cgi"
PATH_TRANSLATED="/var/www/htdocs/localhost/index.cgi"

So I think that mod_proxy_fcgi is mostly used with SetHandler at this point, or
that each backend/app has its own workarounds to keep the pieces?
It's then quite hard to change anything without breaking someone somewhere.

I'm not a CGI expert, it would be nice at least to know what is actually
expected for those env vars, and what (and how it) is actually worked around
eventually.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

Sylvain Beucler <be...@beuc.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |beuc@beuc.net

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

Matthew Goebel <mg...@emich.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Matthew Goebel <mg...@emich.edu> ---


Suggested fix worked.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

--- Comment #2 from Matthew Goebel <mg...@emich.edu> ---
Ah, 

changing that stanza to 

<Location /sympa>
    SetHandler "proxy:unix:/var/run/wwsympa.socket|fcgi://localhost"
    Require all granted
</Location>

does indeed appear to fix the issue.

I will try to follow up with the sympa email documentation and see if they
still need to update their documentation.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

Sylvain Beucler <be...@beuc.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #5 from Sylvain Beucler <be...@beuc.net> ---
Hello.

AFAICS the 2.4.62 fix doesn't appear to address the issue.
The configuration validates, but when accessing the URL, it still returns a Bad
Request, with log:
[proxy_fcgi:error] [pid 83409:tid 83426] [client 127.0.0.1:47566] AH01059:
error parsing URL //: Invalid host/port

<Location /sympa>
    SetHandler "proxy:unix:/var/run/wwsympa.socket|fcgi://"
</Location>

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

--- Comment #6 from Yann Ylavic <yl...@gmail.com> ---
Created attachment 39824
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39824&action=edit
Fix for SetHandler in <Location>

So r1919015 backported to 2.4.62 was incomplete regarding SetHandler
"proxy:..." in a <Location "/path"> block, where "$DOCUMENT_ROOT/path" gets
appended to r->filename (this "SetHandler proxy:..." is really a wart on how
mod_proxy is supposed to work, i.e. by using ProxyPass..).
Anyway it should now work with this patch, please test.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

--- Comment #8 from Sylvain Beucler <be...@beuc.net> ---
This appears to work fine on my end (no need to append something after fcgi://
anymore), thanks! :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 69160] Tried to upgrade from 2.4.59 to 2.4.60 and found fcgi stopped working correctly

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69160

Yann Ylavic <yl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|FixedInTrunk                |
          Component|mod_fcgid                   |mod_proxy_fcgi

--- Comment #7 from Yann Ylavic <yl...@gmail.com> ---
Checked in r1919532

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org