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
158 stars 25 forks source link

./sbot whoiam -> Could not connect to the scuttlebot server. #15

Open mimosinnet opened 5 years ago

mimosinnet commented 5 years ago

I am stuck at step 3 of the manual setup tutorial. The container ahdinosaur/ssb-pub starts:

CONTAINER ID        IMAGE                       COMMAND   CREATED              STATUS                         
2e2b79e0083e        ahdinosaur/healer      "/bin/healer"  32 minutes ago      Up 32 minutes healer
ddbbe986ce08        ahdinosaur/ssb-pub   "sbot server" About an hour ago  Up About an hour (unhealthy)   0.0.0.0:8008->8008/tcp   sbot

Nevertheless,

% ./sbot whoami
Error: Could not connect to the scuttlebot server.
Use the "server" command to start it.

It is possible to ssh into the container and issue the command with the same output:

% docker exec -it sbot bash
node@ddbbe986ce08:~/.npm-global/bin$ ./sbot whoiam
Error: Could not connect to the scuttlebot server.
Use the "server" command to start it.

I would appreciate any hint on how to debug this issue. Thanks!

2color commented 5 years ago

I'm experiencing the same problem.

2color commented 5 years ago

@mimosinnet I was able to find the source of the problem.

I think it has to do with the ssb_host env var (declared in https://github.com/ssbc/ssb-config) badly configured in the docker run command -e ssb_host.

qbolec commented 5 years ago

I was following the simplified list of steps, and in step 8 I've was stucked, because doing

./sbot whoami

has displayed an Error that there is no docker sbot running. I've figured that I have to run ./create-sbot before step 8. Perhaps that is on the picture titled digital-butt-step-3.png, but unfortunately the pictures do not load :(

ahdinosaur commented 5 years ago

hi @mimosinnet @2color @qbolec, sorry y'all are having trouble using ssb-pub!

i just setup another two pubs, one using the automated setup and one using manual setup, i wasn't able to reproduce any errors.

i can echo what @2color said:

I think it has to do with the ssb_host env var (declared in https://github.com/ssbc/ssb-config) badly configured in the docker run command -e ssb_host.

if you want to use a domain name for your pub, please ensure you have setup a DNS A record pointing from your domain name to the ip address of your pub server, and your ./create-sbot command has host=your.domain.name with your domain name.

if you don't have this setup properly, then you will get the error described in the original post.

ahdinosaur commented 5 years ago

I was following the simplified list of steps, and in step 8 I've was stucked, because doing

./sbot whoami

has displayed an Error that there is no docker sbot running. I've figured that I have to run ./create-sbot before step 8.

@qbolec: the automated installer at butt.nz should have already run ./create-sbot for you, so you don't need to run it again unless you want to change the host as described in the optional steps 11 and 12.

ahdinosaur commented 5 years ago

also apologies for my late response! on a positive note, i've been working on a new approach to pubs for PeachCloud, hopefully in a few months will have something to replace ssb-pub using only Debian packages (so installation should be a breeze), stay tuned! :dancer:

mplorentz commented 5 years ago

@ahdinosaur I am also having some issues running through the "manual setup" steps. Is it possible that you have a config file that is causing your tests to succeed but ours to fail?

ahdinosaur commented 5 years ago

@mplorentz each time i'm starting from a brand new Digital Ocean server. maybe i should record a screencast?

mplorentz commented 5 years ago

@ahdinosaur thanks for the offer but your instructions are really very clear!

I figured out my issue. For some reason setting the ssb_host environment variable seems to break sbot. Removing the -e line from my create_sbot allowed me to successfully run sbot whoami.

Of course with no hostname I can't generate invites. But placing a config in the ssb-pub-data directory with the following format seems to work.

{
   "connections": {
      "incoming": {
         "net": [{ "host": "mypub.com", "port": 8008, "scope": "public", "transform": "shs" }]
      },
      "outgoing": {
         "net": [{ "transform": "shs" }]
      }
   }
}

Is the ssb_host environment variable no longer supported by sbot?

adrigen commented 4 years ago

if you want to use a domain name for your pub, please ensure you have setup a DNS A record pointing from your domain name to the ip address of your pub server, and your ./create-sbot command has host=your.domain.name with your domain name.

Thanks, that helped me sort my issue out.

justinabrahms commented 4 years ago

I had this same issue with the kubernetes configuration. If you'd like to make it work there, you'll probably want to do something like:

SSB_APPNAME=mm MM_SSB_HOST=127.0.0.1 sbot whoami

This sets the app context as mm then lets you prefix config variables with mm to change them.