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

[postgresql] failed to migrate error="strconv.Atoi: parsing "00_reaction.sql": invalid syntax #4093

Closed
bohdan-shulha opened this issue Nov 3, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@bohdan-shulha
Copy link

Describe the bug

Hey team,

I've been trying to set up Memos with Docker, but it seems that there's something wrong with the migrations in the stable docker image.

Whenever I run memos with postgresql, I get the following error:

2024-11-03 13:27:21 2024/11/03 12:27:21 ERROR failed to migrate error="strconv.Atoi: parsing \"00_reaction.sql\": invalid syntax\nfailed to convert patch version to int: 00_reaction.sql\ngithub.com/usememos/memos/store.(*Store).getSchemaVersionOfMigrateScript\n\tgithub.com/usememos/memos/store/migrator.go:233\ngithub.com/usememos/memos/store.(*Store).normalizedMigrationHistoryList\n\tgithub.com/usememos/memos/store/migrator.go:272\ngithub.com/usememos/memos/store.(*Store).preMigrate\n\tgithub.com/usememos/memos/store/migrator.go:151\ngithub.com/usememos/memos/store.(*Store).Migrate\n\tgithub.com/usememos/memos/store/migrator.go:37\nmain.init.func1\n\t./main.go:61\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/[email protected]/command.go:989\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/command.go:1041\nmain.main\n\t./main.go:171\nruntime.main\n\truntime/proc.go:271\nruntime.goexit\n\truntime/asm_arm64.s:1222\nfailed to get schema version of migrate script\ngithub.com/usememos/memos/store.(*Store).normalizedMigrationHistoryList\n\tgithub.com/usememos/memos/store/migrator.go:274\ngithub.com/usememos/memos/store.(*Store).preMigrate\n\tgithub.com/usememos/memos/store/migrator.go:151\ngithub.com/usememos/memos/store.(*Store).Migrate\n\tgithub.com/usememos/memos/store/migrator.go:37\nmain.init.func1\n\t./main.go:61\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/[email protected]/command.go:989\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/command.go:1041\nmain.main\n\t./main.go:171\nruntime.main\n\truntime/proc.go:271\nruntime.goexit\n\truntime/asm_arm64.s:1222\nfailed to normalize migration history list\ngithub.com/usememos/memos/store.(*Store).preMigrate\n\tgithub.com/usememos/memos/store/migrator.go:152\ngithub.com/usememos/memos/store.(*Store).Migrate\n\tgithub.com/usememos/memos/store/migrator.go:37\nmain.init.func1\n\t./main.go:61\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/[email protected]/command.go:989\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/command.go:1041\nmain.main\n\t./main.go:171\nruntime.main\n\truntime/proc.go:271\nruntime.goexit\n\truntime/asm_arm64.s:1222\nfailed to pre-migrate\ngithub.com/usememos/memos/store.(*Store).Migrate\n\tgithub.com/usememos/memos/store/migrator.go:38\nmain.init.func1\n\t./main.go:61\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/[email protected]/command.go:989\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:1117\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/command.go:1041\nmain.main\n\t./main.go:171\nruntime.main\n\truntime/proc.go:271\nruntime.goexit\n\truntime/asm_arm64.s:1222"

Steps to reproduce

  1. Set up Postgresql
  2. Use docker to start memos

The version of Memos you're using.

stable

Screenshots or additional context

image
@bohdan-shulha bohdan-shulha added the bug Something isn't working label Nov 3, 2024
@RoccoSmit
Copy link
Contributor

Duplicate of #3885
See the following pr for more info on how to resolve this #3873

@boojack
Copy link
Member

boojack commented Nov 3, 2024

@bohdan-shulha And if you'd like to use PostgreSQL, you can try the latest version v0.23.0-rc.0.

@bohdan-shulha
Copy link
Author

latest worked for me, thanks!

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