更改个人头像时出现以下错误的解决方法(版本6.0.9)

更改个人头像时出现以下错误。

页面显示以下内容
Page unavailable

Sorry, but the requested page is unavailable due to a server hiccup.

Our engineers have been notified, so check back later.

seahub_django_requesst.log内容以下。

2017-03-31 06:19:28,654 [ERROR] django.request:256 handle_uncaught_exception Internal Server Error: /avatar/add/
Traceback (most recent call last):
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/core/handlers/base.py”, line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/seahub/auth/decorators.py”, line 27, in _wrapped_view
return view_func(request, *args, **kwargs)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/seahub/avatar/views.py”, line 76, in add
avatar.avatar.save(image_file.name, image_file)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/db/models/fields/files.py”, line 111, in save
self.instance.save()
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/seahub/avatar/models.py”, line 151, in save
super(Avatar, self).save(*args, **kwargs)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/db/models/base.py”, line 734, in save
force_update=force_update, update_fields=update_fields)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/db/models/base.py”, line 771, in save_base
update_fields=update_fields, raw=raw, using=using)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/thirdpart/Django-1.8.17-py2.7.egg/django/dispatch/dispatcher.py”, line 189, in send
response = receiver(signal=self, sender=sender, **named)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/seahub/avatar/models.py”, line 174, in create_default_thumbnails
instance.create_thumbnail(size)
File “/opt/ivyb2b-6.9/seafile-server-6.0.9/seahub/seahub/avatar/models.py”, line 107, in create_thumbnail
image.save(thumb, AVATAR_THUMB_FORMAT, quality=quality)
File “/usr/lib64/python2.7/site-packages/PIL/Image.py”, line 1477, in save
save_handler(self, fp, filename)
File “/usr/lib64/python2.7/site-packages/PIL/PngImagePlugin.py”, line 608, in _save
ImageFile._save(im, _idat(fp, chunk), [(“zip”, (0,0)+im.size, 0, rawmode)])
File “/usr/lib64/python2.7/site-packages/PIL/ImageFile.py”, line 456, in _save
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
File “/usr/lib64/python2.7/site-packages/PIL/Image.py”, line 395, in _getencoder
return encoder(mode, *args + extra)
TypeError: function takes at most 4 arguments (6 given)

这个问题以前没遇到过,你先清空一下服务器的缓存,然后重启 seafile 试试。

您好!已尝试过很多方法,并已清理过缓存了,还是不行呀,6.0.8 及 6.0.9 都试过,都是出现同一个错误,当出现错误时,系统登录不了,要把表(seahub-db.avatar_avatar)数据清空才能再次登录系统,我怀疑是图片处理时出现错误。

你能把你出问题的头像原始文件,共享过来,我在我这里试试。

任何一个头像图片文件都是一样的错误,应与文件格式、大小没关系的,有可能是 import Image 处理图片时出现错误吧。

错误提示是:function takes at most 4 arguments (6 given),参数最多是4个,但已提供了6个参数。

这个应该不会,你可以到我们提供的 demo 站点再试试 Log In - Demo12311111

刚才登录你们的demo系统测试是OK的。我认为是图片处理版本不兼容造成的,我安装Image 时是这样的:pip install Pillow
pip install http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz 你检查一下看问题出在那里,谢谢!

你参考这里的依赖安装信息,你自己检查一下吧