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

Git clone via SSH hangs when markup.asciidoc is partially defined in config #5866

Closed
2 of 7 tasks
dllud opened this issue Jan 27, 2019 · 1 comment · Fixed by #5887
Closed
2 of 7 tasks

Git clone via SSH hangs when markup.asciidoc is partially defined in config #5866

dllud opened this issue Jan 27, 2019 · 1 comment · Fixed by #5887
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug

Comments

@dllud
Copy link

dllud commented Jan 27, 2019

  • Gitea version (or commit ref): 1.7.0
  • Git version: 2.11.0
  • Operating system: Debian 9 (stable)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Adding the markup.asciidoc section to the app.ini config file without having all properties defined causes git clone via ssh to hang.
I bumped into this issue after adding the markup.asciidoc section to my old config file, but I was able to reproduce the issue on a new installation with a config file generated from scratch by gitea 1.7.0.

Adding the section, with all properties defined, causes no problem (example bellow):

[markup.asciidoc]
ENABLED = false
; List of file extensions that should be rendered by an external command
FILE_EXTENSIONS = .adoc,.asciidoc
; External command to render all matching extensions
RENDER_COMMAND = "asciidoc --out-file=- -"
; Don't pass the file on STDIN, pass the filename as argument instead.
IS_INPUT_FILE = false

Commenting or deleting just one property causes the hang:

[markup.asciidoc]
ENABLED = false
; List of file extensions that should be rendered by an external command
;FILE_EXTENSIONS = .adoc,.asciidoc
; External command to render all matching extensions
RENDER_COMMAND = "asciidoc --out-file=- -"
; Don't pass the file on STDIN, pass the filename as argument instead.
IS_INPUT_FILE = false

Even adding just the section header causes ssh git clone to hang:

[markup.asciidoc]

This issue seems related to #5386.

@zeripath
Copy link
Contributor

The problem is caused by any log.Warn in func NewContext() in setting.go.

The issue is that these are outputted on stdout which confuses git.

zeripath added a commit to zeripath/gitea that referenced this issue Jan 28, 2019
By default warning logs are printed to the stdout which breaks a git receive-pack etc.
This PR disables the console logger whilst in serv.go

Signed-off-by: Andrew Thornton <[email protected]>
@zeripath zeripath added type/bug in progress issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Jan 28, 2019
zeripath added a commit that referenced this issue Feb 3, 2019
By default, if `setting.NewContext()` prints out any warning logs, these are printed to the stdout breaking `git receive-pack` etc. meaning that even if there is a warning because of a minor problem in your app.ini but gitea starts despite this - you **CANNOT** push or pull over SSH.

This PR disables the console logger whilst in `serv.go`

Signed-off-by: Andrew Thornton <[email protected]>
zeripath added a commit to zeripath/gitea that referenced this issue Feb 3, 2019
By default, if `setting.NewContext()` prints out any warning logs, these are printed to the stdout breaking `git receive-pack` etc. meaning that even if there is a warning because of a minor problem in your app.ini but gitea starts despite this - you **CANNOT** push or pull over SSH.

This PR disables the console logger whilst in `serv.go`

Signed-off-by: Andrew Thornton <[email protected]>
techknowlogick pushed a commit that referenced this issue Feb 3, 2019
By default, if `setting.NewContext()` prints out any warning logs, these are printed to the stdout breaking `git receive-pack` etc. meaning that even if there is a warning because of a minor problem in your app.ini but gitea starts despite this - you **CANNOT** push or pull over SSH.

This PR disables the console logger whilst in `serv.go`

Signed-off-by: Andrew Thornton <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants