#39 Problem with AJP running behind Apache 2.2 mod_proxy

open
nobody
None
5
2014-04-02
2009-11-11
Kariem
No

I have encountered the following issue when trying to run Winstone behind Apache 2.2 with mod_proxy enabled:
- Apache shows an internal server error (500)
- log files show the following error message

### start
Error within request handler thread
java.lang.StringIndexOutOfBoundsException: String index out of range: 1230
at java.lang.String.checkBounds(String.java:401)
at java.lang.String.<init>(String.java:442)
at winstone.ajp13.Ajp13IncomingPacket.readString(Ajp13IncomingPacket.java:278)
at winstone.ajp13.Ajp13IncomingPacket.parsePacket(Ajp13IncomingPacket.java:192)
at winstone.ajp13.Ajp13Listener.allocateRequestResponse(Ajp13Listener.java:178)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:79)
at java.lang.Thread.run(Thread.java:619)
### end

The setup is intended to proxy Hudson through AJP behind an Apache running HTTPs. A related issue was also reported on the hudson mailing list [1], but I have not found any associated bug here, or additional information there.

Winstone parameters (as run in the hudson.war):
--webroot=/var/run/hudson/war
--httpPort=-1
--ajp13Port=8102
--ajp13ListenAddress=127.0.0.1
--prefix=/hudson

Apache configuration snippet to proxy requests
### start
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /hudson ajp://127.0.0.1:8102/hudson
ProxyPassReverse /hudson ajp://127.0.0.1:8102/hudson
### end

Is this a known issue? What can be done.

Thank you,
Kariem

P.S.: Please excuse me, if this question has already been asked. The bug tracker is not really searchable.

[1] http://n4.nabble.com/Hudson-behind-Apache-with-AJP13-td380444.html

Discussion

  • Conny Kreyßel
    Conny Kreyßel
    2009-12-23

    Hello,

    i also run into this error. Can you please explain any workaround or cause of error?

    Thanks.

     
  • Mike Stoddart
    Mike Stoddart
    2010-01-12

    Same here: Fedora 10 using the latest Hudson.

    [Winstone 2010/01/12 08:14:17] - Error within request handler thread
    java.lang.StringIndexOutOfBoundsException: String index out of range: 1781
    at java.lang.String.checkBounds(String.java:409)
    at java.lang.String.<init>(String.java:450)
    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:636)

    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy ajp://localhost:8102/hudson*>
    Order deny,allow
    Allow from all
    </Proxy>

    ProxyPass /hudson ajp://localhost:8102/hudson
    ProxyPassReverse /hudson ajp://localhost:8102/hudson

    <Location /hudson/>
    AuthType Basic
    AuthName "Authorized Zone"
    AuthUserFile /srv/conf/htpasswd
    Require group trac-user
    AuthGroupFile /srv/conf/support.group
    </Location>

     
  • caefer
    caefer
    2010-01-18

    Same here using the latest stable Hudson on an up-to-date Gentoo Linux