-
Notifications
You must be signed in to change notification settings - Fork 100
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
Intermittent 500s #28
Comments
Another one:
|
Another; the error is slightly different in this one.
|
Are you using the pubic instance or your own instance? |
Public. |
Maybe I'll see if I can reproduce on a self-hosted instance. |
Hmmm. Maybe it's a bug in my Python code (I'm writing a Python client for Docverter), because I can't reproduce with HTTPie.
Though it seems to me like those temp file errors are happening on the server, because the filenames don't match the temp file filenames that my program is using. |
Hm. The only time the server makes a new filename is when it's encrypting a PDF. The rest of the time it's working with the given filenames in a tempdir. |
Maybe those temp files are being created by the web server and then being passed into the Ruby code? |
For both https://github.com/Docverter/docverter/blob/master/lib/docverter-server/app.rb#L20-L27 We have to do this because your input files are going to refer each other and to things in |
Still trying to debug the intermittent failures (Docverter/docverter#28)
Hmmm. IIRC from my PHP days, sometimes the web server or the platform will keep uploaded files in memory (especially if the files are small and mine are) and not always write them to a temp file on the disk. |
It doesn't really matter. The Also, in almost three years of development this is the first time someone has mentioned a bug like this, which makes me think the problem is not necessarily in Docverter. It may be a weird combination of edge cases, though. |
Yeah, this is weird. I have not seen it yet with HTTPie and it is sporadic when running my Python test suite. I have gotten it to happen a few times when running the tests locally, though it seems anecdotally to happen more when running tests on Travis CI. But it's not exclusive to Travis CI. |
Here's a dump of the HTTP request for a recent failure: POST http://c.docverter.com/convert
Content-Length: 345
Content-Type: multipart/form-data; boundary=03377687359d44d78a5e88a807d085aa
--03377687359d44d78a5e88a807d085aa
Content-Disposition: form-data; name="from"
markdown
--03377687359d44d78a5e88a807d085aa
Content-Disposition: form-data; name="to"
rst
--03377687359d44d78a5e88a807d085aa
Content-Disposition: form-data; name="input_files[]"; filename="tmpCg8ugv"
#some title
--03377687359d44d78a5e88a807d085aa-- The response was a 500 with:
Interesting - for this one - the error is with the output file (note the |
Thank you for the dump. I'm seeing occasional Heroku errors in the logs, but it doesn't look like they're related to this problem. I'll dig into it when I have time. |
Cool and thank you for creating Docverter! I was about to embark on something similar and then I found this. Pretty exited about it! Thank you for sharing it with the world! |
Here's a full request and response from Wireshark for when you get a chance to look into this: POST /convert HTTP/1.1
Host: c.docverter.com
Accept-Encoding: identity
Content-Length: 345
Content-Type: multipart/form-data; boundary=72cc0e21ba084ae487aa61ea147bf1b7
--72cc0e21ba084ae487aa61ea147bf1b7
Content-Disposition: form-data; name="to"
rst
--72cc0e21ba084ae487aa61ea147bf1b7
Content-Disposition: form-data; name="from"
markdown
--72cc0e21ba084ae487aa61ea147bf1b7
Content-Disposition: form-data; name="input_files[]"; filename="tmpkZmEM6"
#some title
--72cc0e21ba084ae487aa61ea147bf1b7--
HTTP/1.1 500 Server Error
Server: Cowboy
Date: Mon, 02 Feb 2015 17:21:29 GMT
Connection: close
Content-Type: application/json
Via: 1.1 vegur
{"error":"No such file or directory - /tmp/d20150202-3-13s56rr/output.b4a5a6e75446083707f4.rst"} |
I am wondering if we are running into an issue with In https://github.com/Docverter/docverter/blob/master/lib/docverter-server/runner/base.rb#L23: IO.popen(cmd) do |io|
output = io.read
end Perhaps this completes without |
Hoping that this fixes intermittent 500 errors due to inability to open temp files, as seen in Docverter#28.
Hoping that this fixes intermittent 500 errors due to inability to open temp files, as seen in Docverter#28.
#30 is a stab at hacking around this problem. |
Any luck reproducing this on your end? |
I pushed your change to the demo server. Are you still seeing this error? On Thu, Feb 12, 2015 at 11:08 AM, Marc Abramowitz [email protected]
|
Unfortunately yes. I just ran a Travis CI job and it failed again. https://travis-ci.org/msabramo/pydocverter/builds/49901313 I also got one of these while running tests on my laptop:
|
I wonder if you're seeing the results of this statement in your server logs: puts "Failed to open #{output_file}; num_tries = #{num_tries}" ? |
I ran into this as well. The problem is |
Sometimes the same call succeeds and sometimes it returns a 500 error that looks like this:
The text was updated successfully, but these errors were encountered: