Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration failed #3326

Closed
LxnChan opened this issue May 7, 2024 · 1 comment
Closed

migration failed #3326

LxnChan opened this issue May 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@LxnChan
Copy link

LxnChan commented May 7, 2024

Describe the bug

When I upgrade memos from 0.20.1 to 0.21.0, then docker prompts this error message:

[root@<cleared> ~]# docker logs -f 99
---
Server profile
version: 0.21.0
data: /var/opt/memos
dsn: <cleared>
addr: 
port: 5230
mode: prod
driver: mysql
frontend: true
---
start to migrate database schema
applying migration of 0.21.0
2024/05/07 01:56:18 ERROR failed to migrate database !BADKEY="Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLUMN `resource_name` TO `uid`' at line 1\nmigrate error: ALTER TABLE `memo` RENAME COLUMN `resource_name` TO `uid`\ngithub.com/usememos/memos/store/db/mysql.(*DB).applyMigrationForMinorVersion\n\t/backend-build/store/db/mysql/migrator.go:131\ngithub.com/usememos/memos/store/db/mysql.(*DB).prodMigrate\n\t/backend-build/store/db/mysql/migrator.go:104\ngithub.com/usememos/memos/store/db/mysql.(*DB).Migrate\n\t/backend-build/store/db/mysql/migrator.go:30\nmain.init.func1\n\t/backend-build/bin/memos/main.go:55\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039\nmain.Execute\n\t/backend-build/bin/memos/main.go:105\nmain.main\n\t/backend-build/bin/memos/main.go:201\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1695\nfailed to apply minor version migration\ngithub.com/usememos/memos/store/db/mysql.(*DB).prodMigrate\n\t/backend-build/store/db/mysql/migrator.go:105\ngithub.com/usememos/memos/store/db/mysql.(*DB).Migrate\n\t/backend-build/store/db/mysql/migrator.go:30\nmain.init.func1\n\t/backend-build/bin/memos/main.go:55\ngithub.com/spf13/cobra.(*Command).execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:987\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1115\ngithub.com/spf13/cobra.(*Command).Execute\n\t/go/pkg/mod/github.com/spf13/[email protected]/command.go:1039\nmain.Execute\n\t/backend-build/bin/memos/main.go:105\nmain.main\n\t/backend-build/bin/memos/main.go:201\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:271\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1695"

Steps to reproduce

  1. Use v0.20.1 normally
  2. stop container with 0.20.1
  3. repull the latest image
  4. start new container with latest image(0.21.1)
  5. docker logs -f memos

The version of Memos you're using

Version: v0.20.1

Screenshots or additional context

No response

@LxnChan LxnChan added the bug Something isn't working label May 7, 2024
@michaelien
Copy link
Collaborator

@LxnChan What's the version of your MySQL instance? The recommended version is 8.0.

https://stackoverflow.com/a/30290915

@boojack boojack closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants