dump command fails with mkdir permission denied after upgrade to 1.13.0 #6492

Closed
opened 2025-11-02 06:57:35 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Rychu-Pawel on GitHub (Dec 9, 2020).

  • Gitea version (or commit ref): 1.13.0 (upgraded from 1.12.x)
  • Operating system: Ubuntu 20.04.1
  • Log gist:
$ echo "$TMPDIR"

$ sudo -u git /usr/local/bin/gitea dump -c /etc/gitea/app.ini -f "/var/backups/gitea_backup"
2020/12/09 21:38:02 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.25.1, Wire Protocol Version 2 Enabled
2020/12/09 21:38:02 ...dules/setting/log.go:297:newLogService() [I] Gitea v1.13.0 built with GNU Make 4.1, go1.15.5 : bindata, sqlite, sqlite_unlock_notify
2020/12/09 21:38:02 ...dules/setting/log.go:343:newLogService() [I] Gitea Log Mode: Console(Console:info)
2020/12/09 21:38:02 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled
2020/12/09 21:38:02 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled
2020/12/09 21:38:02 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled
2020/12/09 21:38:02 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled
2020/12/09 21:38:02 ...es/setting/mailer.go:120:newRegisterMailService() [I] Register Mail Service Enabled
2020/12/09 21:38:02 ...es/setting/mailer.go:131:newNotifyMailService() [I] Notify Mail Service Enabled
2020/12/09 21:38:02 ...s/storage/storage.go:151:initAttachments() [I] Initialising Attachment storage with type:
2020/12/09 21:38:02 ...les/storage/local.go:43:NewLocalStorage() [I] Creating new Local Storage at /usr/local/bin/data/attachments
2020/12/09 21:38:02 main.go:112:main() [F] Failed to run app with [/usr/local/bin/gitea dump -c /etc/gitea/app.ini -f /var/backups/gitea_backup]: mkdir /usr/local/bin/data: permission denied

Description

After upgrading to 1.13.0 from 1.12.x the dump command fails with mkdir /usr/local/bin/data: permission denied error. I think the reason is it tries to create /usr/local/bin/data directory to which git user doesn't have access. I also tried with --tempdir /var/tmp but this doesn't change anything.
Gitea server works fine so far.

Originally created by @Rychu-Pawel on GitHub (Dec 9, 2020). - Gitea version (or commit ref): 1.13.0 (upgraded from 1.12.x) - Operating system: Ubuntu 20.04.1 - Log gist: ``` $ echo "$TMPDIR" $ sudo -u git /usr/local/bin/gitea dump -c /etc/gitea/app.ini -f "/var/backups/gitea_backup" 2020/12/09 21:38:02 ...dules/setting/git.go:91:newGit() [I] Git Version: 2.25.1, Wire Protocol Version 2 Enabled 2020/12/09 21:38:02 ...dules/setting/log.go:297:newLogService() [I] Gitea v1.13.0 built with GNU Make 4.1, go1.15.5 : bindata, sqlite, sqlite_unlock_notify 2020/12/09 21:38:02 ...dules/setting/log.go:343:newLogService() [I] Gitea Log Mode: Console(Console:info) 2020/12/09 21:38:02 ...les/setting/cache.go:70:newCacheService() [I] Cache Service Enabled 2020/12/09 21:38:02 ...les/setting/cache.go:81:newCacheService() [I] Last Commit Cache Service Enabled 2020/12/09 21:38:02 ...s/setting/session.go:63:newSessionService() [I] Session Service Enabled 2020/12/09 21:38:02 ...es/setting/mailer.go:109:newMailService() [I] Mail Service Enabled 2020/12/09 21:38:02 ...es/setting/mailer.go:120:newRegisterMailService() [I] Register Mail Service Enabled 2020/12/09 21:38:02 ...es/setting/mailer.go:131:newNotifyMailService() [I] Notify Mail Service Enabled 2020/12/09 21:38:02 ...s/storage/storage.go:151:initAttachments() [I] Initialising Attachment storage with type: 2020/12/09 21:38:02 ...les/storage/local.go:43:NewLocalStorage() [I] Creating new Local Storage at /usr/local/bin/data/attachments 2020/12/09 21:38:02 main.go:112:main() [F] Failed to run app with [/usr/local/bin/gitea dump -c /etc/gitea/app.ini -f /var/backups/gitea_backup]: mkdir /usr/local/bin/data: permission denied ``` ## Description After upgrading to 1.13.0 from 1.12.x the dump command fails with `mkdir /usr/local/bin/data: permission denied` error. I think the reason is it tries to create `/usr/local/bin/data` directory to which `git` user doesn't have access. I also tried with `--tempdir /var/tmp` but this doesn't change anything. Gitea server works fine so far.
Author
Owner

@Rychu-Pawel commented on GitHub (Dec 9, 2020):

Briefly went through recent PRs and I think my issue may be caused by this one https://github.com/go-gitea/gitea/pull/12813 but can't find anything more in there.
Is there any new configuration I may be missing in app.ini? I can't see anything in the release notes.

@Rychu-Pawel commented on GitHub (Dec 9, 2020): Briefly went through recent PRs and I think my issue may be caused by this one https://github.com/go-gitea/gitea/pull/12813 but can't find anything more in there. Is there any new configuration I may be missing in `app.ini`? I can't see anything in the release notes.
Author
Owner

@zeripath commented on GitHub (Dec 11, 2020):

either add a APP_DATA_PATH to your app.ini or set the --work-path, -w command line option as appropriate. (APP_DATA_PATH defaults to $AppWorkPath/data - which is clearly being determined as /usr/local/bin in this case.)

@zeripath commented on GitHub (Dec 11, 2020): either add a `APP_DATA_PATH` to your app.ini or set the `--work-path`, `-w` command line option as appropriate. (`APP_DATA_PATH` defaults to `$AppWorkPath/data` - which is clearly being determined as `/usr/local/bin` in this case.)
Author
Owner

@Rychu-Pawel commented on GitHub (Dec 13, 2020):

Adding APP_DATA_PATH to app.ini fixed it. Thanks!

@Rychu-Pawel commented on GitHub (Dec 13, 2020): Adding `APP_DATA_PATH` to `app.ini` fixed it. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6492