mysql1681_Error with session provider config mysql

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值