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

Record not found error #30

Open
Ali-l opened this issue Aug 16, 2022 · 5 comments
Open

Record not found error #30

Ali-l opened this issue Aug 16, 2022 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@Ali-l
Copy link

Ali-l commented Aug 16, 2022

Hi I'd love to try this project but I keep getting a record not found error

IMG_20220816_111934.jpg

Would you know how to resolve this ?

@meloalright
Copy link
Owner

Can u show error logs on server?

@Ali-l
Copy link
Author

Ali-l commented Aug 22, 2022

Hi @meloalright !
Hope you are having a good week! Also wow, I did not expect anyone to respond! I will spin up the server and try it again I originally tried the docker version but that gave a few redis error and I did not know how to fix those. Let me try a without docker install and get you the logs.

@Ali-l
Copy link
Author

Ali-l commented Aug 22, 2022

Here is the first error I face right after setting up pre-requisites for guora:

Note: I am running Ubuntu 22.04.1

tiny@tiny-Aspire-5755G:~/gitStuff/guora$ sudo go run ./cmd/guora -init
go: downloading github.com/gin-gonic/gin v1.6.3
go: downloading github.com/spf13/viper v1.7.1
go: downloading golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
go: downloading github.com/go-redis/redis/v8 v8.0.0-beta.7
go: downloading github.com/jinzhu/gorm v1.9.15
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: downloading github.com/fsnotify/fsnotify v1.4.7
go: downloading github.com/hashicorp/hcl v1.0.0
go: downloading github.com/magiconair/properties v1.8.1
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: downloading github.com/pelletier/go-toml v1.2.0
go: downloading github.com/spf13/afero v1.1.2
go: downloading github.com/spf13/cast v1.3.0
go: downloading github.com/spf13/jwalterweatherman v1.0.0
go: downloading github.com/spf13/pflag v1.0.3
go: downloading github.com/subosito/gotenv v1.2.0
go: downloading gopkg.in/ini.v1 v1.51.0
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/gin-contrib/sse v0.1.0
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/go-sql-driver/mysql v1.5.0
go: downloading github.com/lib/pq v1.1.1
go: downloading github.com/mattn/go-sqlite3 v1.14.0
go: downloading github.com/jinzhu/inflection v1.0.0
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/dgryski/go-rendezvous v0.0.0-20200624174652-8d2f3be8b2d9
go: downloading golang.org/x/exp v0.0.0-20200513190911-00229845015e
go: downloading github.com/cespare/xxhash v1.1.0
go: downloading golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd
go: downloading golang.org/x/text v0.3.2
go: downloading github.com/go-playground/validator/v10 v10.2.0
go: downloading github.com/golang/protobuf v1.4.2
go: downloading github.com/ugorji/go/codec v1.1.7
go: downloading go.opentelemetry.io/otel v0.7.0
go: downloading github.com/ugorji/go v1.1.7
go: downloading github.com/go-playground/universal-translator v0.17.0
go: downloading github.com/leodido/go-urn v1.2.0
go: downloading google.golang.org/protobuf v1.23.0
go: downloading google.golang.org/grpc v1.30.0
go: downloading github.com/go-playground/locales v0.13.0
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:129019:10: warning: function may return address of local variable [-Wreturn-local-addr]
129019 |   return pNew;
       |          ^~~~
sqlite3-binding.c:128979:10: note: declared here
128979 |   Select standin;
       |          ^~~~~~~
Configuration.conf &{{sqlite3 ./guora.db} {localhost:6379  0} {gadisInCharge [email protected] test123} :8080 en topsecret}

[2022-08-22 13:52:10] [info] removing callback `gorm:update_time_stamp` from /home/tiny/gitStuff/guora/internal/database/db.go:24  

[2022-08-22 13:52:10] [info] removing callback `gorm:update_time_stamp` from /home/tiny/gitStuff/guora/internal/database/db.go:25  
2022/08/22 13:52:10 [redis]: error dial tcp 127.0.0.1:6379: connect: connection refused
panic: failed to connect redis

goroutine 1 [running]:
github.com/meloalright/guora/internal/database.init.1()
        /home/tiny/gitStuff/guora/internal/database/redisdb.go:26 +0x1a5
exit status 2

At the bottom of log is redis error. This same error happens on docker deploy as well. I looked this up and setup both redis and sqlite3 manually. After setting up both I run the command sudo go run ./cmd/guora/ -init and Now I can access development site. But get the screenshot I gave on top and now the server msgs are these:

