ssbc / ssb-server

The gossip and replication server for Secure Scuttlebutt - a distributed social network
1.69k stars 164 forks source link

Crash with pending invite to pub server that has changed key #154

Closed aredridel closed 9 years ago

aredridel commented 9 years ago
info 6RKi REMO 7 remote-authed {"granted":true,"type":"peer","role":"anonymous"}
AUTH DEBUG -- ERR: undefined
AUTH DEBUG -- RES: { granted: true, type: 'peer', role: 'anonymous' }
AUTH DEBUG -- RPC: { domain: null,
  _events:
   { 'remote:authorized': [ [Function] ],
     'rpc:unauthorized': { [Function: g] listener: [Function] },
     'rpc:authorized': { [Function: g] listener: [Function] } },
  _maxListeners: undefined,
  add: [Function],
  publish: [Function],
  get: [Function],
  getPublicKey: [Function],
  getLatest: [Function],
  whoami: [Function],
  auth: [Function],
  relatedMessages: [Function],
  getLocal: [Function],
  createFeedStream: [Function],
  createHistoryStream: [Function],
  createLogStream: [Function],
  messagesByType: [Function],
  messagesLinkedToMessage: [Function],
  messagesLinkedToFeed: [Function],
  messagesLinkedFromFeed: [Function],
  feedsLinkedToFeed: [Function],
  feedsLinkedFromFeed: [Function],
  followedUsers: [Function],
  gossip: { seeds: [Function], peers: [Function], connect: [Function] },
  blobs:
   { get: [Function],
     has: [Function],
     add: [Function],
     ls: [Function],
     want: [Function],
     wants: [Function] },
  invite: { create: [Function], use: [Function], addMe: [Function] },
  friends: { all: [Function], hops: [Function] },
  local: { get: [Function] },
  phoenix:
   { createEventStream: [Function],
     getIndexCounts: [Function],
     createInboxStream: [Function],
     createAdvertStream: [Function],
     getRandomAdverts: [Function],
     markRead: [Function],
     markUnread: [Function],
     toggleRead: [Function],
     isRead: [Function],
     subscribe: [Function],
     unsubscribe: [Function],
     toggleSubscribed: [Function],
     isSubscribed: [Function],
     getMyProfile: [Function],
     getProfile: [Function],
     getAllProfiles: [Function],
     getNamesById: [Function],
     getNameTrustRanks: [Function],
     getName: [Function],
     getIdsByName: [Function],
     getActionItems: [Function] },
  _emit: [Function: emit],
  emit: [Function],
  createStream: [Function],
  permissions: { [Function: perms] pre: [Function], post: [Function], test: [Function] },
  closed: false,
  close: [Function],
  incoming: false,
  outgoing: true,
  _sessid: 7,
  _remoteAddress: undefined,
  task: [Function],
  authorized:
   { ToS: 'be excellent to each other',
     public: 'uXLdwfdYup6rjB6qVpL6yLdPQzjiRZOUd+VCCXnhxZCh3r+PuF3IlAcaIjMANNPhqKyTDdyqsn9MCGJkC/rFFA==.k256',
     ts: 1428282348945,
     signature: 'k4zGIoImCMfmaLlegp/DoP7QIlcYMif1fjKp7yx1Iaxdvgu8scB7rT5f5448GPZ1lb8bn30uvPZpxNdBG5zgAA==.blake2s.k256',
     id: '+Rhv9v9F9pNxYNtQ6RTo7tZlZiW3E1uptDobN5Jzko0=.blake2s',
     role: 'anonymous' } }
info 6RKi REPL 7 start
info 6RKi SBOT 7 authed {"granted":true,"type":"peer","role":"anonymous"}
/Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/index.js:189
            var ws = ps.stream()
                       ^
TypeError: Cannot read property 'stream' of null
    at EventEmitter.createHistoryStream (/Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/index.js:189:24)
    at /Users/aredridel/Projects/scuttlebot/plugins/replicate.js:50:25
    at /Users/aredridel/Projects/scuttlebot/node_modules/pull-stream/sinks.js:15:33
    at drain (/Users/aredridel/Projects/scuttlebot/node_modules/secure-scuttlebutt/node_modules/pull-paramap/index.js:19:11)
    at /Users/aredridel/Projects/scuttlebot/node_modules/secure-scuttlebutt/node_modules/pull-paramap/index.js:44:13
    at /Users/aredridel/Projects/scuttlebot/node_modules/secure-scuttlebutt/index.js:311:9
    at /Users/aredridel/Projects/scuttlebot/node_modules/secure-scuttlebutt/node_modules/level-sublevel/shell.js:102:12
    at /Users/aredridel/Projects/scuttlebot/node_modules/secure-scuttlebutt/node_modules/level-sublevel/nut.js:121:19

/Users/aredridel/Projects/scuttlebot/bin.js:208
        if(err) throw err
                      ^
Error: pub server did not have correct public key
    at next (/Users/aredridel/Projects/scuttlebot/plugins/invite.js:142:23)
    at EventEmitter.<anonymous> (/Users/aredridel/Projects/scuttlebot/plugins/invite.js:136:30)
    at EventEmitter.g (events.js:199:16)
    at EventEmitter.emit [as _emit] (events.js:110:17)
    at /Users/aredridel/Projects/scuttlebot/index.js:125:13
    at Array.requests.(anonymous function) (/Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/node_modules/packet-stream/index.js:161:9)
    at onRequest (/Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/node_modules/packet-stream/index.js:20:27)
    at Object.p.write (/Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/node_modules/packet-stream/index.js:181:33)
    at /Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/pull-weird.js:52:15
    at /Users/aredridel/Projects/scuttlebot/node_modules/muxrpc/node_modules/pull-stream/sinks.js:15:33```
pfrazee commented 9 years ago

So the first stack dump is a bug in muxrpc, reported https://github.com/ssbc/scuttlebot/issues/130

The second stack is actually correct, it's how sbot reports the failed invite process.

I'm going to mark this as a duplicate, sound good?