Bug 914781 - AgentUpdateServlet - Failed to stream agent jar - No hostname provided in error
Summary: AgentUpdateServlet - Failed to stream agent jar - No hostname provided in error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Communications Subsystem
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHQ 4.9
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-22 18:28 UTC by Elias Ross
Modified: 2014-03-26 08:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-26 08:31:15 UTC
Embargoed:


Attachments (Terms of Use)

Description Elias Ross 2013-02-22 18:28:05 UTC
2013-02-22 18:23:11,244 ERROR [org.rhq.enterprise.gui.agentupdate.AgentUpdateServlet] Failed to stream agent jar.
java.lang.RuntimeException: Stream data cannot be copied
        at org.rhq.core.util.stream.StreamUtil.copy(StreamUtil.java:265)
        at org.rhq.core.util.stream.StreamUtil.copy(StreamUtil.java:212)
        at org.rhq.enterprise.gui.agentupdate.AgentUpdateServlet.getDownload(AgentUpdateServlet.java:140)
        at org.rhq.enterprise.gui.agentupdate.AgentUpdateServlet.doGet(AgentUpdateServlet.java:103)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
...
Caused by: ClientAbortException:  java.net.SocketException: Connection reset
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:354)
        at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
        at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
        at org.rhq.core.util.stream.StreamUtil.copy(StreamUtil.java:258)
        ... 59 more
Caused by: java.net.SocketException: Connection reset

Would be nice to see which host connected since I can't tell which host is having a hard time updating. It also fills the logs with a lot of stack traces.

Comment 1 John Mazzitelli 2013-07-01 12:53:20 UTC
IIRC, this error might be a minor annoyance and isn't really an error. I *think* this happens simply when the agent disconnects after downloading the update jar successfully. I remember looking at this a while ago and not seeing any simple cause (or fix) to this. I'll double check it again to see if we can eliminate dumping this error or at least making it less ominous sounding. If it is an error, I'll see if I can figure out if the server knows which remote endpoint is downloading.

Comment 2 John Mazzitelli 2013-07-01 20:26:19 UTC
git commit 914781

This commit simply logs the remote address of the client making the request to retrieve the agent download jar. This also no longer logs the full stack, but does log the full exception error messages.

Here's the code this commit uses to retrieve the remote client address:

    private String getClientAddress(HttpServletRequest request) {
        String ip = request.getHeader("X-Forwarded-For");
        if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
            ip = request.getHeader("HTTP_X_FORWARDED_FOR");
            if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
                ip = String.format("%s (%s)", request.getRemoteHost(), request.getRemoteAddr());
            }
        }
        return ip;
    }

Comment 3 John Mazzitelli 2013-07-01 20:27:17 UTC
(In reply to John Mazzitelli from comment #2)
> git commit 914781

the commit hash is wrong in the last comment, the git commit has is really:

c8b2a83

Comment 4 Heiko W. Rupp 2014-03-26 08:31:15 UTC
Bulk closing now that 4.10 is out.

If you think an issue is not resolved, please open a new BZ and link to the existing one.


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