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

In gitea serv switch off console logger to fix #5866 #5887

Merged
merged 3 commits into from Feb 3, 2019

Conversation

7 participants
@zeripath
Copy link
Contributor

zeripath commented Jan 28, 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

Fix #5866

Signed-off-by: Andrew Thornton art27@cantab.net

In serv.go switch off console logger to fix #5866
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 <art27@cantab.net>
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 28, 2019

Codecov Report

Merging #5887 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5887      +/-   ##
==========================================
+ Coverage   38.27%   38.29%   +0.01%     
==========================================
  Files         330      330              
  Lines       48518    48518              
==========================================
+ Hits        18572    18578       +6     
+ Misses      27273    27266       -7     
- Partials     2673     2674       +1
Impacted Files Coverage Δ
routers/repo/view.go 47.3% <0%> (+1.19%) ⬆️
models/unit.go 14.28% <0%> (+14.28%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f81c6cc...1b1bc05. Read the comment docs.

@zeripath zeripath added the kind/bug label Jan 28, 2019

@techknowlogick techknowlogick added this to the 1.8.0 milestone Jan 30, 2019

@lunny

This comment has been minimized.

Copy link
Member

lunny commented Feb 1, 2019

Maybe del the logger after setting.NewContext()?

@zeripath

This comment has been minimized.

Copy link
Contributor Author

zeripath commented Feb 1, 2019

setting.NewContext() is emitting the warnings. Hence the console logger must be deleted before this.

I think it's fine for Gitea serv to be silent for these warnings - it's not meant to be used by humans. Emitting anything on the console will break git causing it to hang on the client.

@zeripath

This comment has been minimized.

Copy link
Contributor Author

zeripath commented Feb 2, 2019

Basically without this PR - If warnings are emitted because of a minor problem in app.ini that doesn't stop gitea from running - you cannot push or pull over ssh.

@GiteaBot GiteaBot added lgtm/need 1 and removed lgtm/need 2 labels Feb 3, 2019

@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Feb 3, 2019

@zeripath zeripath merged commit 2902b3a into go-gitea:master Feb 3, 2019

2 checks passed

approvals/lgtm this commit looks good
continuous-integration/drone/pr the build was successful
Details

@zeripath zeripath deleted the zeripath:issue-5866-switch-off-console-logging-in-serv branch Feb 3, 2019

zeripath added a commit to zeripath/gitea that referenced this pull request Feb 3, 2019

Fix go-gitea#5866: Silence console logger in gitea serv (go-gitea#5887)
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 <art27@cantab.net>

techknowlogick added a commit that referenced this pull request Feb 3, 2019

Fix #5866: Silence console logger in gitea serv (#5887) (#5943)
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 <art27@cantab.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment