Open murilopolese opened 4 years ago
Just ran into the same error when attempting to publish a simple text message with sbot publish --type post --text "Hi Friends"
/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:123
throw err
^
{
message: 'cb is not a function',
name: 'TypeError',
stack: 'TypeError: cb is not a function\n' +
' at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:201:7\n' +
' at EventEmitter.append (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:162:18)\n' +
' at Object.add (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/create.js:93:10)\n' +
' at apply (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:202:13)\n' +
' at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:86:14)\n' +
' at Object.hooked (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)\n' +
' at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:31:29)\n' +
' at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:37:22)\n' +
' at Object.request (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/stream.js:48:17)\n' +
' at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:161:17)'
TypeError: cb is not a function
happens when the number of positional arguments doesn't match what the RPC command expected. That this happens when there are spaces in the description suggests that it is a shell quoting/escaping issue.
Looking into this ./sbot
, I see it is generated by install.sh
. It should be quoting the arguments properly. But this was fixed in daa3972ff6420ad6866e0957d5feb1d29d56096c (2018-10-24). If you installed before that, you would have the broken version. Just edit the sbot
script to change $@
to "$@"
.
Resolved the issue for me. @murilopolese this is solved once you apply the fix to ./sbot
Oh! Cool! Thanks a lot! 👍 I'll have a look tonight and report/close the issue!
I have just pulled the latest docker image and in fact if I publish a single word it works but if I publish anything with a space it still breaks:
./sbot publish --type about --about @xzVNju0I2n3N7SlAc76BSx0HKAoUCkWwNu7vsuZNyNU=.ed25519 --description bananada
{
"key": "%B3uNJ8/DsFkuy0PtLNeOXMuXa1IiL6v6dmyMr1arFe8=.sha256",
"value": {
"previous": "%1iDAmP0J1hMcJoktpTMGQHKy1mqIeOSDa8FFxRXw+6g=.sha256",
"sequence": 15,
"author": "@xzVNju0I2n3N7SlAc76BSx0HKAoUCkWwNu7vsuZNyNU=.ed25519",
"timestamp": 1611128851431,
"hash": "sha256",
"content": {
"type": "about",
"about": "@xzVNju0I2n3N7SlAc76BSx0HKAoUCkWwNu7vsuZNyNU=.ed25519",
"description": "bananada"
},
"signature": "EsYSXNtIgjbuHLRof494sNCYtsJhuQgamXzqNu0nyad0jYfhM7tEG9yOiwCK2A9L283sVMmoyMPcQ8Re7mdCDg==.sig.ed25519"
},
"timestamp": 1611128851432
}
./sbot publish --type about --about @xzVNju0I2n3N7SlAc76BSx0HKAoUCkWwNu7vsuZNyNU=.ed25519 --description "bananabanana.me pub"
/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:123
throw err
^
{
message: 'cb is not a function',
name: 'TypeError',
stack: 'TypeError: cb is not a function\n' +
' at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:201:7\n' +
' at EventEmitter.append (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/minimal.js:162:18)\n' +
' at Object.add (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-db/create.js:93:10)\n' +
' at apply (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:199:15)\n' +
' at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc-validation/index.js:86:14)\n' +
' at Object.hooked (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)\n' +
' at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:31:29)\n' +
' at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/local-api.js:37:22)\n' +
' at Object.request (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpc/stream.js:48:17)\n' +
' at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/packet-stream/index.js:161:17)'
}
I run this pub on a docker container and the processes is running as follow:
I can run
./sbot whoami
and./sbot invite.create 1
.In the past I managed to run
./sbot publish --type about --about @xzVNju0I2n3N7SlAc76BSx0HKAoUCkWwNu7vsuZNyNU=.ed25519 --name PUBNAME
But when I try to add a description or a name with whitespaces (therefore wrapped in
"
, right?) I get the following error:What am I doing wrong this time?