-
Previous Value Current Value 16.9.5: build spec migration fails (NoSuchMethodError ScalarNode in BuildSpec.migrate53) — CI stops after upgrading from 14.1.9
Build spec migration fails due to unrecognized tag
-
State changed as build OD-8756 (16.9.6) is successful
-
OneDev
changed state to 'Closed' 20 hours ago
Previous Value Current Value Open
Closed
-
This issue happens when build spec version is out of sync with its content, possibly due to manual editing of the build spec. The logic used to migrate old content is applied again in 16.9.6 to fix this specific error. Please avoid editing build spec manually in future.
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Affected Versions |
16.9.5
|
| Labels |
No labels
|
Issue Votes (0)
Environment
1dev/server:16.9.5, single server, embedded HSQLDB, data volume mounted at/opt/onedev). Also reproduced with1dev/server:16.8.8.Symptom After the upgrade the server starts and the UI/API work, but no branch's
.onedev-buildspec.ymlcan be parsed, so pushes trigger no builds and scheduled jobs don't run. On startup every branch logs:Our build spec declares
version: 46(written by 14.1.x) and its command steps useinterpreter: !DefaultInterpreter, which the 16.0 incompatibility notes say is migrated automatically.Root cause (as far as we can see) Calling
io.onedev.server.buildspec.BuildSpec.parse(byte[])on the same file inside the 16.9.5 image (classpath/app/boot+/app/lib) throws during migration:The image ships
org.yaml.snakeyaml-2.7.jar(14.1.9 shipped 2.2).migrate53uses theScalarNode(Tag, String)constructor, which isn't present in snakeyaml 2.7, so migration from any build spec at version ≤ 52 aborts, and the un-migrated YAML (still containing!DefaultInterpreter) is then constructed and rejected.Workarounds we tried:
!DefaultInterpreterwith!PosixInterpreterwhile keepingversion: 46→ the sameInvalid tag: !DefaultInterpreter(migration still aborts inmigrate53).version: 56to skip migration → fails on fields that later migrations would have changed (e.g.Unable to find property 'maxRetries' on class: io.onedev.server.buildspec.job.Job).Questions
We've rolled back to 14.1.9 for now and have a separate test instance on 16.9.5 that reproduces the problem, and we're happy to run any diagnostic you need there.