go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.75k stars 5.47k forks source link

dump: Failed to include repositories: open /data/git/repositories: no such file or directory #17883

Open singuliere opened 2 years ago

singuliere commented 2 years ago

Gitea Version

1.15.6

Git Version

2.30.2

How are you running Gitea?

$ docker run --name gitea -p 8080:3000 -e GITEA__security__INSTALL_LOCK=true -d gitea/gitea:1.15.6
$ docker exec gitea gitea admin user create --admin --username root --password admin1234 --email admin@example.com

Database

SQLite

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

Steps to reproduce:

$ docker exec -ti  --user git gitea bash
bash-5.1$ cd /tmp
bash-5.1$ gitea dump
2021/12/02 14:30:00 ...dules/setting/log.go:286:newLogService() [I] Gitea v1.15.6 built with GNU Make 4.3, go1.16.9 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2021/12/02 14:30:00 ...dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: Console(Console:)
2021/12/02 14:30:00 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:)
2021/12/02 14:30:00 ...les/setting/cache.go:78:newCacheService() [I] Cache Service Enabled
2021/12/02 14:30:00 ...les/setting/cache.go:93:newCacheService() [I] Last Commit Cache Service Enabled
2021/12/02 14:30:00 ...s/setting/session.go:77:newSessionService() [I] Session Service Enabled
2021/12/02 14:30:00 ...s/storage/storage.go:171:initAttachments() [I] Initialising Attachment storage with type: 
2021/12/02 14:30:00 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments
2021/12/02 14:30:00 ...s/storage/storage.go:165:initAvatars() [I] Initialising Avatar storage with type: 
2021/12/02 14:30:00 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars
2021/12/02 14:30:00 ...s/storage/storage.go:183:initRepoAvatars() [I] Initialising Repository Avatar storage with type: 
2021/12/02 14:30:00 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars
2021/12/02 14:30:00 ...s/storage/storage.go:177:initLFS() [I] Initialising LFS storage with type: 
2021/12/02 14:30:00 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs
2021/12/02 14:30:00 ...s/storage/storage.go:189:initRepoArchives() [I] Initialising Repository Archive storage with type: 
2021/12/02 14:30:00 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive
Failed to include repositories: open /data/git/repositories: no such file or directory
2021/12/02 14:30:00 cmd/dump.go:220:runDump() [I] Dumping local repositories... /data/git/repositories
2021/12/02 14:30:00 cmd/dump.go:150:fatal() [F] Failed to include repositories: open /data/git/repositories: no such file or directory

This only happens because Gitea has no repository, which is atypical.

Screenshots

No response

wxiaoguang commented 2 years ago

This is a know problem, and should have been fixed by

Oh sorry, I misread the log ....

If there is no repository, maybe the error is not that serious 😊

And I remembered this one: https://github.com/go-gitea/gitea/blob/main/modules/setting/directory.go , Gitea should prepare the directories when installing/upgrading.