Skip to content

500 Error when trying to view profiles #321

@ghost

Description

Describe the bug
When viewing your own profile or any other users profile, you receive a 500 error.
https://fqdn/users/XXXXX

To Reproduce
Steps to reproduce the behavior:

  1. Go to Users
  2. Click on any user profile

Any location at http(s)://fqdn/users/xxxxxx

Expected behavior
The User profiles display without a 500 error page.

Screenshots
Exact Error in the logs:

2023-04-12 20:11:43.874	ERROR	/go/src/github.com/answerdev/answer/internal/base/handler/handler.go:36	code: 500, reason: base.database_error, message: , error: pq: invalid input syntax for type bigint: ""
/go/src/github.com/answerdev/answer/internal/repo/answer/answer_repo.go:252 github.com/answerdev/answer/internal/repo/answer.(*answerRepo).SearchList
/go/src/github.com/answerdev/answer/internal/service/answer_common/answer.go:54 github.com/answerdev/answer/internal/service/answer_common.(*AnswerCommon).Search
/go/src/github.com/answerdev/answer/internal/service/question_service.go:817 github.com/answerdev/answer/internal/service.(*QuestionService).SearchUserTopList
/go/src/github.com/answerdev/answer/internal/controller/question_controller.go:499 github.com/answerdev/answer/internal/controller.(*QuestionController).UserTop
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next
/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:66 github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).EjectUserBySiteInfo.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next
/go/src/github.com/answerdev/answer/internal/base/middleware/auth.go:53 github.com/answerdev/answer/internal/base/middleware.(*AuthUserMiddleware).Auth.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/anargu/gin-brotli@v0.0.0-20220116052358-12bf532d5267/gin_brotli.go:71 github.com/anargu/gin-brotli.Brotli.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/context.go:173 github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:616 github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/go/pkg/mod/github.com/gin-gonic/gin@v1.8.1/gin.go:572 github.com/gin-gonic/gin.(*Engine).ServeHTTP
/usr/local/go/src/net/http/server.go:2947 net/http.serverHandler.ServeHTTP
/usr/local/go/src/net/http/server.go:1991 net/http.(*conn).serve
/usr/local/go/src/runtime/asm_amd64.s:1594 runtime.goexit

Platform:

  • Device: Desktop
  • OS: macOS
  • Browser Chrome
  • Version 1.0.8
  • Database Type: Postgres (GCP Cloud SQL)
  • Database Version: 14

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions