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

Browsing to an uninitialized repository results in "System Notice" about editorconfig #7943

Closed
2 of 7 tasks
seanenck opened this issue Aug 22, 2019 · 5 comments · Fixed by #9010
Closed
2 of 7 tasks
Labels
Milestone

Comments

@seanenck
Copy link

seanenck commented Aug 22, 2019

  • Gitea version (or commit ref): 1.9.1
  • Git version: 2.20
  • Operating system: Debian buster
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No (as it requires admin rights to view system notices)
    • Not relevant
  • Log gist:

Description

  1. I have a repository that is not initialized
  2. When I browse to it in the Web UI it shows the page about being not initialized
  3. This is causing a "System Notice" about editorconfig to occur in the admin panel (I believe this is a bug)
Error while getting .editorconfig file: reference not found...
@lunny
Copy link
Member

lunny commented Aug 23, 2019

related with #7938

@mrsdizzie
Copy link
Member

mrsdizzie commented Aug 26, 2019

#6478 is the commit that caused this to start happening, but the system warning code has been in middleware for years now.

What happenes in #6478 is that it changes the error in ctx.Repo.GetEditorconfig() here:

ec, err := ctx.Repo.GetEditorconfig()
if err != nil && !git.IsErrNotExist(err) {
description := fmt.Sprintf("Error while getting .editorconfig file: %v", err)
if err := models.CreateRepositoryNotice(description); err != nil {
ctx.ServerError("ErrCreatingReporitoryNotice", err)
}
return
}

From: object does not exist [id: refs/heads/master, rel_path: ]

To: reference not found

Which then trips the !git.IsErrNotExist(err) check:

// IsErrNotExist if some error is ErrNotExist
func IsErrNotExist(err error) bool {
_, ok := err.(ErrNotExist)
return ok
}
func (err ErrNotExist) Error() string {
return fmt.Sprintf("object does not exist [id: %s, rel_path: %s]", err.ID, err.RelPath)
}

I'm not sure if IsErrNotExist needs to be updated here as I'm not familiar with all the git plumbing code.

Separate from that, not really sure this needs to be a system notice either -- but it has been like that for years now and only recently is this check failing. Perhaps @filipnavara has more insight to the error change as they authored the commit where this started.

@lunny lunny added the type/bug label Aug 29, 2019
@stale
Copy link

stale bot commented Oct 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Oct 28, 2019
@seanenck
Copy link
Author

This is still opened, until something changes you'll continue to see potentially confusing/untrackable System Notices about this

@WozSoftware
Copy link

Just installed 1.9.6 with MSSql and can confirm get the same issue

@lunny lunny added this to the 1.10.1 milestone Nov 15, 2019
@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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants