Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected server response (0) while retrieving pdf #7993

Closed
jcool141 opened this issue Jan 25, 2017 · 7 comments
Closed

Unexpected server response (0) while retrieving pdf #7993

jcool141 opened this issue Jan 25, 2017 · 7 comments

Comments

@jcool141
Copy link

We are specifically getting this error when using Amazon ec2 instance. Configuration on aws instance is Tomcat 7, Ubuntu 16.04 and memory is 8gb. It occurs when the user tries to view pdf file. In our application, we are having one functionality where the user can only view PDF file onto browser, but won't be able to download it. PDF file is on the same server. We are using cors minimal configuration. We have tried it locally with Ubuntu and it is working fine.

Code snippet:

var fileSplitContent = fileName.split(".");
if ($('#viewImageOnlyForm')[0] != undefined && $('#viewPdfOnlyForm')[0] != undefined) {
if (fileSplitContent[fileSplitContent.length - 1].toLowerCase() != "pdf") {
$('#imageSource').val(requestURL + $.param(inputData));
$('#viewImageOnlyForm').submit();
} else {
var requestURL = "rest/file/getCapitalRaiseFile?";
$('#pdFSource').val(requestURL + $.param(inputData));
$('#viewPdfOnlyForm').submit();
}
} else {
// pop up download attachment dialog box
downloadIFrame.attr("src", requestURL + $.param(inputData));
}

}

Errors on catalina.out:
Jan 04, 2017 5:07:31 AM org.glassfish.jersey.server.ServerRuntime$Responder writeResponse SEVERE: An I/O error has occurred while writing a response message entity to the container output stream. org.glassfish.jersey.server.internal.process.MappableException: org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Connection reset
Caused by: org.apache.catalina.connector.ClientAbortException: java.net.SocketException: Broken pipe (Write failed)

This is issue is not occurring on Firefox Mozilla and some times working in chrome too. We have used PDFJS.version = '1.1.469' , and PDFJS.build = 'f06aa6a'. Is there any specif version of pdf.jd for chrome or else any changes we need to do in our pdf.js.

Everything is working fine on older versions of Mozilla Firefox when we use amazons own Linux on their instance. But nothing is working when we use ubuntu on amazon instance.

Images related to issue

1)Error on chrome browser:
https://cloud.githubusercontent.com/assets/25339020/22279768/b7467592-e2f2-11e6-87c0-aa7c9ca0ca0b.png)

  1. Error shown on chrome console: https://cloud.githubusercontent.com/assets/25339020/22279796/e8f91932-e2f2-11e6-808f-488061d8ec17.png
@jcool141
Copy link
Author

jcool141 commented Jan 25, 2017

@gjuggler: Hi......do you any idea about this problem?

@jcool141
Copy link
Author

@dravix :Hi...is it also related to rendering with chrome browser.....specifically for the pdf.js mozilla native.

@Rob--W
Copy link
Member

Rob--W commented Jan 26, 2017

This looks like a problem with your server (500 Internal Server error).
We need more information to debug this. Can you follow the following steps:

  1. Visit chrome://net-internals
  2. Do your thing to get the error
  3. Click on "Save to file" at the tab from step 1.
  4. Attach the file here, or mail it to me (see my profile for my e-mail address).

@timvandermeij
Copy link
Contributor

You cannot add attachments here using e-mail. You either have to upload them here directly using the GitHub website or just e-mail them directly to @Rob--W.

@Rob--W
Copy link
Member

Rob--W commented Feb 1, 2017

@jcool141 In the log file you sent me, I see that the connection is immediately reset when PDF.js attempts to load the PDF file, before any response is received (not even response headers).
In your initial report, you are mentioning a "500 internal server error" response (in the screenshot), which does however not appear in the log.

Can you send me the log that includes this 500 internal server error?
If that does not work, create a packet capture (e.g. with Wireshark) and send me the pcap file for further analysis.

@timvandermeij
Copy link
Contributor

Closing for now. This does not appear to be a PDF.js problem, but rather a server configuration issue. If after debugging it turns out that there is something we can do in PDF.js, please open a new issue with as much details as possible. Thanks.

@bahattin0571
Copy link

I had a similar problem. The problem is solved when I disable the "Xtreme Download Manager" application extension I have installed on Chorome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants