Internal Server Error with seafile-tutorial.doc

Hi everyone,

I installed seafile server CE with docker and everything works except the file preview for the seafile-tutorial.doc. The preview says: Internal Server Error. However, I can download the file, upload other files, preview PDFs and images. But .doc or .docx files get an Internal Server Error (however I can upload or download them)

seahub.log has this error:

2022-07-09 21:36:31,267 [ERROR] root:1154 prepare_converted_html failed to add_office_convert_task: HTTPConnectionPool(host=‘office-preview’, port=8089): Max retries exceeded with url: /add-task?file_id=b88ab96740ef53249b9d21fb3fa28050842266ba&doctype=doc&raw_path=https%3A%2F%2F%2Fseafhttp%2Ffiles%2F94df0404-9408-448b-9ec2-21bfd2849976%2Fseafile-tutorial.doc (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f5da9433880>: Failed to establish a new connection: [Errno -2] Name or service not known’))
Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/connection.py”, line 174, in _new_conn
conn = connection.create_connection(
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/util/connection.py”, line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File “/usr/lib/python3.8/socket.py”, line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/connectionpool.py”, line 703, in urlopen
httplib_response = self._make_request(
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/connectionpool.py”, line 398, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/connection.py”, line 239, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File “/usr/lib/python3.8/http/client.py”, line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/lib/python3.8/http/client.py”, line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File “/usr/lib/python3.8/http/client.py”, line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File “/usr/lib/python3.8/http/client.py”, line 1011, in _send_output
self.send(msg)
File “/usr/lib/python3.8/http/client.py”, line 951, in send
self.connect()
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/connection.py”, line 205, in connect
conn = self._new_conn()
uring handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/requests/adapters.py”, line 440, in send
resp = conn.urlopen(
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/connectionpool.py”, line 785, in urlopen
retries = retries.increment(
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/urllib3/util/retry.py”, line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=‘office-preview’, port=8089): Max retries exceeded with url: /add-task?file_id=b88ab96740ef53249b9d21fb3fa28050842266ba&doctype=doc&raw_path=https%3A%2F%2F%2Fseafhttp%2Ffiles%2F94df0404-9408-448b-9ec2-21bfd2849976%2Fseafile-tutorial.doc (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f5da9433880>: Failed to establish a new connection: [Errno -2] Name or service not known’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/seafile/seafile-server-9.0.6/seahub/seahub/utils/init.py”, line 1151, in prepare_converted_html
add_office_convert_task(obj_id, doctype, raw_path)
File “/opt/seafile/seafile-server-9.0.6/seahub/seahub/utils/init.py”, line 1107, in add_office_convert_task
requests.get(url, params, headers=headers)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/requests/api.py”, line 75, in get
return request(‘get’, url, params=params, **kwargs)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/requests/api.py”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/requests/sessions.py”, line 529, in request
resp = self.send(prep, **send_kwargs)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/requests/sessions.py”, line 645, in send
r = adapter.send(request, **kwargs)
File “/opt/seafile/seafile-server-9.0.6/seahub/thirdpart/requests/adapters.py”, line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host=‘office-preview’, port=8089): Max retries exceeded with url: /add-task?file_id=b88ab96740ef53249b9d21fb3fa28050842266ba&doctype=doc&raw_path=https%3A%2F%2F%2Fseafhttp%2Ffiles%2F94df0404-9408-448b-9ec2-21bfd2849976%2Fseafile-tutorial.doc (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x7f5da9433880>: Failed to establish a new connection: [Errno -2] Name or service not known’))

SOLVED:
removing this line in seahub_settings.py did the trick:

OFFICE_CONVERTOR_ROOT = 'http://office-preview:8089'

Not sure why it was there in the first place as I don’t have office set up anyways

We will check the issue.