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

Mentionin you error #8231

Closed
jaqra opened this issue Sep 18, 2019 · 20 comments · Fixed by #8347
Closed

Mentionin you error #8231

jaqra opened this issue Sep 18, 2019 · 20 comments · Fixed by #8347
Labels
Milestone

Comments

@jaqra
Copy link
Contributor

jaqra commented Sep 18, 2019

After #8201 i check mentionin you group on try.gitea.io. but response 500 status code

When i check same repo on local there is no error, works well 🤔

@guillep2k
Copy link
Member

Can you give us the URL? Perhaps an admin can check the logs

@lunny lunny added the type/bug label Sep 19, 2019
@guillep2k
Copy link
Member

Here's a link.
https://try.gitea.io/issues?type=mentioned&repo=0&sort=&state=open
I've just registered a new test user (no activity) and the server error shows up immediately.

@guillep2k
Copy link
Member

The error is not showing on my dev server, neither with an old user or a new one.

@lunny lunny added this to the 1.10.0 milestone Sep 19, 2019
@guillep2k
Copy link
Member

@lunny is it possible to get the log from try.gitea.io?

@lunny
Copy link
Member

lunny commented Sep 19, 2019

@guillep2k It seems try.gitea.io's log is misconfiguration. I cannot find error stack information.

@jaqra
Copy link
Contributor Author

jaqra commented Sep 27, 2019

i created a user on gitea.com and there is no any error with that

@lunny
Copy link
Member

lunny commented Sep 27, 2019

@jaqra gitea.com hasn't been updated to a recent version since there are serval bugs. But I tested it locally and I cannot reproduce this.

@jaqra
Copy link
Contributor Author

jaqra commented Sep 27, 2019

ahh sorryy

@lunny
Copy link
Member

lunny commented Sep 27, 2019

@jaqra @guillep2k could you confirm your local instance could reproduce this?

@guillep2k
Copy link
Member

@lunny No, I couldn't reproduce it locally. So far the only place the problem showed up is on try.gitea.io.

@jaqra
Copy link
Contributor Author

jaqra commented Sep 27, 2019

@lunny no. with sqlite db

@guillep2k
Copy link
Member

In my case I use PostgreSQL

@guillep2k
Copy link
Member

@jaqra with the help from @techknowlogick this is an excerpt of the log from the server with the error:

https://gist.github.com/techknowlogick/39b137e092c80c04212ff3c398ed4d86

SELECT count(*) FROM `issue`
INNER JOIN issue_user ON issue.id = issue_user.issue_id and issue_user.is_mentioned = ?
WHERE issue.is_pull=? AND (is_closed = ?) AND (issue_user.uid = ?)

{true, false, false, 4940}

routers/user/home.go:352:Issues() [E] GetUserIssueStats: ambiguous column name: is_closed

It looks like try.gitea.io has some extra columns in the database (in particular issue_user seems to have a is_closed column). It might be a leftover from some old migration.

@lunny is there anything that can be done about it?

@lunny
Copy link
Member

lunny commented Oct 2, 2019

OK. The problem is we should use issue.is_closed but not is_closed on models/issue.go:1673.

case FilterModeCreate:
		stats.OpenCount, err = x.Where(cond).And("is_closed = ?", false).
			And("poster_id = ?", opts.UserID).
			Count(new(Issue))
		if err != nil {
			return nil, err
		}
		stats.ClosedCount, err = x.Where(cond).And("is_closed = ?", true).
			And("poster_id = ?", opts.UserID).
			Count(new(Issue))
		if err != nil {
			return nil, err
		}

@guillep2k
Copy link
Member

@lunny I've thought the same thing, but I can't explain why the error happens. There should be no two is_closed columns in that query.

It's not bad to patch those queries, though.

@guillep2k
Copy link
Member

I'll make a PR for that.

@lunny
Copy link
Member

lunny commented Oct 2, 2019

When you have a join, some database ask you indicate which database's columns on the SQL even there is no conflict column names I guess.

@lunny
Copy link
Member

lunny commented Oct 2, 2019

And I think add a test for metion mode on func TestGetUserIssueStats(t *testing.T) will be better.

@guillep2k
Copy link
Member

@lunny try.gitea.io is still failing. I'd wait until it gets this commit?

@guillep2k
Copy link
Member

@lunny try.gitea.io is still failing. I'd wait until it gets this commit?

FIXED!!! 😄

@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.

2 participants