Working Directory Issue After Hard Disk Migration #8112

Closed
opened 2025-11-02 07:54:14 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @kiyospace on GitHub (Nov 16, 2021).

Gitea Version

gitea-1.15.6-linux-amd64

Git Version

git version 2.30.2

Operating System

debian 11.1

How are you running Gitea?

I am running Gitea with the binary downloaded from https://dl.gitea.io/gitea directly on Debian 11.1 x64 as a System Service (with MariaDB and NGINX)

  • Debian 11.1 (bullseye) 5.10.70-1 (2021-09-30) x86_64
  • gitea-1.15.6-linux-amd64 (from https://dl.gitea.io/gitea/1.15.6)
  • git version 2.30.2 (installed from Debian apt)
  • mariadb Ver 15.1 Distrib 10.5.12-MariaDB
  • nginx version: nginx/1.18.0

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

I have been running gitea under the same Debian machine with the same configuration for quite a while, and it has been running without issues. Recently I had to upgrade my hard disk (say... /old_hdd) to a new one due to lack of free space, so I rsync'd (rsync -av) the whole gitea folder (say ... /old_hdd/gitea) to the new disk (say ... /new_hdd/gitea). /old_hdd was removed after the transition.

I changed everything (WorkingDirectory, ExecStart, --config, --custom-path, GITEA_WORK_DIR) related to the path change in my gitea.service under /etc/systemd/system/, as well as path settings (PATH under [database], ROOT under [repository], LFS_CONTENT_PATH under [server], ROOT_PATH under [log]) in Gitea app.ini accordingly and did daemon-reload and service restart several times.

After all these changes, I can visit Gitea (access, login, view repo contents, download repo contents) via HTTP (HTTPS), but when I try to pull and push via SSH, following error message appeared,

...s/setting/setting.go:1164:CreateOrAppendToCustomConf() [F] failed to create '/old_hdd/gitea/conf/app.ini': mkdir /old_hdd: permission denied
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Anywhere else I forgot to change?

Screenshots

No response

Originally created by @kiyospace on GitHub (Nov 16, 2021). ### Gitea Version gitea-1.15.6-linux-amd64 ### Git Version git version 2.30.2 ### Operating System debian 11.1 ### How are you running Gitea? I am running Gitea with the binary downloaded from https://dl.gitea.io/gitea directly on Debian 11.1 x64 as a System Service (with MariaDB and NGINX) - Debian 11.1 (bullseye) 5.10.70-1 (2021-09-30) x86_64 - gitea-1.15.6-linux-amd64 (from https://dl.gitea.io/gitea/1.15.6) - git version 2.30.2 (installed from Debian apt) - mariadb Ver 15.1 Distrib 10.5.12-MariaDB - nginx version: nginx/1.18.0 ### Database MySQL ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description I have been running gitea under the same Debian machine with the same configuration for quite a while, and it has been running without issues. Recently I had to upgrade my hard disk (say... `/old_hdd`) to a new one due to lack of free space, so I rsync'd (rsync -av) the whole gitea folder (say ... `/old_hdd/gitea`) to the new disk (say ... `/new_hdd/gitea`). `/old_hdd` was removed after the transition. I changed everything (`WorkingDirectory`, `ExecStart`, `--config`, `--custom-path`, `GITEA_WORK_DIR`) related to the path change in my `gitea.service` under `/etc/systemd/system/`, as well as path settings (`PATH` under `[database]`, `ROOT` under `[repository]`, `LFS_CONTENT_PATH` under `[server]`, `ROOT_PATH` under `[log]`) in Gitea `app.ini` accordingly and did daemon-reload and service restart several times. After all these changes, I can visit Gitea (access, login, view repo contents, download repo contents) via HTTP (HTTPS), but when I try to pull and push via SSH, following error message appeared, ``` ...s/setting/setting.go:1164:CreateOrAppendToCustomConf() [F] failed to create '/old_hdd/gitea/conf/app.ini': mkdir /old_hdd: permission denied fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` Anywhere else I forgot to change? ### Screenshots _No response_
Author
Owner

@techknowlogick commented on GitHub (Nov 16, 2021):

In the admin dashboard there are two buttons you'll need to select. 1. Is "resync authorized key file", and 2 is "resync git hooks"

@techknowlogick commented on GitHub (Nov 16, 2021): In the admin dashboard there are two buttons you'll need to select. 1. Is "resync authorized key file", and 2 is "resync git hooks"
Author
Owner

@kiyospace commented on GitHub (Nov 16, 2021):

In the admin dashboard there are two buttons you'll need to select. 1. Is "resync authorized key file", and 2 is "resync git hooks"

Thanks! Solved. Closing.

I did "Resynchronize pre-receive, update and post-receive hooks of all repositories." on Web Admin Dashboard before but it didn't help.

It turns out I need as well to

  • Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.)
  • Update the '.ssh/authorized_principals' file with Gitea SSH principals. (Not needed for the built-in SSH server.)
@kiyospace commented on GitHub (Nov 16, 2021): > In the admin dashboard there are two buttons you'll need to select. 1. Is "resync authorized key file", and 2 is "resync git hooks" Thanks! Solved. Closing. I did "Resynchronize pre-receive, update and post-receive hooks of all repositories." on Web Admin Dashboard before but it didn't help. It turns out I need as well to - Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.) - Update the '.ssh/authorized_principals' file with Gitea SSH principals. (Not needed for the built-in SSH server.)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8112