Issue Details (XML | Word | Printable)

Key: HUDSON-5753
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Unassigned
Reporter: rombert
Votes: 1
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Hudson

Standalone install does not work with Apache + mod_proxy_ajp + SSL

Created: 24/Feb/10 02:27 PM   Updated: 19/Aug/10 06:24 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Environment:
CentOS release 5.4 (Final)
2.6.18-164.10.1.el5xen (64 bit)
java version "1.6.0_16"
hudson-1.347-1.1
httpd-2.2.3-31.el5.centos.2


 Description  « Hide

I've configured hudson to only use the ajp connector using a command line similar to

/usr/lib/jvm/java-1.6.0/bin/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -Xmx64m -DHUDSON_HOME=/space/hudson -jar /usr/lib/hudson/hudson.war --logfile=/var/log/hudson/hudson.log --daemon --prefix=hudson --httpPort=-1 --ajp13Port=8109 --debug=5 --handlerCountMax=10 --handlerCountMaxIdle=0

I'm using the following apache configuration file

    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    ProxyPass /hudson ajp://localhost:8109/hudson retry=1
    ProxyPassReverse /hudson ajp://localhost:8109/hudson

When accessing https://host/hudson , I get a 503 error page from Apache. The apache logs contain:

[Wed Feb 24 23:58:04 2010] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Feb 24 23:58:04 2010] [error] (120006)APR does not understand this error code: proxy: read response failed from (null) (localhost)

while the winstone logs contain:

[Winstone 2010/02/24 23:58:04] - Error within request handler thread
java.lang.StringIndexOutOfBoundsException: String index out of range: 1065
        at java.lang.String.checkBounds(String.java:401)
        at java.lang.String.<init>(String.java:442)
        at winstone.ajp13.Ajp13IncomingPacket.readString(Ajp13IncomingPacket.java:275)
        at winstone.ajp13.Ajp13IncomingPacket.parsePacket(Ajp13IncomingPacket.java:189)
        at winstone.ajp13.Ajp13Listener.allocateRequestResponse(Ajp13Listener.java:179)
        at winstone.RequestHandlerThread.run(RequestHandlerThread.java:79)
        at java.lang.Thread.run(Thread.java:619)

It's worth mentioning that this was working with Tomcat 6.0.20 , but stopped working when I tried to move over to the standalone install.

I've tried various combinations with or without prefix, and the only one which seems to work is ajp without any prefix.



Sort Order: Ascending order - Click to sort in descending order
mka2 added a comment - 24/Feb/10 03:06 PM

The AJP connector of the Winstone servlet container is broken. This bug has been reported in Winstone's bug tracker:

Problem with AJP running behind Apache 2.2 mod_proxy - ID: 2895779

Error within request handler thread, Ajp13Listener.ShortPac - ID: 2823683

The workaround is to use a "real" servlet container like Tomcat or Jetty, they have working AJP connectors.


rombert added a comment - 24/Feb/10 03:22 PM

Thanks for the information. I'll try to use the HTTP connector then, since the rpm is much more convenient than the war download.


scm_issue_link added a comment - 02/Jun/10 11:34 AM

Code changed in hudson
User: : kohsuke
Path:
trunk/hudson/main/war/pom.xml
trunk/www/changelog.html
http://hudson-ci.org/commit/31635
Log:
[FIXED HUDSON-5753] Integrated winstone 0.9.10-hudson-20 to fix the AJP parsing problem.


lbeuster added a comment - 09/Jun/10 06:55 AM - edited

hmm, still doesn't work for me with Apache 1.2.14 mod_proxy/mod_rewrite + Hudson 1.361:

Hudson:
-----------------------------

[Winstone 2010/06/09 15:30:29] - Error within request handler thread
java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:180)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at winstone.ajp13.Ajp13IncomingPacket.readString(Ajp13IncomingPacket.java:237)
at winstone.ajp13.Ajp13IncomingPacket.readString(Ajp13IncomingPacket.java:224)
at winstone.ajp13.Ajp13IncomingPacket.parsePacket(Ajp13IncomingPacket.java:161)
at winstone.ajp13.Ajp13Listener.allocateRequestResponse(Ajp13Listener.java:179)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:79)
at java.lang.Thread.run(Thread.java:619)

Apache:
-------------------
[Wed Jun 09 15:30:29 2010] [error] (70014)End of file found: ajp_ilink_receive() can't receive header
[Wed Jun 09 15:30:29 2010] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Jun 09 15:30:29 2010] [error] (120006)APR does not understand this error code: proxy: read response failed from (null)

Another workaround that works wirh Hudson standalone is mod_jk instead of mod_proxy.

Regards
Lars


acdha added a comment - 23/Jul/10 01:32 PM

This is definitely still broken. Just reproduced using the latest 1.367 .deb on Ubuntu 10.04 with this config:

ProxyRequests Off
ProxyPass /hudson ajp://127.0.0.1:8102/hudson
ProxyPassReverse /hudson ajp://127.0.0.1:8102/hudson

Example log output:

[Fri Jul 23 14:57:44 2010] [error] ajp_read_header: ajp_ilink_receive failed
[Fri Jul 23 14:57:44 2010] [error] (120006)APR does not understand this error code: proxy: read response failed from (null) (127.0.0.1)


rdesgroppes added a comment - 19/Aug/10 06:24 AM

Similar error:
Thu Aug 19 15:02:02 2010] [notice] Apache/2.2.14 (Ubuntu) DAV/2 SVN/1.6.6 proxy_html/3.0.1 mod_python/3.3.1 Python/2.6.5 mod_ssl/2.2.14 OpenSSL/0.9.8k configured – resuming normal operations
[Thu Aug 19 15:02:06 2010] [error] (70014)End of file found: ajp_ilink_receive() can't receive header
[Thu Aug 19 15:02:06 2010] [error] ajp_read_header: ajp_ilink_receive failed