tiny@tiny-Aspire-5755G:~/gitStuff/guora$ sudo go run ./cmd/guora/ -init
# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function ‘sqlite3SelectNew’:
sqlite3-binding.c:129019:10: warning: function may return address of local variable [-Wreturn-local-addr]
129019 |   return pNew;
       |          ^~~~
sqlite3-binding.c:128979:10: note: declared here
128979 |   Select standin;
       |          ^~~~~~~
Configuration.conf &{{sqlite3 ./guora.db} {localhost:6379  0} {gadisInCharge [email protected] test123} :8080 en topsecret}

[2022-08-22 16:15:39] [info] removing callback `gorm:update_time_stamp` from /home/tiny/gitStuff/guora/internal/database/db.go:24  

[2022-08-22 16:15:39] [info] removing callback `gorm:update_time_stamp` from /home/tiny/gitStuff/guora/internal/database/db.go:25  
2022/08/22 16:15:39 [redis]: dbsize 0
redis flushdb.
db has the table user, so drop it.
db has the table profile, so drop it.
db has the table question, so drop it.
db has the table answer, so drop it.
db has the table comment, so drop it.
db has the table reply, so drop it.
db has the table supporter, so drop it.
already restarted.
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] POST   /api/web/security/sign    --> github.com/meloalright/guora/internal/controller/web.SecuritySign (4 handlers)
[GIN-debug] POST   /api/web/security/login   --> github.com/meloalright/guora/internal/controller/web.SecurityLogin (4 handlers)
[GIN-debug] POST   /api/web/security/logout  --> github.com/meloalright/guora/internal/controller/web.SecurityLogout (4 handlers)
[GIN-debug] POST   /api/web/question         --> github.com/meloalright/guora/internal/controller/web.CreateQuestion (5 handlers)
[GIN-debug] POST   /api/web/answer           --> github.com/meloalright/guora/internal/controller/web.CreateAnswer (5 handlers)
[GIN-debug] POST   /api/web/answer/:id/supporters --> github.com/meloalright/guora/internal/controller/web.CreateSupporter (5 handlers)
[GIN-debug] DELETE /api/web/answer/:id/supporters --> github.com/meloalright/guora/internal/controller/web.DeleteSupporter (5 handlers)
[GIN-debug] POST   /api/web/comment          --> github.com/meloalright/guora/internal/controller/web.CreateComment (5 handlers)
[GIN-debug] POST   /api/web/reply            --> github.com/meloalright/guora/internal/controller/web.CreateReply (5 handlers)
[GIN-debug] POST   /api/web/file/avatar      --> github.com/meloalright/guora/internal/controller/web.FileAvatarResolve (5 handlers)
[GIN-debug] GET    /api/rest/user/:id        --> github.com/meloalright/guora/internal/controller/rest.GetUser (5 handlers)
[GIN-debug] GET    /api/rest/users           --> github.com/meloalright/guora/internal/controller/rest.GetUsers (5 handlers)
[GIN-debug] GET    /api/rest/users/counts    --> github.com/meloalright/guora/internal/controller/rest.GetUsersCounts (5 handlers)
[GIN-debug] PUT    /api/rest/user/:id        --> github.com/meloalright/guora/internal/controller/rest.UpdateUser (5 handlers)
[GIN-debug] DELETE /api/rest/user/:id        --> github.com/meloalright/guora/internal/controller/rest.DeleteUser (5 handlers)
[GIN-debug] GET    /api/rest/profile/:id     --> github.com/meloalright/guora/internal/controller/rest.GetProfile (5 handlers)
[GIN-debug] GET    /api/rest/profiles        --> github.com/meloalright/guora/internal/controller/rest.GetProfiles (5 handlers)
[GIN-debug] GET    /api/rest/profiles/counts --> github.com/meloalright/guora/internal/controller/rest.GetProfilesCounts (5 handlers)
[GIN-debug] PUT    /api/rest/profile/:id     --> github.com/meloalright/guora/internal/controller/rest.UpdateProfile (5 handlers)
[GIN-debug] DELETE /api/rest/profile/:id     --> github.com/meloalright/guora/internal/controller/rest.DeleteProfile (5 handlers)
[GIN-debug] GET    /api/rest/question/:id    --> github.com/meloalright/guora/internal/controller/rest.GetQuestion (5 handlers)
[GIN-debug] GET    /api/rest/questions       --> github.com/meloalright/guora/internal/controller/rest.GetQuestions (5 handlers)
[GIN-debug] GET    /api/rest/questions/counts --> github.com/meloalright/guora/internal/controller/rest.GetQuestionsCounts (5 handlers)
[GIN-debug] PUT    /api/rest/question/:id    --> github.com/meloalright/guora/internal/controller/rest.UpdateQuestion (5 handlers)
[GIN-debug] DELETE /api/rest/question/:id    --> github.com/meloalright/guora/internal/controller/rest.DeleteQuestion (5 handlers)
[GIN-debug] GET    /api/rest/answer/:id      --> github.com/meloalright/guora/internal/controller/rest.GetAnswer (5 handlers)
[GIN-debug] GET    /api/rest/answers         --> github.com/meloalright/guora/internal/controller/rest.GetAnswers (5 handlers)
[GIN-debug] GET    /api/rest/answers/counts  --> github.com/meloalright/guora/internal/controller/rest.GetAnswersCounts (5 handlers)
[GIN-debug] PUT    /api/rest/answer/:id      --> github.com/meloalright/guora/internal/controller/rest.UpdateAnswer (5 handlers)
[GIN-debug] DELETE /api/rest/answer/:id      --> github.com/meloalright/guora/internal/controller/rest.DeleteAnswer (5 handlers)
[GIN-debug] GET    /api/rest/comment/:id     --> github.com/meloalright/guora/internal/controller/rest.GetComment (5 handlers)
[GIN-debug] GET    /api/rest/comments        --> github.com/meloalright/guora/internal/controller/rest.GetComments (5 handlers)
[GIN-debug] GET    /api/rest/comments/counts --> github.com/meloalright/guora/internal/controller/rest.GetCommentsCounts (5 handlers)
[GIN-debug] PUT    /api/rest/comment/:id     --> github.com/meloalright/guora/internal/controller/rest.UpdateComment (5 handlers)
[GIN-debug] DELETE /api/rest/comment/:id     --> github.com/meloalright/guora/internal/controller/rest.DeleteComment (5 handlers)
[GIN-debug] GET    /api/rest/reply/:id       --> github.com/meloalright/guora/internal/controller/rest.GetReply (5 handlers)
[GIN-debug] GET    /api/rest/replies         --> github.com/meloalright/guora/internal/controller/rest.GetReplies (5 handlers)
[GIN-debug] GET    /api/rest/replies/counts  --> github.com/meloalright/guora/internal/controller/rest.GetRepliesCounts (5 handlers)
[GIN-debug] PUT    /api/rest/reply/:id       --> github.com/meloalright/guora/internal/controller/rest.UpdateReply (5 handlers)
[GIN-debug] DELETE /api/rest/reply/:id       --> github.com/meloalright/guora/internal/controller/rest.DeleteReply (5 handlers)
[GIN-debug] Loaded HTML Templates (8): 
        - answer.html
        - error.html
        - index.html
        - login.html
        - profile.html
        - question.html
        - 
        - admin.html

