ssbc / ssb-server

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

Cannot use plugins.install -> TypeError: Cannot read property 'commands' of undefined #749

Closed pbuyle closed 3 years ago

pbuyle commented 3 years ago

Is ssb-server plugins.install the right command to use to install plugins ?

I've a ssb server running through Patchwork (3.18.0.831). When trying to install plugins through the command-line with ssb-server installed with npm -g ssb-server, I get a TypeError with the message "Cannot read property 'commands' of undefined".

$ ssb-server version   
"19.4.0"
$ ssb-server plugins.install ssb-meme
/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpc-usage/index.js:9
  return o.commands
           ^

TypeError: Cannot read property 'commands' of undefined
    at isGroup (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpc-usage/index.js:9:12)
    at get (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpc-usage/index.js:14:8)
    at Object.exports.get (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpc-usage/index.js:27:10)
    at output (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:42:17)
    at /Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:78:9
    at Object._requests.<computed> (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:38:5)
    at PacketStream._onrequest (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:151:26)
    at PacketStream.write (/Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:134:41)
    at /Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/muxrpc/pull-weird.js:56:15
    at /Users/pbuyle/.nvm/versions/node/v14.15.3/lib/node_modules/ssb-server/node_modules/pull-stream/sinks/drain.js:24:37

This issue is the same as https://github.com/ssbc/ssb-server/issues/718

austinfrey commented 3 years ago

@pbuyle does it change anything to use the --name flag? also try installing ssb-server@15.3.0 as it's a more stable version

sbot plugins.install --name ssb-meme
pbuyle commented 3 years ago

After stopping Patchwork, installing ssb-server@15.3.0 and running ssb-server start, bot plugins.install --name ssb-meme worked.

austinfrey commented 3 years ago

@pbuyle ok great! if you are all set, could you close this?

pbuyle commented 3 years ago

@pbuyle ok great! if you are all set, could you close this?

ssb-server plugins.install --name ssb-meme works when using ssb-server@15, but with not with ssb-server@19. I don't mind closing the issue, but it seems there is bug in latest release.

austinfrey commented 3 years ago

@pbuyle 15.3.0 is the current latest release of 'ssb-server'. It used to be 16+ but it got rolled back after some regressions. The version 19 being shown is separate bug :/ where the version of the underlying ssb-db plugin is shown, not the current ssb-server version.

Calling commands with ssb-server will create a client that connects to a running server instance, If running ssb-server start from the CLI, it will start a new server instance that the CLI client can connect to. If calling ssb-server commands while running an app like Patchwork, it will connect to the running server packaged with patchwork

This might be an issue that get's posted there.

pbuyle commented 3 years ago

:+1: