memos icon indicating copy to clipboard operation
memos copied to clipboard

v0.23.1 =>> v0.25.0 can't startup with ERROR failed to migrate error="SQL logic error: no such column: \"tags\"

Open wangningyu opened this issue 1 month ago • 4 comments

Pre-submission Checklist

  • [x] I have searched the existing issues and this bug has not been reported yet
  • [x] I have tested this issue on the demo site or the latest version

Where did you encounter this bug?

Older version (please specify below)

Memos Version

v0.25.0

Bug Description

old version: v0.23.1 new version: v0.25.0

I want to upgrade from the old version (V0.23.1) to (V0.25.0) in the DOCKER environment, but none of them can start. I have also tried many versions but still failed.

The following is the error log displayed in DOCKER:

`neosmemo-0.25.0 date,stream,content 2025-12-02 08:25:03,stdout,2025/12/02 16:25:03 ERROR failed to migrate error="SQL logic error: no such column: "tags" (1)\nfailed to execute statement\ngithub.com/usememos/memos/store.(*Store).execute\n\t/backend-build/store/migrator.go:242\ngithub.com/usememos/memos/store.(*Store).Migrate\n\t/backend-build/store/migrator.go:87\nmain.init.func1\n\t/backend-build/bin/memos/main.go:62\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1019\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071\nmain.main\n\t/backend-build/bin/memos/main.go:184\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1700\nmigrate error: -- Remove deprecated indexes.\nDROP INDEX IF EXISTS idx_memo_tags;\nDROP INDEX IF EXISTS idx_memo_content;\nDROP INDEX IF EXISTS idx_memo_visibility;\n\n-- Drop deprecated tags column.\nALTER TABLE memo DROP COLUMN tags;\ngithub.com/usememos/memos/store.(*Store).Migrate\n\t/backend-build/store/migrator.go:88\nmain.init.func1\n\t/backend-build/bin/memos/main.go:62\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1019\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071\nmain.main\n\t/backend-build/bin/memos/main.go:184\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1700"

2025-12-02 08:25:03,stdout,2025/12/02 16:25:03 INFO start migration currentSchemaVersion=0.23.1 targetSchemaVersion=0.25.1

2025-12-02 08:24:53,stdout,2025/12/02 16:24:53 ERROR failed to migrate error="SQL logic error: no such column: "tags" (1)\nfailed to execute statement\ngithub.com/usememos/memos/store.(*Store).execute\n\t/backend-build/store/migrator.go:242\ngithub.com/usememos/memos/store.(*Store).Migrate\n\t/backend-build/store/migrator.go:87\nmain.init.func1\n\t/backend-build/bin/memos/main.go:62\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1019\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071\nmain.main\n\t/backend-build/bin/memos/main.go:184\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1700\nmigrate error: -- Remove deprecated indexes.\nDROP INDEX IF EXISTS idx_memo_tags;\nDROP INDEX IF EXISTS idx_memo_content;\nDROP INDEX IF EXISTS idx_memo_visibility;\n\n-- Drop deprecated tags column.\nALTER TABLE memo DROP COLUMN tags;\ngithub.com/usememos/memos/store.(*Store).Migrate\n\t/backend-build/store/migrator.go:88\nmain.init.func1\n\t/backend-build/bin/memos/main.go:62\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1019\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071\nmain.main\n\t/backend-build/bin/memos/main.go:184\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:283\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1700"

2025-12-02 08:24:53,stdout,2025/12/02 16:24:53 INFO start migration currentSchemaVersion=0.23.1 targetSchemaVersion=0.25.1

`

I hope this issue can be fixed, thank you very much!

Steps to Reproduce

neosmemo-0.25.0.csv

Expected Behavior

No response

Screenshots & Additional Context

No response

wangningyu avatar Dec 02 '25 08:12 wangningyu

same error

xxzj990 avatar Dec 08 '25 05:12 xxzj990

为什么我之前升级v0.25.0没问题,都用了好长时间了,今天重启容器就报这个错。现在只能降级到v0.23.1。奇怪

xxzj990 avatar Dec 08 '25 05:12 xxzj990

我手动编辑了db文件(sqlite),最后升级到了最新版,有可能有问题,仅供参考:

运行:

ALTER TABLE memo ADD COLUMN tags TEXT NOT NULL DEFAULT '[]';
ALTER TABLE memo DROP COLUMN pinned;

然后升级镜像到最新的v0.25.3

注意:尝试前做好备份!

xxzj990 avatar Dec 08 '25 06:12 xxzj990

跟你一样的升级 日志里倒是没有报错 但是界面上tags下面是空的 不知道咋回事

cnazev avatar Dec 16 '25 00:12 cnazev