Hi,
I'm trying grafana 2.0beta with mysql as a session provider and I have this error:
2015/03/31 16:02:28 [I] Completed / 500 Internal Server Error in 1.335567024s
[Macaron] PANIC: runtime error: invalid memory address or nil pointer dereference
/usr/src/go/src/runtime/panic.go:387 (0x4a9b58)
/usr/src/go/src/runtime/panic.go:42 (0x4a8e7e)
/usr/src/go/src/runtime/sigpanic_unix.go:26 (0x4af4c4)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/macaron-contrib/session/session.go:191 (0x5e745a)
/usr/src/go/src/runtime/asm_amd64.s:401 (0x4d2875)
/usr/src/go/src/reflect/value.go:419 (0x733c05)
/usr/src/go/src/reflect/value.go:296 (0x7329fc)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/inject/inject.go:102 (0x7ffe67)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/context.go:113 (0x5c5ab5)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/context.go:104 (0x5c59b3)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/recovery.go:161 (0x5d7ee3)
/usr/src/go/src/runtime/asm_amd64.s:401 (0x4d2875)
/usr/src/go/src/reflect/value.go:419 (0x733c05)
/usr/src/go/src/reflect/value.go:296 (0x7329fc)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/inject/inject.go:102 (0x7ffe67)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/context.go:113 (0x5c5ab5)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/context.go:104 (0x5c59b3)
/go/src/github.com/grafana/grafana/pkg/middleware/logger.go:40 (0x607b4d)
/usr/src/go/src/runtime/asm_amd64.s:402 (0x4d28e5)
/usr/src/go/src/reflect/value.go:419 (0x733c05)
/usr/src/go/src/reflect/value.go:296 (0x7329fc)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/inject/inject.go:102 (0x7ffe67)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/context.go:113 (0x5c5ab5)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/router.go:158 (0x5d93fc)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/router.go:245 (0x5d1ac8)
/go/src/github.com/grafana/grafana/Godeps/_workspace/src/github.com/Unknwon/macaron/macaron.go:171 (0x5ca57c)
/usr/src/go/src/net/http/server.go:1703 (0x5a9b2a)
/usr/src/go/src/net/http/server.go:1204 (0x5a75f7)
/usr/src/go/src/runtime/asm_amd64.s:2232 (0x4d4991)
I saw in documentation that I should create the session table before:
CREATE TABLE `session` (
`key` CHAR(16) NOT NULL,
`data` BLOB,
`expiry` INT(11) UNSIGNED NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
and I did it and still it doesn't work. I was debugging and I saw in godeps that grafana is using revision '65b8817c40cb5bdce08673a15fd2a648c2ba0e16' of macaron-contrib/session. That looks like an old version, because if you check the mysql code in that revision, column references are with 'session_' prefix:
https://github.com/macaron-contrib/session/blob/65b8817c40cb5bdce08673a15fd2a648c2ba0e16/mysql/mysql.go#L74
I tried to update manually godeps to latest version of macaron-contrib/session and after that, grafana works fine.