Comments (11)
Thanks your feedback!
But the error seems incomplete?
http: panic serving [::1]:61196: session(start): gob: name not registered for interface:
Does the :
actually the last character or you didn't copy the error entirely?
from session.
After :
, there exists the model path of user model
from session.
I need details please, that may help!
from session.
Ok. Here's the full dump
http: panic serving [::1]:63107: session(start): gob: name not registered for interface: "_/Users/aacanakin/Desktop/dev/gocode/src/project/models.User"
goroutine 10 [running]:
net/http.func·011()
/usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1130 +0xbb
github.com/macaron-contrib/session.func·004(0xc20805d200)
/Users/aacanakin/Desktop/dev/gocode/src/github.com/macaron-contrib/session/session.go:158 +0x14d
reflect.Value.call(0x41a860, 0xc2080ebe60, 0x13, 0x582220, 0x4, 0xc20800b620, 0x1, 0x1, 0x0, 0x0, ...)
/usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:419 +0x10e5
reflect.Value.Call(0x41a860, 0xc2080ebe60, 0x13, 0xc20800b620, 0x1, 0x1, 0x0, 0x0, 0x0)
/usr/local/Cellar/go/1.4.2/libexec/src/reflect/value.go:296 +0xbc
github.com/Unknwon/macaron/inject.(*injector).Invoke(0xc20800b540, 0x41a860, 0xc2080ebe60, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/aacanakin/Desktop/dev/gocode/src/github.com/Unknwon/macaron/inject/inject.go:102 +0x3c7
github.com/Unknwon/macaron.(*Context).run(0xc20805d200)
/Users/aacanakin/Desktop/dev/gocode/src/github.com/Unknwon/macaron/context.go:113 +0x95
github.com/Unknwon/macaron.func·015(0x938c30, 0xc208045720, 0xc20801fd40, 0xc20803dd70)
/Users/aacanakin/Desktop/dev/gocode/src/github.com/Unknwon/macaron/router.go:183 +0x3ec
github.com/Unknwon/macaron.(*Router).ServeHTTP(0xc208041f90, 0x938c30, 0xc208045720, 0xc20801fd40)
/Users/aacanakin/Desktop/dev/gocode/src/github.com/Unknwon/macaron/router.go:271 +0x1ab
github.com/Unknwon/macaron.(*Macaron).ServeHTTP(0xc2080ec0e0, 0x938c30, 0xc208045720, 0xc20801fd40)
/Users/aacanakin/Desktop/dev/gocode/src/github.com/Unknwon/macaron/macaron.go:171 +0x17c
net/http.serverHandler.ServeHTTP(0xc20805b2c0, 0x938c30, 0xc208045720, 0xc20801fd40)
/usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1703 +0x19a
net/http.(*conn).serve(0xc2080455e0)
/usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1204 +0xb57
created by net/http.(*Server).Serve
/usr/local/Cellar/go/1.4.2/libexec/src/net/http/server.go:1751 +0x35e
This happens if I don't cleanup sessions folder and start the web server
from session.
Hi @aacanakin , thanks your info! I've pushed some changes, please use go get -u github.com/macaron-contrib/session
and rebuild your program see if problem is being solved!
from session.
Hi @unknwon. The problem continues.
from session.
I looked at your commit. Before starting the app and registering the session middleware, If I add the following line; the problem is fixed;
gob.Register(models.User{})
But I think this is not an out of the box solution
from session.
@aacanakin thanks for the tip!
from session.
Did some researching, it seems no way to know what types are inside gob encoded data and register automatically.
In your case and other similar cases, I think user have to do:
func init() {
gob.Register(&models.User{})
}
This way, gob knows how decode it.
from session.
Ok then, I'm closing this. Thanks.
from session.
@aacanakin sorry about it, maybe someday comes up a better way to encode data into binary, or should just store user ID in session and it's fast to read user info by ID from database.
from session.
Related Issues (19)
- Use "import github.com/go-macaron/macaron" instead of "import gopkg.in/macaron.v1" HOT 1
- session 储存在memory中,是否只能存一个值? HOT 1
- How do I set the SameSite option on the session cookies? HOT 7
- Destory => Destroy? HOT 4
- [Feature Request] Provide examples for secure a rest API via (login/cookie) HOT 1
- panic: sql: Register called twice for driver postgres HOT 4
- session包可能存在不过期的bug HOT 4
- Reduce permissions of file store HOT 3
- Panic with "Value not found for type *macaron.Context" as soon as I add Sessioner HOT 1
- what's var _ Store = &store{} mean in session.go ? HOT 1
- Redis Sentinel Support (HA)
- session的CookieName可以改成大写M开头
- Flush() or Delete() doesn't work in mysql HOT 2
- 文档错误 HOT 1
- Allow setting cookie to be HttpOnly
- how to destroy a non-current user's session
- redis: would *Redis.Client reconnects automatically?
- race condition in FileStore
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from session.