globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Only one usage of each socket address (protocol/network address/port) is normally permitted. #125

Closed dotapetro closed 6 years ago

dotapetro commented 6 years ago

Hi, I am trying to implement authboss example using mgo for example storer > MemStorer.Create translates into

func (um UserManager) Create(id string, attr authboss.Attributes) error { dbsession := um.Db.Copy() defer dbsession.Close()

var user User
if err := attr.Bind(&user, true); err != nil {
    return err
}

user.ID = bson.NewObjectId()

if err := dbsession.DB("tasksapp").C("users").Insert(&user); err != nil {
    log.Fatal(err)
    return err
}
fmt.Println("Create")
//spew.Dump(s.Users)
return nil

} and when I run it, I get:

2018/03/17 22:49:36 [auth]     Loading
2018/03/17 22:49:36 [confirm]  Loading
2018/03/17 22:49:36 [lock]     Loading
2018/03/17 22:49:36 [oauth2]   Loading
2018/03/17 22:49:36 [recover]  Loading
2018/03/17 22:49:36 [register] Loading
2018/03/17 22:49:36 [remember] Loading
2018/03/17 22:49:36 [auth]     Route: /auth/login
2018/03/17 22:49:36 [auth]     Route: /auth/logout
2018/03/17 22:49:36 [confirm]  Route: /auth/confirm
2018/03/17 22:49:36 [oauth2]   Route: /auth/oauth2/google
2018/03/17 22:49:36 [oauth2]   Route: /auth/oauth2/callback/google
2018/03/17 22:49:36 [oauth2]   Route: /auth/oauth2/logout
2018/03/17 22:49:36 [recover]  Route: /auth/recover
2018/03/17 22:49:36 [recover]  Route: /auth/recover/complete
2018/03/17 22:49:36 [register] Route: /auth/register
2018/03/17 22:49:36 listen tcp 127.0.0.1:3000: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
dotapetro commented 6 years ago

Sorry for being dumb, there was another program listening that port hidden somewhere