goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.
https://goharbor.io
Apache License 2.0
24.29k stars 4.77k forks source link

Harbor Helm 1.14.0->1.14.1 migration issue #20164

Closed evanrich closed 8 months ago

evanrich commented 8 months ago

I get the following after upgrading 1.14.0->1.14.1 of the helm chart in the core container:

024-03-25T19:00:03Z [INFO] [/go/pkg/mod/github.com/golang-migrate/migrate/v4@v4.16.2/migrate.go:810]: error: no migration found for version 140: read down for version 140 .: file does not exist
2024-03-25T19:00:03Z [ERROR] [/common/dao/pgsql.go:140]: Failed to upgrade schema, error: "no migration found for version 140: read down for version 140 .: file does not exist"
2024-03-25T19:00:03Z [FATAL] [/core/main.go:198]: failed to migrate the database, error: no migration found for version 140: read down for version 140 .: file does not exist

also, the jobservice shows the following error:

2024-03-25T19:02:25Z [ERROR] [/pkg/config/rest/rest.go:50]: Failed on load rest config err:http error: code 401, message {"errors":[{"code":"UNAUTHORIZED","message":"only internal service is allowed to call this API"}]}
, url:http://harbor-core:80/api/v2.0/internalconfig
panic: failed to load configuration, error: failed to load rest config

goroutine 1 [running]:
main.main()
    /harbor/src/jobservice/main.go:44 +0x3ae
evanrich commented 8 months ago

this is defintiely the case. looking at the migrations folder, 2.11.0 has 0140 migration. it seems that the helm chart defaults to dev, and this caused an issue, likely because 2.11.0 is sort of what the dev container is.

evanrich commented 8 months ago

image fixed it, changed the schema_migrations table to 130 (the last # included in 2.10.1). It seems like the dev image is all over the place.

wy65701436 commented 8 months ago

close it as fixed.