6.1.2 -> 7.0.5 - DB Issues?

Hi all,

My seafile server has been working great for years, but my VPS got restarted recently, so i decided to do a version upgrade.

After running “upgrade_6.1_6.2.sh” (no errors at all), after “seafile.sh start”, i see these errors in the seafile.log:

What’s going on here?
Is this a problem?

Thanks!

You need to run all three scripts, when you upgrade from 6.1 to 7.0

upgrade_6.1_6.2.sh
upgrade_6.2_6.3.sh
upgrade_6.3_7.0.sh

->grep RepoInfo sql//sqlite3/ 2>/dev/null
sql/6.3.0/sqlite3/seafile.sql:CREATE TABLE IF NOT EXISTS RepoInfo (repo_id CHAR(36) PRIMARY KEY, name VARCHAR(255) NOT NULL, update_time INTEGER, version INTEGER, is_encrypted INTEGER, last_modifier VARCHAR(255));
sql/7.0.0/sqlite3/seafile.sql:ALTER TABLE RepoInfo ADD COLUMN status INTEGER DEFAULT 0;

Ah ha, okay, thank you.
When i saw the symlink being updated to the new version after the “upgrade_6.1_6.2.sh”, i assumed that was all that was needed.
I completed the other 7.0.5 updates, and it worked fine.

Now, I’m moving on to 7.1.4…
I’ve run the “upgrade_7.0_7.1.sh” which completed without issues.
The server starts ok.
When I log into the server using a web browser, I get:

:confused:

Did you follow the upgrade instructions for 7.1.x? As now Python 3 is used you need to ensure this is installed PLUS all the additions for Python 3 (see server manual under upgrade).

Yes, I did.

vps2@ps186861:~/seafile$ python3 --version
Python 3.5.3
vps2@ps186861:~/seafile$ pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy django-pylibmc django-simple-captcha python3-ldap
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (4.0.0)
Requirement already satisfied: pylibmc in /home/vps2/.local/lib/python3.5/site-packages (1.6.1)
Requirement already satisfied: captcha in /home/vps2/.local/lib/python3.5/site-packages (0.3)
Requirement already satisfied: jinja2 in /home/vps2/.local/lib/python3.5/site-packages (2.11.2)
Requirement already satisfied: sqlalchemy in /home/vps2/.local/lib/python3.5/site-packages (1.3.17)
Requirement already satisfied: django-pylibmc in /home/vps2/.local/lib/python3.5/site-packages (0.6.1)
Requirement already satisfied: django-simple-captcha in /home/vps2/.local/lib/python3.5/site-packages (0.5.12)
Requirement already satisfied: python3-ldap in /home/vps2/.local/lib/python3.5/site-packages (0.9.8.4)
Requirement already satisfied: MarkupSafe>=0.23 in /home/vps2/.local/lib/python3.5/site-packages (from jinja2) (1.1.1)
Requirement already satisfied: six>=1.2.0 in /usr/lib/python3/dist-packages (from django-simple-captcha) (1.10.0)
Requirement already satisfied: Django>=1.8 in /home/vps2/.local/lib/python3.5/site-packages (from django-simple-captcha) (2.2.12)
Requirement already satisfied: django-ranged-response==0.2.0 in /home/vps2/.local/lib/python3.5/site-packages (from django-simple-captcha) (0.2.0)
Requirement already satisfied: pyasn1>=0.1.7 in /usr/lib/python3/dist-packages (from python3-ldap) (0.1.9)
Requirement already satisfied: pytz in /home/vps2/.local/lib/python3.5/site-packages (from Django>=1.8->django-simple-captcha) (2020.1)
Requirement already satisfied: sqlparse in /home/vps2/.local/lib/python3.5/site-packages (from Django>=1.8->django-simple-captcha) (0.3.1)

Hm.

2020-05-29 06:17:46.271 - <140489750222592> wsgidav.error_printer       ERROR   :  Traceback (most recent call last):
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/error_printer.py", line 51, in __call__
    app_iter = self.next_app(environ, sub_app_start_response)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/http_authenticator.py", line 253, in __call__
    return self.handle_basic_auth_request(environ, start_response)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/http_authenticator.py", line 310, in handle_basic_auth_request
    return self.next_app(environ, start_response)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/dir_browser/_dir_browser.py", line 110, in __call__
    context = self._get_context(environ, dav_res)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/dir_browser/_dir_browser.py", line 182, in _get_context
    childList = dav_res.get_descendants(depth="1", add_self=False)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/dav_provider.py", line 461, in get_descendants
    for child in self.get_member_list():
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/seafile_dav_provider.py", line 495, in get_member_list
    res = self._createRootRes(repo, repo.name)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/seafile_dav_provider.py", line 506, in _createRootRes
    obj = get_repo_root_seafdir(repo)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/wsgidav/seafile_dav_provider.py", line 619, in get_repo_root_seafdir
    root_id = commit_mgr.get_commit_root_id(repo.id, repo.version, repo.head_cmmt_id)
  File "/home/vps2/seafile/seafile-server-7.1.4/seahub/thirdpart/seafobj/commits.py", line 57, in get_commit_root_id
    commit = self.load_commit(repo_id, version, commit_id)
TypeError: the JSON object must be str, not 'bytes'

You need Python higher than 3.5. Python 3.5 is not enough.

:tired_face:
Well, this is going to be interesting since i dont have root access on this VPS.

Thanks for the help guys!

It is possible that you choose another more new OS?

Have a look at Anaconda. It is very easy to deploy different python versions w/o root or need for compilation with it.

Hi, I had also this issue today. In my case was related to the sqlite scripts. I was migrating from 4.3 to 7.1.5 and none of the upgrades seems to have an “CREATE TABLE” statement for the RepoFileCount table.

And I’ve solved it by connecting manually to my database (with an sqlite client) and executing the create table statement:

main: /seafile/seafile-data/seafile.db
sqlite> .tables
Branch RepoHead RepoTrash UserShareQuota
GarbageRepos RepoHistoryLimit RepoUserToken VirtualRepo
InnerPubRepo RepoInfo RepoValidSince WebAP
OrgQuota RepoOwner SeafileConf WebUploadTempFiles
OrgUserQuota RepoSize SharedRepo
Repo RepoSyncError SystemInfo
RepoGroup RepoTokenPeerInfo UserQuota

sqlite> CREATE TABLE RepoFileCount (repo_id CHAR(36) PRIMARY KEY, file_count BIGINT UNSIGNED);
sqlite> .exit