Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not read from remote repository" after update to 1.20.2 #26516

Closed
veita opened this issue Aug 15, 2023 · 5 comments
Closed

"Could not read from remote repository" after update to 1.20.2 #26516

veita opened this issue Aug 15, 2023 · 5 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@veita
Copy link

veita commented Aug 15, 2023

Description

After update to 1.20.2 Git commands like git clone failed with message "could not read from remote repository".

Trying to connect with ssh [email protected] revealed the error behind the error:

PTY allocation request failed on channel 0
2023/08/15 10:35:41 ...s/setting/setting.go:109:LoadCommonSettings()
[F] Unable to load settings from config: unable to create chunked upload directory:
/usr/local/bin/data/tmp/package-upload (mkdir /usr/local/bin/data: permission denied)
Connection to host.example.org closed.

/usr/local/bin/ is the location of the Gitea binary. It has permissions drwxr-xr-x.

The running Gitea instance reports

App Data Path          /var/lib/gitea/data
Repository Root Path   /repo/gitea
Custom File Root Path  /var/lib/gitea/custom
Log Path               /var/log/gitea

on its web GUI.

The working directory of the Gitea process is /var/lib/gitea.

CHUNKED_UPLOAD_PATH is not present in app.ini. INSTALL_LOCK is set to true.

Gitea Version

1.20.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

git version 2.39.2

Operating System

Debian 12 Bookworm

How are you running Gitea?

Gitea binary downloaded from https://github.com/go-gitea/gitea/releases/download/ and run as a Systemd service as user gitea.

Database

PostgreSQL

@veita veita added the type/bug label Aug 15, 2023
@veita
Copy link
Author

veita commented Aug 15, 2023

A workaround for this bug is to explicitly set

[packages]
CHUNKED_UPLOAD_PATH = /var/lib/gitea/data/tmp/package-upload

in app.ini. This is the default value as an absolute path. Using tmp/package-upload instead does not work.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 15, 2023

Check your gitea web's startup message. You might need to set your WORK_PATH in your app.ini correctly.

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Aug 15, 2023
@veita
Copy link
Author

veita commented Aug 15, 2023

You might need to set your WORK_PATH in your app.ini correctly.

WORK_PATH was not present in app.ini. Setting it also solves the problem.

Thank you very much!

@veita
Copy link
Author

veita commented Aug 15, 2023

The Systemd unit file used is based on https://github.com/go-gitea/gitea/blob/main/contrib/systemd/gitea.service.

WorkingDirectory=/var/lib/gitea/
ExecStart=/usr/local/bin/gitea web -c /etc/gitea/app.ini
Environment=USER=gitea HOME=/home/gitea GITEA_WORK_DIR=/var/lib/gitea GITEA_CUSTOM=/var/lib/gitea/custom

It seems that neither WorkingDirectory nor GITEA_WORK_DIR do have the expected effect in 1.20.2.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Aug 15, 2023

It seems that neither WorkingDirectory nor GITEA_WORK_DIR do have the expected effect in 1.20.2.

GITEA_WORK_DIR still have effects, but they do not have effect on "ssh" related commands (they didn't in old versions either, and only caused bugs)

The work-path problem is quite longstanding, it used to cause various unfixable bugs. 1.20.x has a complete fix for it:

That PR has been marked as "breaking", while it should be pretty transparent to users whose Gitea instance could write its app.ini.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

2 participants