Configuration warning prevents clone over ssh #15072

Closed
opened 2025-11-02 11:29:32 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @lenny87 on GitHub (Oct 30, 2025).

Description

If there is a configuration warning, it gets somehow inserted to gitea serv <key-id> call (which is called with git over ssh access) and thus prevents any git over ssh command to work (clone, fetch, push)

~ GIT_TRACE=1 git clone ssh://gitea@*redacted*/*user*/kubespray.git             
20:20:06.841989 git.c:502               trace: built-in: git clone ssh://gitea@*redacted*/*user/kubespray.git                                                                                   
Cloning into 'kubespray'...                                                                               
20:20:06.844444 run-command.c:673       trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL -p 2222 gitea@*redacted* 'git-upload-pack '\''/*user*/kubespray.git'\'''
20:20:06.844460 run-command.c:765       trace: start_command: /usr/bin/ssh -o SendEnv=GIT_PROTOCOL -p 2222 gitea@*redacted* 'git-upload-pack '\''/*user*/kubespray.git'\'''                           
fatal: protocol error: unexpected '/10/30 20:20:07 modules/setting/mirror.go:52:loadMirrorFrom() [W] Mirror.DefaultInterval is less than Mirror.MinInterval, set to 8h0m0s                                           
01405dce75d29b0d292080f9005e1d6e5c1f48cd1171 HEAD'

Gitea Version

1.25.0

Can you reproduce the bug on the Gitea demo site?

No

Steps to reproduce:

  • set some bad configuration which will produce gitea warning, for example:
[mirror]
DEFAULT_INTERVAL = 1h
MIN_INTERVAL = 2h
  • git over ssh stops working

Git Version

2.43.0

Operating System

Ubuntu 24.04

How are you running Gitea?

Running in LXD container from binary release

Database

SQLite

Originally created by @lenny87 on GitHub (Oct 30, 2025). ### Description If there is a configuration warning, it gets somehow inserted to `gitea serv <key-id>` call (which is called with git over ssh access) and thus prevents any git over ssh command to work (clone, fetch, push) ``` ~ GIT_TRACE=1 git clone ssh://gitea@*redacted*/*user*/kubespray.git 20:20:06.841989 git.c:502 trace: built-in: git clone ssh://gitea@*redacted*/*user/kubespray.git Cloning into 'kubespray'... 20:20:06.844444 run-command.c:673 trace: run_command: unset GIT_DIR; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL -p 2222 gitea@*redacted* 'git-upload-pack '\''/*user*/kubespray.git'\''' 20:20:06.844460 run-command.c:765 trace: start_command: /usr/bin/ssh -o SendEnv=GIT_PROTOCOL -p 2222 gitea@*redacted* 'git-upload-pack '\''/*user*/kubespray.git'\''' fatal: protocol error: unexpected '/10/30 20:20:07 modules/setting/mirror.go:52:loadMirrorFrom() [W] Mirror.DefaultInterval is less than Mirror.MinInterval, set to 8h0m0s 01405dce75d29b0d292080f9005e1d6e5c1f48cd1171 HEAD' ``` ### Gitea Version 1.25.0 ### Can you reproduce the bug on the Gitea demo site? No Steps to reproduce: * set some bad configuration which will produce gitea warning, for example: ``` [mirror] DEFAULT_INTERVAL = 1h MIN_INTERVAL = 2h ``` * git over ssh stops working ### Git Version 2.43.0 ### Operating System Ubuntu 24.04 ### How are you running Gitea? Running in LXD container from binary release ### Database SQLite
GiteaMirror added the type/bug label 2025-11-02 11:29:32 -06:00
Author
Owner

@buraktamturk commented on GitHub (Oct 30, 2025):

Opps, I am having the same issue. Pulls and pushes just stall forever, no warning is issued.

I manually run /usr/local/bin/gitea --config=/etc/gitea/app.ini serv key-1 on git user and I found out the warning:

2025/10/30 20:57:18 modules/setting/server.go:262:loadServerFrom() [W] unix PROTOCOL value is deprecated, please use http+unix
Hi there, buraktamturk! You've successfully authenticated with the key named [redacted], but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.

After fixing this pulls and pushes work correctly.

@buraktamturk commented on GitHub (Oct 30, 2025): Opps, I am having the same issue. Pulls and pushes just stall forever, no warning is issued. I manually run `/usr/local/bin/gitea --config=/etc/gitea/app.ini serv key-1` on git user and I found out the warning: ``` 2025/10/30 20:57:18 modules/setting/server.go:262:loadServerFrom() [W] unix PROTOCOL value is deprecated, please use http+unix Hi there, buraktamturk! You've successfully authenticated with the key named [redacted], but Gitea does not provide shell access. If this is unexpected, please log in with password and setup Gitea under another user. ``` After fixing this pulls and pushes work correctly.
Author
Owner

@luke-else commented on GitHub (Oct 30, 2025):

I too have been trying to understand this issue today! Great find. Hopefully an easy fix :)

@luke-else commented on GitHub (Oct 30, 2025): I too have been trying to understand this issue today! Great find. Hopefully an easy fix :)
Author
Owner

@wxiaoguang commented on GitHub (Oct 30, 2025):

Thank you very much. I see the problem now, the fix: Fix cli "Before" handling #35797

Sorry for the inconvenience

@wxiaoguang commented on GitHub (Oct 30, 2025): Thank you very much. I see the problem now, the fix: Fix cli "Before" handling #35797 Sorry for the inconvenience
Author
Owner

@wxiaoguang commented on GitHub (Nov 1, 2025):

Fixed in 1.25 nightly:

@wxiaoguang commented on GitHub (Nov 1, 2025): Fixed in 1.25 nightly: * https://dl.gitea.com/gitea/1.25-nightly/ * https://hub.docker.com/r/gitea/gitea/tags?name=1.25-nightly
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15072