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

Error 500 on /watchers & /stars #2176

Closed
LeKovr opened this issue Dec 13, 2015 · 12 comments
Closed

Error 500 on /watchers & /stars #2176

LeKovr opened this issue Dec 13, 2015 · 12 comments
Labels
💊 bug Something isn't working
Milestone

Comments

@LeKovr
Copy link

LeKovr commented Dec 13, 2015

I open project page and click to watcher or start counter. This gives me error 500 (both org/repo/watchers and org/repo/stars)
in logs:

...routers/repo/view.go:262 renderItems()] [E] getter: pq: syntax error at or near "."

Gogs v0.7.33
DB: Postgresql 9.3.10

@LeKovr
Copy link
Author

LeKovr commented Dec 13, 2015

The same error in Gogs v 0.8.0.1212

@unknwon
Copy link
Member

unknwon commented Dec 13, 2015

Thanks your feedback!

Can you dump the xorm.log here as well?

@unknwon unknwon added 💊 bug Something isn't working status: needs feedback Tell me more about it labels Dec 13, 2015
@unknwon unknwon added this to the 0.9.0 milestone Dec 13, 2015
@LeKovr
Copy link
Author

LeKovr commented Dec 13, 2015

For this gogs.log record:

2015/12/14 01:34:13 [...routers/repo/view.go:260 renderItems()] [E] getter: pq: syntax error at or near "."

attached xorm.log.txt

@unknwon
Copy link
Member

unknwon commented Dec 13, 2015

Thanks!

Is this a valid SQL query in PostgreSQL?

SELECT * FROM "user" LEFT JOIN "watch" ON user.id=watch.user_id WHERE repo_id=1

If not, can you help debug which part is exactly wrong? The error from pg is so disappointing...

@LeKovr
Copy link
Author

LeKovr commented Dec 13, 2015

No, this is invalid SQL.
You should use this

SELECT * FROM "user"  LEFT JOIN "watch" ON "user".id=watch.user_id WHERE repo_id=1;

or even

SELECT * FROM "user" u LEFT JOIN "watch" ON u.id=watch.user_id WHERE repo_id=1;

@unknwon
Copy link
Member

unknwon commented Dec 13, 2015

Thanks, the user is the problem I'm thinking.

Does

SELECT * FROM "user"  LEFT JOIN "watch" ON `user`.id=watch.user_id WHERE repo_id=1;

would work?

@LeKovr
Copy link
Author

LeKovr commented Dec 14, 2015

Nope, only double quotes allowed. And user must be doublequoted - it is keyword

@unknwon
Copy link
Member

unknwon commented Dec 14, 2015

Hi, can you checkout develop branch and help test?

@LeKovr
Copy link
Author

LeKovr commented Dec 14, 2015

Yes I can)

@LeKovr
Copy link
Author

LeKovr commented Dec 14, 2015

Develop branch works fine. Thank you, Unknwon!

@LeKovr LeKovr closed this as completed Dec 14, 2015
@unknwon
Copy link
Member

unknwon commented Dec 14, 2015

👏 Thanks your confirmation!

@unknwon unknwon removed the status: needs feedback Tell me more about it label Dec 14, 2015
@kolesar-andras
Copy link

I have got the same error 500, and the same message in xorm.log. Thank you for the fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants