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

Issue with Ghost themes #84

Open
wezardstark opened this issue Apr 18, 2016 · 1 comment
Open

Issue with Ghost themes #84

wezardstark opened this issue Apr 18, 2016 · 1 comment

Comments

@wezardstark
Copy link

Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc2080c4000, 0x1741, 0x1741, 0xc208030800, 0x6, 0x8, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:107 +0xba0
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208106800, 0x1781, 0x1781, 0xc208030800, 0x6, 0x8, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:118 +0xaea
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208105000, 0x179a, 0x179a, 0xc208030800, 0x5, 0x8, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:118 +0xaea
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208103800, 0x17b3, 0x17b3, 0xc2080bc5a0, 0x4, 0x4, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:118 +0xaea
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208102000, 0x17cd, 0x17cd, 0xc2080bc5a0, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:118 +0xaea
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208062800, 0x17e7, 0x17e7, 0xc2080d5950, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:107 +0xba0
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208061000, 0x17fe, 0x17fe, 0xc2080d5950, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:107 +0xba0
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208094b00, 0x180c, 0x180c, 0xc2080d5950, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:118 +0xaea
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208093200, 0x1820, 0x1820, 0xc20800d180, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:118 +0xaea
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208091900, 0x182e, 0x182e, 0xe742b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:107 +0xba0
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.findHelper(0xc208090000, 0x183e, 0x183e, 0xe742b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:107 +0xba0
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.compileTemplate(0xc2080f6000, 0x1856, 0x1a56, 0xc20803bc69, 0x7, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:171 +0x283
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.createTemplateFromFile(0xc20803bc40, 0x34, 0x34, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:193 +0x2ac
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.compileFile(0xc20803bc40, 0x34, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:198 +0x44
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.inspectTemplateFile(0xc20803bc40, 0x34, 0x7f83eb942418, 0xc20802ef50, 0x0, 0x0, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:208 +0xca
Apr 18 02:42:32 Asgard su[1290]: path/filepath.walk(0xc20803bc40, 0x34, 0x7f83eb942418, 0xc20802ef50, 0xac5150, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /usr/local/go/src/path/filepath/path.go:347 +0x91
Apr 18 02:42:32 Asgard su[1290]: path/filepath.walk(0xc20803d830, 0x28, 0x7f83eb942418, 0xc20802fc70, 0xac5150, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /usr/local/go/src/path/filepath/path.go:372 +0x51d
Apr 18 02:42:32 Asgard su[1290]: path/filepath.Walk(0xc20803d830, 0x28, 0xac5150, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /usr/local/go/src/path/filepath/path.go:394 +0xf2
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.compileTheme(0xc20803d830, 0x28, 0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:221 +0x234
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.checkThemes(0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:257 +0x16e
Apr 18 02:42:32 Asgard su[1290]: github.com/kabukky/journey/templates.Generate(0x0, 0x0)
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/templates/generation.go:293 +0xcd
Apr 18 02:42:32 Asgard su[1290]: main.main()
Apr 18 02:42:32 Asgard su[1290]: /go/src/github.com/kabukky/journey/main.go:73 +0x54a
Apr 18 02:42:32 Asgard su[1290]: goroutine 5 [chan receive]:
Apr 18 02:42:32 Asgard su[1290]: database/sql.(*DB).connectionOpener(0xc20803f9a0)
Apr 18 02:42:32 Asgard su[1290]: /usr/local/go/src/database/sql/sql.go:589 +0x4c
Apr 18 02:42:32 Asgard su[1290]: created by database/sql.Open
Apr 18 02:42:32 Asgard su[1290]: /usr/local/go/src/database/sql/sql.go:452 +0x31c
Apr 18 02:42:32 Asgard su[1290]: goroutine 17 [syscall, locked to thread]:
Apr 18 02:42:32 Asgard su[1290]: runtime.goexit()
Apr 18 02:42:32 Asgard su[1290]: /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1
Apr 18 02:42:32 Asgard systemd[1]: journey.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Apr 18 02:42:32 Asgard su[1290]: pam_unix(su-l:session): session closed for user wesley
Apr 18 02:42:32 Asgard systemd[1]: journey.service: Unit entered failed state.
Apr 18 02:42:32 Asgard systemd[1]: journey.service: Failed with result 'exit-code'.

Having trouble loading up alternative themes, seems Journey crashes when a i select a new theme and reload the service, tried odin and casper themes.

Any idea what may be causing this?

@tooolbox
Copy link

tooolbox commented Jul 14, 2016

This is caused by improper parsing of the templates. The "parsing engine" that finds the helper functions cannot handle delimiters inside of delimiters. For example, in the Casper theme there is:

{{!-- jQuery needs to come before``{{ghost_foot}}``so that jQuery can be used in code injection --}}

The findHelper function chokes on this, I believe because it mixes up the locations of the delimiters and winds up pairing them backwards or something. I get a panic: runtime error: slice bounds out of range, because the function tries to extract a block of bytes between indexes 1100->900...backwards.

A temporary workaround involves modifying those unescaped delimiters so they no longer match, such as making the above into { {ghost_foot} } (spaces added). I can confirm that this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants