The server logs are rather terse. They only contain startup/shutdown messages and a very old pair of errors:
The client could not delete the temporary file /tmp/hydrustEbZFt
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 1203, in mainLoop
self.runUntilCurrent()
File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 798, in runUntilCurrent
f(*a, **kw)
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 393, in callback
self._startRunCallbacks(result)
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 588, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/opt/hydrus/include/HydrusServerResources.py", line 307, in _callbackRenderResponseContext
if do_finish: request.finish()
File "/usr/lib/python2.7/site-packages/twisted/web/server.py", line 228, in finish
return http.Request.finish(self)
File "/usr/lib/python2.7/site-packages/twisted/web/http.py", line 926, in finish
"Request.finish called on a request after its connection was lost; "
exceptions.RuntimeError: Request.finish called on a request after its connection was lost; use Request.notifyFinish to keep track of this.
/usr/lib/python2.7/site-packages/PIL/Image.py:2221: DecompressionBombWarning: Image size (90510000 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.
DecompressionBombWarning)
ERROR: invalid element ID with leading byte 0x0
ERROR: invalid element ID with leading byte 0x0
This is the server.log, but it says "the client could not delete…." – I suspect that's an oversight in error handling. As for the decompression bomb, who knows but it seems legit.
I restarted it and opened it in a terminal, and this is part of what it printed (not logged):
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 1203, in mainLoop
self.runUntilCurrent()
File "/usr/lib/python2.7/site-packages/twisted/internet/base.py", line 825, in runUntilCurrent
call.func(*call.args, **call.kw)
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 393, in callback
self._startRunCallbacks(result)
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
self._runCallbacks()
--- <exception caught here> ---
File "/usr/lib/python2.7/site-packages/twisted/internet/defer.py", line 588, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/opt/hydrus/include/HydrusServerResources.py", line 414, in _errbackHandleEmergencyError
self._CleanUpTempFile( request )
File "/opt/hydrus/include/HydrusServerResources.py", line 494, in _CleanUpTempFile
HydrusFileHandling.CleanUpTempPath( os_file_handle, temp_path )
File "/opt/hydrus/include/HydrusFileHandling.py", line 53, in CleanUpTempPath
os.close( os_file_handle )
exceptions.OSError: [Errno 9] Bad file descriptor
I suspect that might have something to do with it. Also you should probably be using file objects rather than file descriptors, I suspect they will have more graceful failure handling
Ironically, that error seems to have stopped Hydrus from reaching:
print( failure.getTraceback() )
in _errbackHandleEmergencyError. So I suspect the real error is being masked by this weird file descriptor issue.
For now I'm going to patch that function to read like this:
def _errbackHandleEmergencyError( self, failure, request ):
try:
self._CleanUpTempFile( request )
finally:
print( failure.getTraceback() )
try: request.write( failure.getTraceback() )
except: pass
try: request.finish()
except: pass
Not perfect but maybe it'll give me a better idea of what's going on. I'll update you if this comes up with anything interesting.
Strangely, I seem to be able to upload from my local machine (the one I'm hosting on) and I am 100% sure that a successful connection is being made to the hydrus server when >>987 is trying to upload to it.
I have a reasonable knowledge of Python, so if you have any more functions or areas you'd like to see some debug prints in, tell me and I'll try them out.