Bug #631
closedPROPFIND status code not propogated in proxy
Description
I have lighttpd 1.4.11 proxying to Apache 2.0.51 for Subversion. I followed the directions here: https://trac.lighttpd.net/trac/wiki/ApacheSubversionRecipe
Browsing, checkouts, and commiting modifications all work. Adding files does not. It appears that when the PROPFIND request hits Apache it returns 404 (makes sense, the file isn't there yet), but lighttpd returns 200 to the client (I'm guessing that the client becomes confused, expecting a 404 for a file it has yet to add). All other WebDAV/DeltaV requests seem to return the correct httpd status code. Here are some transcripts from the logs. The problem is the last PROPFIND (second to last line).
lighttpd log¶
192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "OPTIONS /svn/tools HTTP/1.1" 200 183 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "MKACTIVITY /svn/!svn/act/92a71b49-c612-0410-8646-92b125d912e5 HTTP/1.1" 201 303 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "PROPFIND /svn/tools HTTP/1.1" 207 428 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "PROPFIND /svn/!svn/vcc/default HTTP/1.1" 207 389 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "CHECKOUT /svn/!svn/bln/71 HTTP/1.1" 201 318 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "PROPPATCH /svn/!svn/wbl/92a71b49-c612-0410-8646-92b125d912e5/71 HTTP/1.1" 207 349 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "PROPFIND /svn/tools HTTP/1.1" 207 385 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "CHECKOUT /svn/!svn/ver/25/tools HTTP/1.1" 201 321 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:46 -0700] "PROPFIND /svn/tools/test.txt HTTP/1.1" 200 295 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 192.168.1.1 example.com - [01/May/2006:21:05:47 -0700] "DELETE /svn/!svn/act/92a71b49-c612-0410-8646-92b125d912e5 HTTP/1.1" 204 0 "-" "SVN/1.3.0 (r17949) neon/0.25.4"
Notice that the last PROPFIND has a status of 200.
apache log¶
127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "OPTIONS /svn/tools HTTP/1.0" 200 183 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "MKACTIVITY /svn/!svn/act/92a71b49-c612-0410-8646-92b125d912e5 HTTP/1.0" 201 303 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "PROPFIND /svn/tools HTTP/1.0" 207 428 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "PROPFIND /svn/!svn/vcc/default HTTP/1.0" 207 389 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "CHECKOUT /svn/!svn/bln/71 HTTP/1.0" 201 318 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "PROPPATCH /svn/!svn/wbl/92a71b49-c612-0410-8646-92b125d912e5/71 HTTP/1.0" 207 349 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "PROPFIND /svn/tools HTTP/1.0" 207 385 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "CHECKOUT /svn/!svn/ver/25/tools HTTP/1.0" 201 321 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:46 -0700] "PROPFIND /svn/tools/test.txt HTTP/1.0" 404 295 "-" "SVN/1.3.0 (r17949) neon/0.25.4" 127.0.0.1 - tim [01/May/2006:21:05:47 -0700] "DELETE /svn/!svn/act/92a71b49-c612-0410-8646-92b125d912e5 HTTP/1.0" 204 - "-" "SVN/1.3.0 (r17949) neon/0.25.4"
Notice that the last PROPFIND has a status of 404.
-- timpub
Files
Updated by Anonymous about 18 years ago
I am also experiencing this issue. I have verified that the issue exists on lighttpd 1.4.11 through 1.4.13.
-- bmitchell
Updated by Anonymous over 17 years ago
It works now with 1.4.13-r1 on Gentoo (I was running 1.4.11).
Updated by Anonymous over 17 years ago
The same problem here - debian etch, lighttpd v 1.4.13-4, which is 1.4.13 with a few modifications to the init.d-file and default configs.
Any news on this? If gentoo has a working patch, where can I find it?
-- lukas
Updated by jan over 17 years ago
- Status changed from New to Assigned
Can someone please attach a strace which shows the issue in lighttpd ? See the wiki on how to report a bug.
Updated by Anonymous over 17 years ago
See lines 296 and 302 in the trace. lighttpd reads "HTTP/1.1 404 ...", but sends "HTTP/1.1 200 OK...", and encapsulates the 404 html-document into that ...
Hope this helps.
-- Lukas <lukas
Updated by Anonymous over 17 years ago
Any news on this front? Anything I can do about it? If it works now in Gentoo, I'd really like to see that patch, but I don't have gentoo here and can't seem to find 1.4.13-r1 ...
-- lukas
Updated by darix over 17 years ago
there is no mod_proxy related patch in gentoo. so i would really wonder what is not working for you. and a friend of mine successfully proxies svn through lighttpd.
Updated by Anonymous over 17 years ago
I do proxy svn, and it works. What's not working is adding new files to the repository. Please read the bugreport as it contains all information necessary to reproduce that bug ...
-- lukas
Updated by Anonymous about 17 years ago
Just a note that this bug is still valid for lighttpd 1.4.17. If there's anything I can do about it, I'd be happy to help. Increased severity to major as this renders an 'svn add; svn ci' unfunctional.
-- lukas at einfachkaffee de
Updated by Anonymous almost 17 years ago
Just ran into this - what a pain! I guess I'll just have to open a port to apache instead. :(
-- dobesv
Updated by stbuehler over 16 years ago
2007-04-11 00:43:12: (connections.c.816) missing cleanup in scgi
This cleanup failure is triggered if the scgi module tried handling the request but another module handled it afterwards too. (So i bet you loaded mod_scgi before mod_proxy in your module list)
So i just think both mod_scgi and mod_proxy tried handling the request (which of course they should not, so it is a bug in lighty).
But you should be able to workaround it with disabling mod_scgi if you want mod_proxy.
Updated by Anonymous over 16 years ago
I hesitated using Lighty for proxying svn requests to Apache because of this ticket; now I tried it anyways, and strangely, it works just fine (even adding files). For your information, I am using stock binaries from Debian Etch:
Lighttpd 1.4.13
Apache 2.2.3
Svn 1.4.2
Lighttpd is hosting Trac via mod_fastcgi.
Hope this helps.
-- Alex
Updated by georgexsh over 16 years ago
1.4.18 has the same problem.
I am using ssl with lighttpd.
Updated by Anonymous over 16 years ago
I have the same problem here with
Debian Etch binary package revision: 1.4.13-4etch6
Updated to the following version (Etch Backports):
lighttpd-1.4.19 (ssl) - a light and fast webserver
Build-Date: Mar 19 2008 23:49:19
But the problem still exists.
Problem seems to be:
* HTTP-Requests with Method "PROPFIND" are rejected/not correctly forwarded by lighttpd to apache. * apache itself never receives the HTTP-Request (not even tcpdump could detect network traffic)
The Bug is either in mod_proxy or lighttpd's HTTP-Parser. Maybe the parser is hardcoded to accept only "GET" and "POST" and rejects all the others.
But as I could find the requests log file of lighttpd, it seems to be a bug behind the HTTP-Parser inside the workflow...
Maybe it helps to know the active lighttpd modules:
"mod_access" "mod_alias" "mod_accesslog" "mod_rewrite" "mod_auth" "mod_fastcgi" "mod_proxy"
-- sdwarfs
Updated by stbuehler over 16 years ago
- Status changed from Assigned to Fixed
- Resolution set to fixed
I tried fixing it in r2271 :)
So now it would be nice if you could test it, thx.
Updated by mafo almost 14 years ago
- Status changed from Fixed to Reopened
- Target version changed from 1.4.20 to 1.4.x
It's still not workink on
Debian squeeze from distro
root@web:~# lighttpd -v
lighttpd/1.4.28 (ssl) - a light and fast webserver
Build-Date: Aug 30 2010 19:55:34
PROPFIND /git/admin24/ HTTP/1.1
User-Agent: git/1.7.1
Host: git.admin24.cz
Accept: */*
Depth: 0
Content-Type: text/xml
Content-Length: 164
Expect: 100-continue
HTTP/1.1 417 Expectation Failed
Content-Type: text/html
Content-Length: 363
Connection: close
Date: Sat, 05 Feb 2011 16:31:57 GMT
Server: lighttpd/1.4.28
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>417 - Expectation Failed</title>
</head>
<body>
<h1>417 - Expectation Failed</h1>
</body>
</html>
Updated by gstrauss over 8 years ago
Let's sort this one out!
@mafo: your issue is unrelated to the rest. Please set in your config:
server.reject-expect-100-with-417 = "disable"
For everyone else, some have posted that it works for them, and some have posted that it does not. Please attach your lighttpd.conf with a name like broken-lighttpd.conf or works-lighttpd.conf and the version of lighttpd you are using. Thanks.
I walked through 1.4.39 code and nothing immediately jumped out at me which might change http_status from the 404 received from the backend since con->mode remains not DIRECT, and so any error handlers should not touch the response either.
Time allowing, I'll try to set up my own environment to test this, using https://redmine.lighttpd.net/projects/lighttpd/wiki/ApacheSubversionRecipe
Updated by gstrauss over 8 years ago
Please mark this ticket fixed. I believe it was fixed in r2271. @mafo's issue is a config issue and is unrelated.
Updated by stbuehler over 7 years ago Status changed from Assigned to Fixed Resolution set to fixed Comment I tried fixing it in r2271 :) So now it would be nice if you could test it, thx.
Updated by gstrauss over 8 years ago
Submitted pull request https://github.com/lighttpd/lighttpd1.4/pull/38
While r2271 fixed the issue of multiple handlers incorrectly touching a request, I detected a new issue when testing. svn will send an OPTIONS request with request body using Transfer-Encoding: chunked. lighttpd did not detect the presence of request input body, and would proxy the request as-is to the backend Apache, and the backend Apache would time-out after 20 seconds waiting for the request body.
https://github.com/lighttpd/lighttpd1.4/pull/38 detects presence of Transfer-Encoding: chunked on request input and returns 411 Length Required, which causes svn to resend the request with Content-Length, and then the request is successfully relayed to the backend Apache.
Updated by stbuehler over 8 years ago
- Description updated (diff)
- Target version changed from 1.4.x to 1.4.40
Updated by stbuehler over 8 years ago
- Status changed from Reopened to Fixed
- % Done changed from 0 to 100
Applied in changeset r3128.
Also available in: Atom