[GH-ISSUE #465] Error when trying to migrate v1.5.2 database. #284

Closed
opened 2026-02-25 23:33:52 +03:00 by kerem · 2 comments
Owner

Originally created by @kmkrebs on GitHub (Aug 10, 2022).
Original GitHub issue: https://github.com/go-shiori/shiori/issues/465

When trying to migrate my v1.5.2 database, I get some ugly errors. Am I doing something obviously wrong?

Running shiori migrate - shiori built from github, using go build --tags fts5

> shiori migrate
Error during migration: SQL logic error: cannot start a transaction within a transaction (1) in line 0: BEGIN TRANSACTION;
ALTER TABLE bookmark
    ADD has_content BOOLEAN DEFAULT FALSE NOT NULL;

UPDATE bookmark
SET has_content = bc.has_content FROM (SELECT docid, content <> '' AS has_content FROM bookmark_content) AS bc
WHERE bookmark.id = bc.docid;
COMMIT;

Attempting to log in via shiori serve:

failed to fetch data: SQL logic error: no such column: b.has_content (1) (500)

Updating to fts5 -- I must have done this at v1.5.1, but I tried it anyway.

> go run --tags fts5 main.go -path /two/shiori/shiori.db
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3Fts5IndexQuery’:
sqlite3-binding.c:228445:18: warning: ‘memcpy’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
228445 |     if( nToken ) memcpy(&buf.p[1], pToken, nToken);
       |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5:56PM INF Command line utility to migrate a Shiori SQlite database from FTS4 to FTS5
5:56PM WRN Remember to make a backup of your database file!
5:56PM WRN Press any key when you are ready to proceed.

5:56PM ERR error migrating database: no results from check query. Is your database already migrated?

Running Manjaro Linux, Kernel 5.15.59.

Originally created by @kmkrebs on GitHub (Aug 10, 2022). Original GitHub issue: https://github.com/go-shiori/shiori/issues/465 When trying to migrate my v1.5.2 database, I get some ugly errors. Am I doing something obviously wrong? Running *shiori migrate* - shiori built from github, using *go build --tags fts5* ``` > shiori migrate Error during migration: SQL logic error: cannot start a transaction within a transaction (1) in line 0: BEGIN TRANSACTION; ALTER TABLE bookmark ADD has_content BOOLEAN DEFAULT FALSE NOT NULL; UPDATE bookmark SET has_content = bc.has_content FROM (SELECT docid, content <> '' AS has_content FROM bookmark_content) AS bc WHERE bookmark.id = bc.docid; COMMIT; ``` --- Attempting to log in via *shiori serve*: ``` failed to fetch data: SQL logic error: no such column: b.has_content (1) (500) ``` --- Updating to *fts5* -- I must have done this at v1.5.1, but I tried it anyway. ``` > go run --tags fts5 main.go -path /two/shiori/shiori.db # github.com/mattn/go-sqlite3 sqlite3-binding.c: In function ‘sqlite3Fts5IndexQuery’: sqlite3-binding.c:228445:18: warning: ‘memcpy’ specified bound 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=] 228445 | if( nToken ) memcpy(&buf.p[1], pToken, nToken); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5:56PM INF Command line utility to migrate a Shiori SQlite database from FTS4 to FTS5 5:56PM WRN Remember to make a backup of your database file! 5:56PM WRN Press any key when you are ready to proceed. 5:56PM ERR error migrating database: no results from check query. Is your database already migrated? ``` Running Manjaro Linux, Kernel 5.15.59.
Author
Owner

@derky1202 commented on GitHub (Aug 11, 2022):

yes, I have the same issue. Let us see if this can be solved.

<!-- gh-comment-id:1211625141 --> @derky1202 commented on GitHub (Aug 11, 2022): yes, I have the same issue. Let us see if this can be solved.
Author
Owner

@fmartingr commented on GitHub (Aug 11, 2022):

Hey folks, just took a look at this and it seems that using transactions manually in SQL migrations is redundant since the migration library already takes care of that, I've fixed it in #468 which I'm going to merge ASAP. Thanks for reporting this out!

<!-- gh-comment-id:1211868814 --> @fmartingr commented on GitHub (Aug 11, 2022): Hey folks, just took a look at this and it seems that using transactions manually in SQL migrations is redundant since the migration library already takes care of that, I've fixed it in #468 which I'm going to merge ASAP. Thanks for reporting this out!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#284
No description provided.