unfoldingWord / dcs

Door43 Content Service
https://git.door43.org
MIT License
0 stars 6 forks source link

Error in YAML rendering #207

Closed ethantkoenig closed 7 years ago

ethantkoenig commented 7 years ago

I've noticed several of these errors in the production logs:

[Macaron] PANIC: interface conversion: interface {} is string, not yaml.MapSlice
/usr/local/go/src/runtime/panic.go:489 (0x433c1f)
/usr/local/go/src/runtime/iface.go:172 (0x4168f1)
/tmp/go-mOIx/src/code.gitea.io/gitea/modules/yaml/yaml.go:51 (0xe54aae)
/tmp/go-mOIx/src/code.gitea.io/gitea/modules/yaml/yaml.go:156 (0xe55f49)
/tmp/go-mOIx/src/code.gitea.io/gitea/routers/repo/view.go:202 (0xe9ce15)
/tmp/go-mOIx/src/code.gitea.io/gitea/routers/repo/view.go:325 (0xe9f124)
/tmp/go-mOIx/src/code.gitea.io/gitea/routers/repo/view.go:275 (0xe9e368)
/usr/local/go/src/runtime/asm_amd64.s:514 (0x460cb8)
/usr/local/go/src/reflect/value.go:434 (0x4c345f)
/usr/local/go/src/reflect/value.go:302 (0x4c2a24)
...
ethantkoenig commented 7 years ago

The error can be reproduced by viewing the following README.md:

---

Hey:
- whaddup
ethantkoenig commented 7 years ago

@richmahn Why was this closed?

ethantkoenig commented 7 years ago

I'm a little confused by the changes we've made to routers/repo/view.go (starting around here). We try to parse markdown files as YAML, but only if the first line is "---"? What's the use case for this?

jag3773 commented 7 years ago

I don't see a reason to treat Markdown files as YAML... @richmahn any context on this?

jag3773 commented 7 years ago

From standup today, Jekyll supports YAML headers in Markdown files, which is the reason for the code referenced.

richmahn commented 7 years ago

@jag3773 @ethantkoenig This was put in to support the metadata in the old en-ta-* repos. https://git.door43.org/Door43/en-ta-translate-vol1/src/master/content/file_formats.md. I don't think we put metadata in the ta files any more. Do we still want to support it?

jag3773 commented 7 years ago

If that's the only reason for it and if it is easier to remove it then fix and if upstream doesn't have it, then yes, remove it.

ethantkoenig commented 7 years ago

it is easier to remove it then fix

yes

upstream doesn't have it

yes (as in they don't have it)

@richmahn @jag3773 Do we anticipate having to support Jekyll-style headers for anything else? If so, I'll fix the code, otherwise I'll remove it. Either way I'd like to do something, since our logs are getting spammed with errors.

jag3773 commented 7 years ago

Fine with me to remove it.

On Mon, Jul 10, 2017 at 6:12 PM Ethan Koenig notifications@github.com wrote:

it is easier to remove it then fix

yes

upstream doesn't have it

yes

@richmahn https://github.com/richmahn @jag3773 https://github.com/jag3773 Do we anticipate having to support Jekyll-style headers for anything else? If so, I'll fix the code, otherwise I'll remove it. Either way I'd like to do something, since our logs are getting spammed with errors.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/unfoldingWord-dev/gogs/issues/207#issuecomment-314285430, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGk0_rMK3Yiq0c7a8Emhf8YCwIQmRpqks5sMr4HgaJpZM4OIBDk .

-- Thank you, Jesse Griffin