staltz / ssb-room

A server to find and connect to other SSB peers – a meeting place. AGPL-3.0
GNU Affero General Public License v3.0
109 stars 17 forks source link

`check` command results in `Error: no async:whoami` on various cloud providers #19

Open danmackinlay opened 3 years ago

danmackinlay commented 3 years ago

Running the manual install instructions creates a room that seems to start up but cannot pass a ./room check succesfully.

Here is a transcript of the state the system gets in to, on an ovh.com vanilla Debian 10 VM.

$ ./create-room 
WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap.
29c9d7937727bb8e8e15c2be0f1a4690f50775abecceacd0deae24524b383d2d
$ docker logs room
2020-11-05T20:33:20.742Z secret-stack Adding transport net
2020-11-05T20:33:20.746Z secret-stack Adding transform shs
2020-11-05T20:33:20.749Z ssb:conn-db Created new conn.json because there was no existing conn.json nor gossip.json
Thu, 05 Nov 2020 20:33:20 GMT express:application set "x-powered-by" to true
Thu, 05 Nov 2020 20:33:20 GMT express:application set "etag" to 'weak'
Thu, 05 Nov 2020 20:33:20 GMT express:application set "etag fn" to [Function: generateETag]
Thu, 05 Nov 2020 20:33:20 GMT express:application set "env" to 'development'
Thu, 05 Nov 2020 20:33:20 GMT express:application set "query parser" to 'extended'
Thu, 05 Nov 2020 20:33:20 GMT express:application set "query parser fn" to [Function: parseExtendedQueryString]
Thu, 05 Nov 2020 20:33:20 GMT express:application set "subdomain offset" to 2
Thu, 05 Nov 2020 20:33:20 GMT express:application set "trust proxy" to false
Thu, 05 Nov 2020 20:33:20 GMT express:application set "trust proxy fn" to [Function: trustNone]
Thu, 05 Nov 2020 20:33:20 GMT express:application booting in development mode
Thu, 05 Nov 2020 20:33:20 GMT express:application set "view" to [Function: View]
Thu, 05 Nov 2020 20:33:20 GMT express:application set "views" to '/views'
Thu, 05 Nov 2020 20:33:20 GMT express:application set "jsonp callback name" to 'callback'
Thu, 05 Nov 2020 20:33:20 GMT express:router use '/' query
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router use '/' expressInit
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router use '/' serveStatic
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router use '/' urlencodedParser
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:application set "port" to 8007
Thu, 05 Nov 2020 20:33:20 GMT express:application set "views" to '/home/node/.npm-global/lib/node_modules/ssb-room/pages'
Thu, 05 Nov 2020 20:33:20 GMT express:application set "view engine" to 'ejs'
Thu, 05 Nov 2020 20:33:20 GMT express:router:route new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router:route get '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
Thu, 05 Nov 2020 20:33:20 GMT express:router:route new '/setup'
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/setup'
Thu, 05 Nov 2020 20:33:20 GMT express:router:route get '/setup'
Thu, 05 Nov 2020 20:33:20 GMT express:router:layer new '/'
2020-11-05T20:33:20.786Z ssb:room:http Express app is running on port 8007
2020-11-05T20:33:20.788Z secret-stack net plugin creating transport host=0.0.0.0 port=8008 scope=public
2020-11-05T20:33:20.788Z secret-stack creating server net shs host=0.0.0.0 port=8008 scope=public
2020-11-05T20:33:20.788Z secret-stack net plugin creating transport host=0.0.0.0 port=8008 scope=public
2020-11-05T20:33:20.789Z secret-stack net plugin creating transport host=undefined port=NaN scope=undefined
2020-11-05T20:33:20.790Z multiserver:net Listening on 0.0.0.0:8008
$ ./room check
{ message: 'no async:whoami',
  name: 'Error',
  stack:
   'Error: no async:whoami\n    at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:29:13)\n    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:37:22)\n    at Object.request (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/stream.js:48:17)\n    at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:161:17)\n    at PacketStream.write (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:134:41)\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/pull-weird.js:56:15\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-stream/sinks/drain.js:24:37\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-goodbye/node_modules/pull-stream/throughs/filter.js:17:11\n    at Object.cb (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream-codec/index.js:111:11)\n    at drain (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-reader/index.js:39:14)' }
danmackinlay commented 3 years ago

On the other hand if I execute these instructions on my plain old laptop, my ssb room container runs without error. possibly this is OVH-specific? Any debugging tips?

danmackinlay commented 3 years ago

NB this is the same error as reported at #21 for Digital Ocean. As such we can assume it occurs for various setups

Also as noted at #21 the room server still starts and appears to function. It is just the ./room check command that never returns successfully. Does this cause a problem for the healer and restarter systems?

retog commented 3 years ago

Same problem

node@734ad8ac2edb:/$ ssb-room check
{ message: 'no async:whoami',
  name: 'Error',
  stack:
   'Error: no async:whoami\n    at Object.localCall (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:29:13)\n    at Object.<anonymous> (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/local-api.js:37:22)\n    at Object.request (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/stream.js:48:17)\n    at PacketStream._onrequest (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:161:17)\n    at PacketStream.write (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream/index.js:134:41)\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/muxrpc/pull-weird.js:56:15\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-stream/sinks/drain.js:24:37\n    at /home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-goodbye/node_modules/pull-stream/throughs/filter.js:17:11\n    at Object.cb (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/packet-stream-codec/index.js:111:11)\n    at drain (/home/node/.npm-global/lib/node_modules/ssb-room/node_modules/pull-reader/index.js:39:14)' }
n

After removing the health check the web-server is exposed by my proxy (traefik).

OrvilleRed commented 3 years ago

@retog

After removing the health check the web-server is exposed by my proxy (traefik).

Sorry, does that mean the ssb-room is Basically Working Properly after you removed the health check? And if so... what exactly did you do to "remove the health check"?

Thanks!

danmackinlay commented 3 years ago

AFAICT the ssb-room I have is running on a cheap VM successfully without any changes. It just throws ugly errors; I'm currently caught up on a different distribut edsocial network system so don't have time to sort out exactly what I did, despite my bold claims I would document it, sorry.

OrvilleRed commented 3 years ago

@danmackinlay Thanks for the quick reply!

AFAICT the ssb-room I have is running on a cheap VM successfully without any changes. It just throws ugly errors

Did you wind up using a DO droplet? How did you get the room up and running?

I'm currently caught up on a different distributed social network system

Curious: which one?

retog commented 3 years ago

@denisgoddard

Sorry, does that mean the ssb-room is Basically Working Properly after you removed the health check?

yes

And if so... what exactly did you do to "remove the health check"?

I used docker cp to replace the file /home/node/.npm-global/lib/node_modules/ssb-room/bin.js with a version that comments outs the following:

/*rpc.whoami((err2, x) => {
      if (err2) {
        console.error(err2);
        process.exit(1);
      } else {
        console.log(x.id);
        process.exit(0);
      }
    });*/
FoundOne commented 3 years ago

Is there a way to understand what causes it? I have my own computer and I'm trying to run my own room, but I have this error. Also, it seems that error marks the container unhealthy.

Edit: That makes the healer script useless. It will just restart it every time. The room works great so far.