[GIN-debug] GET    /static/*filepath         --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (4 handlers)
[GIN-debug] HEAD   /static/*filepath         --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (4 handlers)
[GIN-debug] GET    /                         --> github.com/meloalright/guora/internal/view.Index (5 handlers)
[GIN-debug] GET    /profile                  --> github.com/meloalright/guora/internal/view.Profile (5 handlers)
[GIN-debug] GET    /question                 --> github.com/meloalright/guora/internal/view.Question (5 handlers)
[GIN-debug] GET    /answer                   --> github.com/meloalright/guora/internal/view.Answer (5 handlers)
[GIN-debug] GET    /admin                    --> github.com/meloalright/guora/internal/view.Admin (6 handlers)
[GIN-debug] GET    /login                    --> github.com/meloalright/guora/internal/view.Login (4 handlers)
[GIN-debug] GET    /error                    --> github.com/meloalright/guora/internal/view.Error (4 handlers)
[GIN-debug] Listening and serving HTTP on :8080
2022/08/22 16:15:45 latency: 762.014µs
[GIN] 2022/08/22 - 16:15:45 | 200 |      797.38µs |       127.0.0.1 | GET      "/login"
2022/08/22 16:15:58 record not found
2022/08/22 16:15:58 latency: 526.258µs
[GIN] 2022/08/22 - 16:15:58 | 200 |     541.412µs |       127.0.0.1 | POST     "/api/web/security/login"


I am not sure what step is missing - do let me know and thank you for making this project!

@meloalright meloalright added bug Something isn't working help wanted Extra attention is needed and removed bug Something isn't working labels Aug 24, 2022
@meloalright
Copy link
Owner

meloalright commented Aug 24, 2022

I think u maybe logged with an email that did not exist.

Your admin configuration is based on the mail in this initial logs {gadisInCharge [email protected] test123}

image

Maybe you should log in with the admin mail first,

and create another user count in admin page like this way.

image

@meloalright
Copy link
Owner

@Ali-l Hope you are having a good Wednesday!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants