gitea: Migration from 1.13.7 to 1.14.x failing with: no such file or directory

I’d like to re-open #15505, but I don’t have permissions for doing so. I’d appreciate if a collaborator could do it.


The migration from 1.13.7 to 1.14.x is still broken for us. I just tried it again, and it’s failing migration transactions with the following output (still the same problem as OP reported in #15505):

models/models.go:220:NewEngine() [I] [SQL] BEGIN TRANSACTION [] - 757.98µs
...s/migrations/v156.go:74:fixPublisherIDforTagReleases() [I] [SQL] SELECT "id", "repo_id", "sha1", "tag_name", "publisher_id" FROM "release" WHERE (publisher_id = 0 OR publisher_id is null) AND (is_tag=$1) ORDER BY "repo_id" ASC, "id" ASC LIMIT 100 [true] - 2.108098ms
...s/migrations/v156.go:89:fixPublisherIDforTagReleases() [I] [SQL] SELECT "id", "owner_id", "owner_name", "name" FROM "repository" WHERE "id"=$1 LIMIT 1 [7] - 1.802507ms
...s/migrations/v156.go:114:fixPublisherIDforTagReleases() [E] Error whilst opening git repo for [7]kosmos/mastodon. Error: no such file or directory
...ations/migrations.go:397:Migrate() [I] [SQL] ROLLBACK [] - 585.276µs
routers/init.go:81:initDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: migrate: do migrate: no such file or directory

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I don’t think you can have a graceful handling of a migration that fails because it can’t find the repository.

This migration is specifically looking for the repo files and needs to see them. As I’ve stated above there are many reasons for that to happen - the simplest is that the repo isn’t there but - the repo root path could be incorrect in which case the migration is going to be completely incorrect.

The error says it can’t find this particular repository - apart from emitting the path directly saying look at that path I’m not sure what else it can do.

For this particular migration - it is a fatal error not to be able to find the repo and no graceful handling is possible.

What is your [repository] ROOT value in your app.ini?

There was a breaking change in 1.14:

https://blog.gitea.io/2021/04/gitea-1.14.0-is-released/#breaking-changes-or-potentially-breaking :

❗ The default location for repository data ([repository] ROOT) will now be in a subdirectory of the APP_DATA_PATH path. (#13991)