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

schema_history table needs a primary key #14111

Open
3 of 4 tasks
super-falcon opened this issue Jan 21, 2025 · 0 comments
Open
3 of 4 tasks

schema_history table needs a primary key #14111

super-falcon opened this issue Jan 21, 2025 · 0 comments
Labels

Comments

@super-falcon
Copy link

Pre-requisites

  • I have double-checked my configuration
  • I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened? What did you expect to happen?

We get the following error, when enabling archiving in Argo Workflow. Our persistence is an HA enabled MYSQL requiring all tables to have a mandatory primary key. Looks like the table schema_history does not have one. Is there a way to control the schema created automatically today.

Version(s)

v3.5.7

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflow that uses private images.

2025/01/16 02:17:43     Session ID:     00001
        Query:          create table if not exists schema_history(schema_version int not null)
        Stack:
                fmt.(*pp).handleMethods@/usr/local/go/src/fmt/print.go:673
                fmt.(*pp).printArg@/usr/local/go/src/fmt/print.go:756
                fmt.(*pp).doPrint@/usr/local/go/src/fmt/print.go:1211
                fmt.Append@/usr/local/go/src/fmt/print.go:289
                log.(*Logger).Print.func1@/usr/local/go/src/log/log.go:261
                log.(*Logger).output@/usr/local/go/src/log/log.go:238
                log.(*Logger).Print@/usr/local/go/src/log/log.go:260
                github.com/argoproj/argo-workflows/v3/persist/sqldb.migrate.Exec@/go/src/github.com/argoproj/argo-workflows/persist/sqldb/migrate.go:39
                github.com/argoproj/argo-workflows/v3/workflow/controller.(*WorkflowController).initDB@/go/src/github.com/argoproj/argo-workflows/workflow/controller/config.go:96
                github.com/argoproj/argo-workflows/v3/workflow/controller.(*WorkflowController).Run@/go/src/github.com/argoproj/argo-workflows/workflow/controller/controller.go:264
                runtime.goexit@/usr/local/go/src/runtime/asm_amd64.s:1650
        Error:          Error 3750 (HY000): Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.
        Time taken:     0.00062s
        Context:        context.Background

Logs from the workflow controller

kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant