haiwen / seafile

High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
http://seafile.com/
Other
12.25k stars 1.54k forks source link

seafile 3.1.6 pro doesn't convert documents for preview #870

Closed khorkin closed 8 years ago

khorkin commented 10 years ago

Hi, I have "Internal server error" when trying preview a document (.xls(x), .doc(x), .pdf, opendocument. In seafevents.log only such messages: for 3.1.6

[2014-09-25 10:55:45,814] [DEBUG] seafes enabled: False
[2014-09-25 10:55:45,814] [DEBUG] seahub email enabled: True
[2014-09-25 10:55:45,814] [DEBUG] seahub dir: /srv/seafile/seafile-pro-server-3.1.6/seahub
[2014-09-25 10:55:45,814] [DEBUG] send seahub email interval: 1800 sec
[2014-09-25 10:55:45,815] [DEBUG] office enabled: True
[2014-09-25 10:55:45,815] [DEBUG] office convert workers: 3
[2014-09-25 10:55:45,815] [DEBUG] office outputdir: /tmp/seafile-office-output
[2014-09-25 10:55:45,815] [DEBUG] office convert max pages: 50
[2014-09-25 10:55:45,815] [DEBUG] office convert max size: 5 MB
[2014-09-25 10:55:45,816] [INFO] [seafevents] database: mysql, name: seahub
[2014-09-25 10:55:45,824] [INFO] try to connect to ccnet-server...
[2014-09-25 10:55:45,824] [INFO] connected to ccnet server
[2014-09-25 10:55:45,825] [INFO] listen to mq: set(['seaf_server.event', 'seahub.stats'])
[2014-09-25 10:55:45,826] [INFO] staring background tasks
[2014-09-25 10:55:45,826] [INFO] search indexer is disabled
[2014-09-25 10:55:45,826] [INFO] seahub email sender is started, interval = 1800 sec
[2014-09-25 10:55:45,827] [INFO] stop libreoffice...
[2014-09-25 10:55:45,827] [INFO] remove pidfile /srv/seafile/pids/seafevents.pid

for 3.1.3

[2014-09-11 09:33:54,182] [INFO] [seafevents] database: mysql, name: seahub
[2014-09-11 09:33:54,190] [INFO] try to connect to ccnet-server...
[2014-09-11 09:33:54,190] [INFO] connected to ccnet server
[2014-09-11 09:33:54,192] [INFO] listen to mq: set(['seaf_server.event', 'seahub.stats'])
[2014-09-11 09:33:54,192] [INFO] staring background tasks
[2014-09-11 09:33:54,192] [INFO] search indexer is disabled
[2014-09-11 09:33:54,193] [INFO] seahub email sender is started, interval = 1800 sec
[2014-09-11 09:33:54,193] [INFO] stop libreoffice...
[2014-09-11 09:33:54,193] [INFO] remove pidfile /srv/seafile/pids/seafevents.pid
[2014-09-11 09:34:04,164] [INFO] [seafevents] database: mysql, name: seahub
[2014-09-11 09:34:04,189] [DEBUG] seafes enabled: False
[2014-09-11 09:34:04,189] [DEBUG] seahub email enabled: True
[2014-09-11 09:34:04,190] [DEBUG] seahub dir: /srv/seafile/seafile-pro-server-3.1.3/seahub
[2014-09-11 09:34:04,190] [DEBUG] send seahub email interval: 1800 sec
[2014-09-11 09:34:04,190] [DEBUG] office enabled: True
[2014-09-11 09:34:04,190] [DEBUG] office convert workers: 1
[2014-09-11 09:34:04,190] [DEBUG] office outputdir: /tmp/seafile-office-output
[2014-09-11 09:34:04,190] [DEBUG] office convert max pages: 50
[2014-09-11 09:34:04,190] [DEBUG] office convert max size: 2 MB

the ccnet.log contain follow messages every 10s

[09/25/14 11:02:56] ../common/session.c(375): Accepted a local client
[09/25/14 11:02:56] ../common/session.c(375): Accepted a local client
[09/25/14 11:02:56] ../common/peer.c(943): Local peer down
[09/25/14 11:02:56] ../common/peer.c(941): libevent got an error! what=33, errno=104 (Connection reset by peer)
[09/25/14 11:02:56] ../common/peer.c(943): Local peer down
[09/25/14 11:02:56] ../common/processor.c(218): [Proc] Shutdown processor mqserver-proc(-1001) for bad update: 515 peer down

With 3.1.4 (upgrade from 3.1.3 or downgrade from 3.1.6 and reinstall libreoffice) everythin work ok:

[2014-09-15 12:40:59,282] [DEBUG] start to fetch task <type: docx, id: 1d21f30f6812e2c6d916b73a88afaf5d4348895c>
[2014-09-15 12:40:59,769] [DEBUG] start to convert task <type: docx, id: 1d21f30f6812e2c6d916b73a88afaf5d4348895c>
[2014-09-15 12:40:59,769] [DEBUG] Running command: "/usr/bin/python2.6" "/srv/seafile/seafile-pro-server-3.1.4/pro/python/seafevents/office_converter/unoconv.py" "-vvv" "-o" "/tmp/seafile-office-output/pdf/1d21f30f6812e2c6d916b73a88afaf5d4348895c" "/tmp/tmpUAq0xo.docx", cwd = /srv/seafile/seafile-pro-server-3.1.4/pro/python/seafevents/office_converter
[2014-09-15 12:41:02,353] [DEBUG] succefully converted <type: docx, id: 1d21f30f6812e2c6d916b73a88afaf5d4348895c> to pdf
[2014-09-15 12:41:04,034] [DEBUG] Running command: "chmod" "-R" "770" "/tmp/seafile-office-output/html/1d21f30f6812e2c6d916b73a88afaf5d4348895c"
[2014-09-15 12:41:04,039] [DEBUG] successfully convert <type: docx, id: 1d21f30f6812e2c6d916b73a88afaf5d4348895c> to html
[2014-09-15 12:41:04,040] [DEBUG] removing temporary document /tmp/tmpUAq0xo.docx
[2014-09-15 12:50:46,913] [INFO] starts to send email
[2014-09-15 12:50:46,913] [DEBUG] Running command: "/usr/bin/python2.6" "/srv/seafile/seafile-pro-server-3.1.4/seahub/manage.py" "send_notices", cwd = /srv/seafile/seafile-pro-server-3.1.4/seahub

OS: CentOS 6.5(x86_64), python 2.6.6.

khorkin commented 10 years ago

Hi, this issue related to seahub code seafile-pro-server-3.1.6/pro/python/seafevents/office_converter/convert.py function "is_python3()" in python 2.6.6 subprocess module doesn't has "check_output" function

I fix it by small hack:

--- convert.py-ORIG 2014-10-10 18:25:08.213195861 +0400
+++ convert.py  2014-10-10 18:11:41.559270347 +0400
@@ -34,6 +34,8 @@
         output = subprocess.check_output('libreoffice --version', shell=True)
     except subprocess.CalledProcessError:
         return False
+    except AttributeError:
+        return False
     else:
         m = re.match(r'LibreOffice (\d)\.(\d)', output)
         if not m:
lins05 commented 10 years ago

Thanks, we'll fix this soon.

On Fri, Oct 10, 2014 at 10:26 PM, khorkin notifications@github.com wrote:

Hi, this issue related to seahub code seafile-pro-server-3.1.6/pro/python/seafevents/office_converter/convert.py function "is_python3()" in python 2.6.6 subprocess module doesn't has "check_output" function

I fix it by small hack:

--- convert.py-ORIG 2014-10-10 18:25:08.213195861 +0400 +++ convert.py 2014-10-10 18:11:41.559270347 +0400 @@ -34,6 +34,8 @@ output = subprocess.check_output('libreoffice --version', shell=True) except subprocess.CalledProcessError: return False

  • except AttributeError:
  • return False else: m = re.match(r'LibreOffice (\d).(\d)', output) if not m:

— Reply to this email directly or view it on GitHub https://github.com/haiwen/seafile/issues/870#issuecomment-58662847.