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

Tagged posts query fails in SQLite #55

Closed
geekgonecrazy opened this issue Jan 6, 2019 · 3 comments
Closed

Tagged posts query fails in SQLite #55

geekgonecrazy opened this issue Jan 6, 2019 · 3 comments
Labels
Milestone

Comments

@geekgonecrazy
Copy link
Contributor

geekgonecrazy commented Jan 6, 2019

Describe the bug

Unhandled exception? From here: https://github.com/writeas/writefreely/blob/v0.6.0/handle.go#L336 I can't tell exactly. My logs are full of these with variations of: /tag:{some string here}/feed/

ERROR: 2019/01/06 17:01:18 log.go:26: Failed selecting from posts: near "RLIKE": syntax error
ERROR: 2019/01/06 17:01:18 log.go:26: User: None

runtime error: invalid memory address or nil pointer dereference: goroutine 3730 [running]:
runtime/debug.Stack(0xc0004b6280, 0xc00119d600, 0x0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/writeas/writefreely.(*Handler).Web.func1.1.1(0xc00055e6a0, 0xc00119d600, 0x19bbc00, 0xc0008d6700, 0xc00028f9f0, 0xbf04aaf78bb065a1, 0x411bf38c1b9f, 0x2d60740)
        /ext-go/1/src/github.com/writeas/writefreely/handle.go:336 +0x2ae
panic(0x16f22a0, 0x2c680a0)
        /usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/writeas/writefreely.ViewFeed(0xc0004b6280, 0x19bbc00, 0xc0008d6700, 0xc00119d600, 0xc0005cee10, 0x0)
        /ext-go/1/src/github.com/writeas/writefreely/feed.go:78 +0x3f9
github.com/writeas/writefreely.(*Handler).Web.func1.1(0xc00055e6a0, 0xc00119d600, 0x19bbc00, 0xc0008d6700, 0x1, 0x18d82b8, 0x0, 0x0)
        /ext-go/1/src/github.com/writeas/writefreely/handle.go:368 +0x121
github.com/writeas/writefreely.(*Handler).Web.func1(0x19bbc00, 0xc0008d6700, 0xc00119d600)
        /ext-go/1/src/github.com/writeas/writefreely/handle.go:382 +0x63
net/http.HandlerFunc.ServeHTTP(0xc0005b4ce0, 0x19bbc00, 0xc0008d6700, 0xc00119d600)
        /usr/local/go/src/net/http/server.go:1964 +0x44
github.com/gorilla/mux.(*Router).ServeHTTP(0xc0004b6e10, 0x19bbc00, 0xc0008d6700, 0xc00119d600)
        /ext-go/1/src/github.com/gorilla/mux/mux.go:114 +0xe0
net/http.(*ServeMux).ServeHTTP(0x2d602a0, 0x19bbc00, 0xc0008d6700, 0xc00119c100)
        /usr/local/go/src/net/http/server.go:2361 +0x127
net/http.serverHandler.ServeHTTP(0xc0005596c0, 0x19bbc00, 0xc0008d6700, 0xc00119c100)
        /usr/local/go/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc0006a6320, 0x19bc040, 0xc00034af80)
        /usr/local/go/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:2851 +0x2f5
2019/01/06 17:01:18 Web deferred internal error render
2019/01/06 17:01:18 "GET /tag:Routed/feed/" 500 2.116462ms "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.
google.com/bot.html)"

Expected behavior

What should've happened?
Exception handled

Application configuration

  • Single mode or Multi-user mode? Single
  • Database? sqlite
  • Open registration? no
  • Federation enabled? yes

Version or last commit: 0.6.0

@thebaer
Copy link
Member

thebaer commented Jan 6, 2019

Oh! This is actually a bad query in SQLite that we must've missed -- will fix that bug.

As for the output there, the application is actually catching / handling the runtime error as gracefully as possible (see line 330) -- the application is prevented from crashing, tries to show a decent 500 page to the user, and spits the stack trace out on the server. So no changes are needed there in regards to the bad query.

@thebaer thebaer added the bug label Jan 6, 2019
@thebaer thebaer added this to the 0.7 milestone Jan 6, 2019
@geekgonecrazy
Copy link
Contributor Author

Ah! That's what I wondered. I'm spoiled to gin's recovery middleware 😁

@thebaer thebaer changed the title Unhandled exception? Tagged posts query fails in SQLite Jan 7, 2019
@thebaer
Copy link
Member

thebaer commented Jan 7, 2019

Heh, maybe one day we should move to something that isn't hand-spun 😛

@thebaer thebaer closed this as completed in 8a55556 Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants