Problems after upgrade to 7.0.4 CE

Hi,

i just upgraded from 6.3 to 7.0.4 CE. In general it works, but there are some problems with seahub.

First, when I try to add comments to a file (right-click on a file and open the comment-sidebar) I get two Error notices in the webinterface, without futher specification.

When I try to add a comment, the same error-notice appears and the comment isn’t saved.

Here are the according lines in the ‘seahub.log’:

2019-08-13 20:52:20,752 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/feb84a36-09e7-449f-b7b9-92ea1ccbe719/file/comments/
Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/endpoints/file_comments.py", line 65, in get
    total_count = FileComment.objects.get_by_file_path(repo_id, path).count()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/query.py", line 364, in count
    return self.query.get_count(using=self.db)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/query.py", line 499, in get_count
    number = obj.get_aggregation(using, ['__count'])['__count']
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/query.py", line 480, in get_aggregation
    result = compiler.execute_sql(SINGLE)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
OperationalError: (1054, "Unknown column 'base_filecomment.uuid_id' in 'where clause'")
2019-08-13 20:52:20,761 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/feb84a36-09e7-449f-b7b9-92ea1ccbe719/file/detail/
Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/views.py", line 3191, in get
    comment_total = file_comments.count()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/query.py", line 364, in count
    return self.query.get_count(using=self.db)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/query.py", line 499, in get_count
    number = obj.get_aggregation(using, ['__count'])['__count']
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/query.py", line 480, in get_aggregation
    result = compiler.execute_sql(SINGLE)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
OperationalError: (1054, "Unknown column 'base_filecomment.uuid_id' in 'where clause'")
2019-08-13 20:52:24,267 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/feb84a36-09e7-449f-b7b9-92ea1ccbe719/file/comments/
Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/endpoints/file_comments.py", line 122, in post
    repo_id=repo_id, file_path=path, author=username, comment=comment, detail=detail)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/base/models.py", line 73, in add_by_file_path
    return self.add(repo_id, parent_path, item_name, author, comment, detail)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/base/models.py", line 65, in add
    c.save(using=self._db)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/base.py", line 808, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/base.py", line 838, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/base.py", line 924, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/base.py", line 963, in _do_insert
    using=using, raw=raw)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/query.py", line 1076, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/compiler.py", line 1112, in execute_sql
    cursor.execute(sql, params)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/backends/mysql/base.py", line 101, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 226, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorvalue
OperationalError: (1054, "Unknown column 'uuid_id' in 'field list'")

The second issue I have is that I cant edit textfiles in the webinterface anymore. For normal textfiles (e.g. ‘abc.txt’) the edit option doesn’t appear anymore. Or am I overlooking it, is it at a new position?

But even if the editor starts (e.g. when opening *.md-files) is gets stuck in the loading screen.

The following output is created in the ‘seahub.log’:

2019-08-13 21:07:31,338 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /api2/repos/feb84a36-09e7-449f-b7b9-92ea1ccbe719/file/detail/
Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/seafile/seafile-server-7.0.4/seahub/seahub/api2/views.py", line 3191, in get
    comment_total = file_comments.count()
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/query.py", line 364, in count
    return self.query.get_count(using=self.db)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/query.py", line 499, in get_count
    number = obj.get_aggregation(using, ['__count'])['__count']
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/query.py", line 480, in get_aggregation
    result = compiler.execute_sql(SINGLE)
  File "/home/seafile/seafile-server-7.0.4/seahub/thirdpart/django/db/models/sql/compiler.py", line 899, in execute_sql
    raise original_exception
OperationalError: (1054, "Unknown column 'base_filecomment.uuid_id' in 'where clause'")

The other logfiles did not show any information while I was investigating the problems.

Does anyone have a clue or a solution to this problems? I would be very thankful.

Canis Lupus

There is no Edit button. Click in the body of the page, make changes, and click the disc button to Save.

Thanks, how could I overlook something that simple? :see_no_evil:

Nevertheless, does anyone have an idea for the error messages?

Hmm… seems like a similar issue like by me. (Can't save changes in WebUI)

Maybe you have to fix our SERVICE_URL in ccnet.conf, otherwise it’s just a bug.

@CanisLupus Have you considered this, is from rel 6.3, but usually gets forgotten:

Version 6.3 also changed the database table for file comments, if you have used this feature, you need migrate old file comments using the following commends after upgrading to 6.3:

./seahub.sh python-env seahub/manage.py migrate_file_comment

Note, this command should be run while Seafile server is running.6.3

the problem is, if you do this once you are already on 7, this does not work anymore, unfortunately

when already migrated to 7, migrate_file_comment (at least on my installation) creates the tables as the were in 6.3. the additional changes in 7 are not applied, and it still does not work.
I had to manually redo the table based on the definitions valid as of version 7.
(maybe, I have not checked, a rerun of the 7 upgrade script does fix this as well)

1 Like

You are right. I was not focused.

Thanks for this information. I still have the 6.3 backup, so I will revert to that point and try the migrate-file-comment script, prior to the 7.0 Upgrade

Thanks a lot. I totaly missed this script, when I was upgrading to 6.3.
After restoring the 6.3 backup and executing your given command prior to the 7.0 upgrade, it now workw like a charm. It fixed the problem with the markdown editor also!

delete the table base_filecomment and recreate the table. #OK

After this change another error .

[ERROR] django.request:135 handle_uncaught_exception Internal Server Error:
...
 OperationalError: (1054, "Unknown column 'base_filecomment.resolved' in 'field list'")

But I can open and edit makedown files again.

Hey pit2,
please execute the following commands on seahub-db:

ALTER TABLE base_filecomment ADD detail LONGTEXT DEFAULT NULL;
ALTER TABLE base_filecomment ADD resolved TINYINT(1) NOT NULL DEFAULT 0;
ALTER TABLE base_filecomment ADD INDEX resolved (resolved);

These are the comments from the seafile update to 7.0.x, found in seafile-server-latest/update/sql/mysql/7.0/seahub.sql.

Best regards
Christoph

As I ran into the same issue as the thread opener but have not the chance to downgrade to 6.3 to run the

/seahub.sh python-env seahub/manage.py migrate_file_comment

Is there a way to bring back the comment function or to edit .md files when I’m already on 7.0.5 CE?
I’m running a mysql DB.

Hey Golf,

this is possible but a little bit more work.
Try to use the comment function in seafile. This will lead to error log entries in the seahub.log that helps you to identify the missing sql-table-entries.

If for example the log is like “missing field xxx in table yyy”, then you have to look for these xxx and yyy in the mysql-update-scripts of seafile. Go to …/seafile-dir/seafile-server-7.0.5/updates/sql/6.3/mysql/seahub.sql (or the sql/7.0/mysql/seahub.sql).

In these files search for xxx and yyy and you will find the necessary ALTER or UPDATE requests to change the SQL-Table accordingly.

Best regards
Christoph

When trying to open/edit a .md file I get

OperationalError: (1054, “Unknown column ‘base_filecomment.uuid_id’ in ‘where clause’”)

in the seahub.log but no “missing field xxx in table yyy”.

So what should I do to mitigate that?

btw: my path looks like: …/seafile-server-7.0.5/upgrade/sql/7.0.0/mysql

[update]: I found this Opening MD files problem yesterday.
And now this Unknown column 'base_filecomment.uuid_id' in 'where clause' what points to https://download.seafile.com/published/support/server-upgrade/ce-7.0.md

As I asked in the other thread … do I need run theses commands (DROP, CREATE) as db-user seafile or root?

SOLVED!

I was so curious if I succeed even with my very limited DB know how … I think so …

This is what I did and may help others to do so, too:

sudo service seafile-server stop
sudo mysqldump -h localhost -u root -p --opt seahub-db > seahub-db.sql
mysql -u root -p
USE seahub-db;
DROP TABLE base_filecomment;
CREATE TABLE ....; as in https://forum.seafile.com/t/opening-md-files-problem/9284/7
sudo service seafile-server start

After that editing .md files and adding comments worked again.

1 Like

Thanks, it did!