Incompatible query on migration 20251108154913 (CREATE INDEX IF NOT EXISTS) #2417

Closed
opened 2026-03-22 14:06:52 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @loviuz on GitHub (Nov 17, 2025).

Description

I had an error during the last installation of Vikunja, especially about migration 20251108154913:
https://github.com/go-vikunja/vikunja/blob/main/pkg/migration/20251108154913.go

This query throw an error on MySQL 8.0:

CREATE INDEX IF NOT EXISTS IDX_task_comments_task_id ON task_comments (task_id)

I have skipped the migration and I have executed query without IF NOT EXISTS, and everything works fine.

Is this a known issue?

Vikunja Version

docker unstable

Browser and version

No response

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

Originally created by @loviuz on GitHub (Nov 17, 2025). ### Description I had an error during the last installation of Vikunja, especially about migration 20251108154913: https://github.com/go-vikunja/vikunja/blob/main/pkg/migration/20251108154913.go This query throw an error on MySQL 8.0: ```sql CREATE INDEX IF NOT EXISTS IDX_task_comments_task_id ON task_comments (task_id) ``` I have skipped the migration and I have executed query without `IF NOT EXISTS`, and everything works fine. Is this a known issue? ### Vikunja Version docker unstable ### Browser and version _No response_ ### Can you reproduce the bug on the Vikunja demo site? No ### Screenshots _No response_
Author
Owner

@kolaente commented on GitHub (Nov 17, 2025):

What was the error message?

@kolaente commented on GitHub (Nov 17, 2025): What was the error message?
Author
Owner

@QuanXplor commented on GitHub (Nov 28, 2025):

I'm sharing the startup logs of my MySQL 8.4.7 instance. Below are the detailed environment information and log contents:
2025/11/28 21:15:28 failed to create modcache index dir: mkdir /.cache: permission denied
time=2025-11-28T21:15:28.646+08:00 level=INFO msg="No config file found, using default or config from environment variables."
time=2025-11-28T21:15:28.646+08:00 level=INFO msg="Running migrations…"
time=2025-11-28T21:15:28.720+08:00 level=ERROR msg="Migration failed: migration 20251108154913 failed: 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 'IF NOT EXISTS IDX_task_comments_task_id ON task_comments (task_id)' at line 1"

@QuanXplor commented on GitHub (Nov 28, 2025): I'm sharing the startup logs of my MySQL 8.4.7 instance. Below are the detailed environment information and log contents: 2025/11/28 21:15:28 failed to create modcache index dir: mkdir /.cache: permission denied time=2025-11-28T21:15:28.646+08:00 level=INFO msg="No config file found, using default or config from environment variables." time=2025-11-28T21:15:28.646+08:00 level=INFO msg="Running migrations…" time=2025-11-28T21:15:28.720+08:00 level=ERROR msg="Migration failed: migration 20251108154913 failed: 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 'IF NOT EXISTS IDX_task_comments_task_id ON task_comments (task_id)' at line 1"
Author
Owner

@kolaente commented on GitHub (Nov 28, 2025):

This should be fixed with https://github.com/go-vikunja/vikunja/pull/1903 - please check with the next unstable build.

I have no way to test this currently but the changes look like they should work. Please check and report back.

@kolaente commented on GitHub (Nov 28, 2025): This should be fixed with https://github.com/go-vikunja/vikunja/pull/1903 - please check with the next unstable build. I have no way to test this currently but the changes look like they should work. Please check and report back.
Author
Owner

@J1mooo commented on GitHub (Nov 29, 2025):

I had the same errors, and the unstable build fixed it

@J1mooo commented on GitHub (Nov 29, 2025): I had the same errors, and the unstable build fixed it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#2417