Migrate_file_comment fails

Hi,

After upgrading I am not able to upgrade the comment field:

root@superserver:/usr/local/www/haiwen/seafile-server# ./seahub.sh python-env seahub/manage.py migrate_file_comment

LC_ALL is not set in ENV, set to en_US.UTF-8
./seahub.sh: line 263: seahub/manage.py: Permission denied
Done.

Any ideas what is going wrong here?

Making seahub/manage.py executable helped, but it did solve the problem:

LC_ALL is not set in ENV, set to en_US.UTF-8

Warning: File comment has changed since version 6.3, while table `base_filecomment` is not migrated yet, please consider migrate it according to v6.3.0 release note, otherwise the file comment feature will not work correctly.
            
Traceback (most recent call last):
  File "seahub/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 327, in execute
    self.check()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check
    include_deployment_checks=include_deployment_checks,
  File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks
    return checks.run_checks(**kwargs)
  File "/usr/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config
    return check_resolver(resolver)
  File "/usr/local/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver
    return check_method()
  File "/usr/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check
    for pattern in self.url_patterns:
  File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/usr/local/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/utils/rooturl.py", line 41, in <module>
    url(r'^%s' % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)),
  File "/usr/local/lib/python2.7/site-packages/django/conf/urls/__init__.py", line 50, in include
    urlconf_module = import_module(urlconf_module)
  File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/urls.py", line 8, in <module>
    from seahub.views.sysadmin import *
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/views/sysadmin.py", line 88, in <module>
    from seahub.utils.two_factor_auth import has_two_factor_auth
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/utils/two_factor_auth.py", line 5, in <module>
    from seahub.two_factor.views.login import (
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/two_factor/views/__init__.py", line 2, in <module>
    from .core import SetupView, BackupTokensView, SetupCompleteView, QRGeneratorView
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/two_factor/views/core.py", line 31, in <module>
    from seahub.auth.forms import AuthenticationForm
  File "/usr/local/www/haiwen/seafile-server/seahub/seahub/auth/forms.py", line 17, in <module>
    from captcha.fields import CaptchaField
ImportError: No module named fields
Done.

Any ideas?

No module named fields

Maybe the following:

pip install fields

I did install fields with pip, but it did not solve the issue.

Which python version are you using? It could be the version too old.

2.7
This is the version used by the FreeBSD package.

What’s the python’s patch level?

I found the patch level does matter because the python in Ubuntu 14.04 will fail to execute the migrate_file_comment, even though its python version is 2.7.5. When I upgraded the system to Ubuntu 16.04, the python version becomes 2.7.11 and everything runs fine.

1 Like

Python 2.7.15.

Another problem I’m experiencing is, that the server is throwing an “Internal Server Error” when I try to access it.