git ssb

16+

cel / patchfoo



TypeError: Cannot read property 'unbox' of undefined

%NBTYRrF1QjwJRiCUzXeAWB0EVYqyggXmHp70NOiyGB8=.sha256
ClosedChristian Bundy opened this issue on 12/18/2018, 6:46:00 PM

TypeError: Cannot read property 'unbox' of undefined

Hi! I'm trying out Patchfoo with the latest version of Scuttlebot, but it looks like I'm running into an error. Are there any steps I should take to debug? Thanks!

$ npm start                                                                                                                                                                            

> patchfoo@1.2.0 start /home/christianbundy/src/ssbc/patchfoo
> node server.js

error loading sodium bindings: Cannot find module 'sodium-native'
falling back to javascript version.
(node:20889) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[patchfoo] Listening on http://127.0.0.1:8027
GET /
GET /public
GET /mentions
GET /peers
GET /friends
GET /public
GET /@+oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU=.ed25519
Trace: Getting peer addresses requires the ssb-backlinks plugin
    at App.getAddresses (/home/christianbundy/src/ssbc/patchfoo/lib/app.js:906:15)
    at /home/christianbundy/src/ssbc/patchfoo/lib/serve.js:1818:22
    at pull (/home/christianbundy/src/ssbc/patchfoo/node_modules/pull-stream/pull.js:41:14)
    at App.<anonymous> (/home/christianbundy/src/ssbc/patchfoo/lib/serve.js:1292:5)
    at /home/christianbundy/src/ssbc/patchfoo/node_modules/asyncmemo/index.js:23:14
    at process._tickCallback (internal/process/next_tick.js:61:11)
GET /compose
GET /public
GET /
GET /public
GET /emoji/lock.png
GET /static/hermie.ico
GET /channel/3dprinting
GET /public
GET /emoji/lock.png
GET /static/hermie.ico
GET /friends
GET /advsearch
GET /emojis
/home/christianbundy/src/ssbc/patchfoo/lib/app.js:61
  this.unboxContent = memo({cache: lru(100)}, function(value, cb){sbot.private.unbox(value, cb)})
                                                                               ^

TypeError: Cannot read property 'unbox' of undefined
    at App.<anonymous> (/home/christianbundy/src/ssbc/patchfoo/lib/app.js:61:80)
    at App.run (/home/christianbundy/src/ssbc/patchfoo/node_modules/asyncmemo/index.js:35:8)
    at App.unboxContent (/home/christianbundy/src/ssbc/patchfoo/node_modules/asyncmemo/index.js:28:9)
    at App.unboxContentWithKey (/home/christianbundy/src/ssbc/patchfoo/lib/app.js:112:25)
    at App.unboxMsgWithKey (/home/christianbundy/src/ssbc/patchfoo/lib/app.js:130:13)
    at App.unboxMsg (/home/christianbundy/src/ssbc/patchfoo/lib/app.js:148:15)
    at /home/christianbundy/src/ssbc/patchfoo/node_modules/pull-paramap/index.js:41:11
    at /home/christianbundy/src/ssbc/patchfoo/node_modules/pull-cat/index.js:35:13
    at PacketStreamSubstream.weird.read (/home/christianbundy/src/ssbc/patchfoo/node_modules/muxrpc/pull-weird.js:33:7)
    at PacketStream._onstream (/home/christianbundy/src/ssbc/patchfoo/node_modules/packet-stream/index.js:204:12
%9/no2QfjBseZjjygP6znMcDcIDMzesY9zyEMvnWVsBs=.sha256 cryptix · 12/18/2018, 9:03:38 PM

sbot.private.unbox TypeError: Cannot read property 'unbox' of undefined

the problem seems to be that ssb-private is missing. I thought patchfoo handles these gracefully, though... :confused:

%Y5/RfPryMM6m9vJqqPnR+4N8hj5m9/4vTL3nI+Qi7Vs=.sha256 cryptix · 12/18/2018, 9:06:23 PM

also notice:

error loading sodium bindings: Cannot find module 'sodium-native' falling back to javascript version.

npm packaged blobs tend to be biggeren than the default: %F0N9g4M...

%TL3Y3ZkwM7i/M33Wde2tyvNW3GtEaH1vqOBPzxOgbrw=.sha256 Christian Bundy · 12/19/2018, 6:25:18 PM

@cryptix

Oh, do I need to manually add that to my SSB config? Here's what it looks like now:

{
  "gossip": {
    "global": true
  },
  "blobs": {
    "max": 10000000
  },
  "plugins": {
    "ssb-links": "links2",
    "ssb-npm-registry": true
  },
  "connections": {
    "incoming": {
      "net": [{ "port": 8008, "scope": "public", "transform": "shs", "external": "example.com" }]
    },
    "outgoing": {
      "net": [{ "transform": "shs" }]
    }
  }
}

Ignore the example.com bit, I don't think that's relevant here. ๐Ÿ˜‰

%ParxHKz2JgbhU5yMlCKWPh8BxqPkw3uL1IPixPId2lw=.sha256 cryptix · 12/20/2018, 12:32:51 AM

Oh, do I need to manually add that to my SSB config? - @christianbundy

yup! this list of .use(require(..))s is the set that patchbay loads into its sbot. so you need to install all of those through sbot plugins.install (which adds them to your config) if you start ssb-server standalone.

%hn/jNsr4Jo4jRkxsYV6NwGZMMuQccgAZ4XxxN6fWoUU=.sha256 cel closed this issue · 8/22/2019, 11:46:07 PM

Closed as patchfoo no longer requires ssb-private, so this TypeError should no longer happen.

Built with git-ssb-web