fraction / ssb-daemon

SSB-Daemon (SSBD) is an experimental alternative to SSB-Server.
4 stars 0 forks source link

SyntaxError: Unexpected token { in JSON at position 248 #4

Open treasuretron opened 3 years ago

treasuretron commented 3 years ago

Hello Christian! I ran into issues a while ago with ssb-server so I kind of gave up on my pub for a while. But I've seen you recommend a few times that, 'ssb-server is deprecated, try ssb-daemon/cli'

So I fired those up with the same .ssb and am getting, SyntaxError: Unexpected token { in JSON at position 248

But it runs fine when I blowaway .ssb. I recall once you suggested a couple directories within .ssb to wipe when running into a wonky feed... but I no longer recall. Ideas?

thanks!!!

treasuretron commented 3 years ago

ooook nevermind, I followed https://handbook.scuttlebutt.nz/faq/basics/delete and that seems to have worked!

treasuretron commented 3 years ago

ok so I figured it out it actually seems like a config issue. Not sure if this is an ssb-daemon or ssb-cli issue (or beyond the scope of either), but, here is the issue I'm at now:

my config file:

{ "connections": { "incoming": { "net": [ { "scope": "public", "host": "0.0.0.0", "external": ["teafry.me"], "transform": "shs", "port": 8008 } ] }, "outgoing": { "net": [{ "transform": "shs" }] } } }

It was causing the error above until I removed {"gossip":{"local":false}} that was at the very end.

So now ssb-daemon runs, but when I try to ssb invite create I get,

TypeError: resultHost.replace is not a function
    at Object.stringify (/home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/multiserver/plugins/net.js:124:31)
    at /home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/multiserver/compose.js:111:19
    at Array.map (<anonymous>)
    at Object.stringify (/home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/multiserver/compose.js:110:22)
    at /home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/multiserver/index.js:67:44
    at Array.map (<anonymous>)
    at Object.stringify (/home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/multiserver/index.js:67:10)
    at EventEmitter.getAddress (/home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/secret-stack/core.js:213:21)
    at EventEmitter.hooked [as getAddress] (/home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/hoox/index.js:10:15)
    at getInviteAddress (/home/trav/.nvm/versions/node/v10.20.1/lib/node_modules/ssb-daemon/node_modules/ssb-invite/index.js:70:18)

EDIT: got into a fight with npm. Uninstalled nvm, updated npm to 14.6.0. Now ssb invite create gives me,

error loading sodium bindings: Cannot find module 'sodium-native'
Require stack:
- /usr/local/lib/node_modules/ssb-cli/node_modules/chloride/bindings.js
- /usr/local/lib/node_modules/ssb-cli/node_modules/chloride/index.js
- /usr/local/lib/node_modules/ssb-cli/node_modules/ssb-keys/index.js
- /usr/local/lib/node_modules/ssb-cli/node_modules/ssb-client/index.js
- /usr/local/lib/node_modules/ssb-cli/index.js
falling back to javascript version.
Error [TypeError]: resultHost.replace is not a function
    at Object.stringify (/usr/local/lib/node_modules/ssb-daemon/node_modules/multiserver/plugins/net.js:124:31)
    at /usr/local/lib/node_modules/ssb-daemon/node_modules/multiserver/compose.js:111:19
    at Array.map (<anonymous>)
    at Object.stringify (/usr/local/lib/node_modules/ssb-daemon/node_modules/multiserver/compose.js:110:22)
    at /usr/local/lib/node_modules/ssb-daemon/node_modules/multiserver/index.js:67:44
    at Array.map (<anonymous>)
    at Object.stringify (/usr/local/lib/node_modules/ssb-daemon/node_modules/multiserver/index.js:67:10)
    at EventEmitter.getAddress (/usr/local/lib/node_modules/ssb-daemon/node_modules/secret-stack/core.js:213:21)
    at EventEmitter.hooked [as getAddress] (/usr/local/lib/node_modules/ssb-daemon/node_modules/hoox/index.js:10:15)
    at getInviteAddress (/usr/local/lib/node_modules/ssb-daemon/node_modules/ssb-invite/index.js:70:18)

¯_(ツ)_/¯

EDIT2: tried fiddling with config, no change. Tried reinstalling ssb-daemon to see if it would update whatever module that was having trouble, got libtool is required, but wasn't found on this system. Tried sudo apt install libtool-bin and reinstall ssb-daemon again, now getting libtoolize: error: Failed to create 'build-aux' during install...

full output of sudo npm install -g fraction/ssb-daemon

/usr/local/bin/ssb-daemon -> /usr/local/lib/node_modules/ssb-daemon/index.js
/usr/local/bin/ssbd -> /usr/local/lib/node_modules/ssb-daemon/index.js

> sodium-native@2.4.9 install /usr/local/lib/node_modules/ssb-daemon/node_modules/sodium-native
> node-gyp-build "node preinstall.js" "node postinstall.js"

libtoolize:   error: Failed to create 'build-aux'
./configure: 5: ./configure: ./configure: not found
/usr/local/lib/node_modules/ssb-daemon/node_modules/sodium-native/preinstall.js:119
    if (err) throw err
             ^

Error: ./configure exited with 127
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/ssb-daemon/node_modules/sodium-native/preinstall.js:149:25)
    at ChildProcess.emit (events.js:314:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sodium-native@2.4.9 (node_modules/ssb-daemon/node_modules/sodium-native):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sodium-native@2.4.9 install: `node-gyp-build "node preinstall.js" "node postinstall.js"`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1