woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.94k stars 352 forks source link

database migration parent-steps-to-workflows failed #1892

Closed 6543 closed 1 year ago

6543 commented 1 year ago

dbms: mariadb

{"level":"trace","time":"2023-06-28T01:24:21Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/store/datastore/migration/migration.go:161","message":"start migration task 'parent-steps-to-workflows'"}
[xorm] [warn]  2023/06/28 01:24:21.639672 Table steps column step_error db type is TEXT(65535), struct type is VARCHAR(500)
[xorm] [warn]  2023/06/28 01:24:21.639689 Table steps has column step_uuid but struct has not related field
[xorm] [warn]  2023/06/28 01:24:21.639693 Table steps has column step_exit_code but struct has not related field
{"level":"fatal","error":"Error 1406 (22001): Data too long for column 'workflow_error' at row 1","time":"2023-06-28T01:24:23Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/cmd/server/setup.go:90","message":"could not migrate datastore"}
qwerty287 commented 1 year ago

I don't see an issue at the workflow migration, because your schema is wrong: [xorm] [warn] 2023/06/28 01:24:21.639672 Table steps column step_error db type is TEXT(65535), struct type is VARCHAR(500)

https://github.com/woodpecker-ci/woodpecker/blob/e1c31df6c6e28eade007c6a6fc24bf6b9d26e203/server/model/step.go#L38

Maybe this was changed at some point, but the issue is not the workflow migration.

6543 commented 1 year ago

-> #1949