ahdinosaur / ssb-pub

easily host your own Secure ScuttleButt (SSB) pub in a docker container
http://butt.nz/
GNU Affero General Public License v3.0
157 stars 25 forks source link

server keeps restarting #37

Open RyanSinger opened 3 years ago

RyanSinger commented 3 years ago

I think this may be related to the recent bug in ssb-links; but my pub keeps restarting and no longer works. How do I recover?

sunjam commented 3 years ago

I think the Docker build needs to be updated. Full details here.

Copy-pasta follows:

Advisory: ssb-server crash fixed

A bug in ssb-links causes ssb-server to crash when handling certain messages recently published.

The main error message on crash is: Error: can only encode arrays.

This bug is fixed in ssb-links v3.0.10. If you encounter this crash, please reinstall/upgrade your ssb-server to get the updated ssb-links module.

It is possible a similar issue could exist with other #ssb plugins using flumeview-links, in which case we will update this thread.

This issue primarily affects pub operators and users who run ssb-server directly. Users of apps that bundle ssb-server (e.g. Patchwork) are not affected.

There are no known security implications.

ahdinosaur commented 3 years ago

@sunjam is correct, an updating version is incoming. sorry for the delay. :purple_heart:

ahdinosaur commented 3 years ago

published a new version which should fix this: v2.2.0 :tada:

i've upgraded my own 3 pubs and they seem to be happy again. :smiley_cat:

ahdinosaur commented 3 years ago

ℹī¸ the upgrade process for pub operators: https://github.com/ahdinosaur/ssb-pub#update-ssb-pub-image

(if already using v2, otherwise see v1 -> v2 upgrade guide )

docker pull ahdinosaur/ssb-pub
docker stop sbot
docker rm sbot
./create-sbot

check your pub is running with commands like:

docker logs sbot
./sbot whoami
sunjam commented 3 years ago

Can you please spell out the update process to get things working again. It is failing for me, perhaps related to the helper. Unsure, but I'm still offline

On Mon, Nov 9, 2020, 8:25 PM Mikey notifications@github.com wrote:

published a new version which should fix this: v2.2.0 🎉

i've upgraded my own 3 pubs and they seem to be happy again. đŸ˜ē

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ahdinosaur/ssb-pub/issues/37#issuecomment-724441578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANUKZVH2VSKT73VFHP2E2LSPC6EFANCNFSM4SKSTOTQ .

ahdinosaur commented 3 years ago

@sunjam: i might have been too optimistic. do you see an error, or just that you can't connect to your server from a client?

i also realized now invites are broken.

/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/muxrpcli/index.js:123
      throw err
      ^
{
  message: 'resultHost.replace is not a function',
  name: 'TypeError',
  stack: 'TypeError: resultHost.replace is not a function\n' +
    '    at Object.stringify (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/plugins/net.js:124:31)\n' +
    '    at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/compose.js:111:19\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at Object.stringify (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/compose.js:110:22)\n' +
    '    at /home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/index.js:67:44\n' +
    '    at Array.map (<anonymous>)\n' +
    '    at Object.stringify (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/multiserver/index.js:67:10)\n' +
    '    at EventEmitter.getAddress (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/secret-stack/core.js:213:21)\n' +
    '    at EventEmitter.hooked [as getAddress] (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/hoox/index.js:10:15)\n' +
    '    at getInviteAddress (/home/node/.npm-global/lib/node_modules/ssb-server/node_modules/ssb-invite/index.js:75:18)'
}

ughhhhh đŸ˜ŋ

sunjam commented 3 years ago

Yes, updated pull fixed the pub running, but I see the exact same error you posted when creating invites.

ahdinosaur commented 3 years ago

okay, i think figured out the invite problem: https://github.com/ssb-js/secret-stack/issues/62.

the hotfix is to change your ~/ssb-pub-data/config to match:

(change connections.incoming.net[].external from an array of strings to a string)

{
  "connections": {
    "incoming": {
      "net": [
        {
          "scope": "public",
          "host": "0.0.0.0",
-          "external": ["hostname.yourdomain.tld"],
+          "external": "hostname.yourdomain.tld",
          "transform": "shs",
          "port": 8008
        }
      ]
    },
    "outgoing": {
      "net": [
        {
          "transform": "shs"
        }
      ]
    }
  }
}
ahdinosaur commented 3 years ago

:heart_eyes_cat:

Screenshot from 2020-11-10 18-44-58

murilopolese commented 3 years ago

Thanks for the hotfix, @ahdinosaur !! 🙏