Skip to content

[WIP] update to ssb-server@13.5.2#299

Merged
mixmix merged 5 commits into
masterfrom
ssb-server@13.5.2
Jan 9, 2019
Merged

[WIP] update to ssb-server@13.5.2#299
mixmix merged 5 commits into
masterfrom
ssb-server@13.5.2

Conversation

@mixmix

@mixmix mixmix commented Jan 7, 2019

Copy link
Copy Markdown
Member

I want to use scuttle-shell, I couldn't get it running so this is an incremental step - bring the server version into alignment.

@mixmix

mixmix commented Jan 7, 2019

Copy link
Copy Markdown
Member Author

Here are the current errors I'm hitting when I npm start.
I've looked through the files in the stack trace but I don't know what I'm looking for... I think the server isn't starting right and my guess is because it's not getting the config it wants?
(I also noticed ssb-client has some really old deps. Probably not related, but made a PR)

TypeError: proto.server is not a function
    at Object.server (/home/mix/projects/SSBC/patchbay/node_modules/secret-stack/node_modules/multiserver/compose.js:96:29)
    at /home/mix/projects/SSBC/patchbay/node_modules/secret-stack/node_modules/multiserver/index.js:31:21
    at Array.map (<anonymous>)
    at Object.server (/home/mix/projects/SSBC/patchbay/node_modules/secret-stack/node_modules/multiserver/index.js:30:26)
    at setupMultiserver (/home/mix/projects/SSBC/patchbay/node_modules/secret-stack/index.js:173:21)
    at EventEmitter.getAddress (/home/mix/projects/SSBC/patchbay/node_modules/secret-stack/index.js:209:11)
    at EventEmitter.hooked [as getAddress] (/home/mix/projects/SSBC/patchbay/node_modules/hoox/index.js:10:15)
    at /home/mix/projects/SSBC/patchbay/node_modules/ssb-server/plugins/local.js:85:30
Error: listen EADDRINUSE 2407:7000:9c49:4e00:7cba:778b:7b7f:e6f0:8008
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at Server.setupListenHandle [as _listen2] (net.js:1351:14)
    at listenInCluster (net.js:1392:12)
    at doListen (net.js:1501:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

@mixmix mixmix changed the title update to ssb-server@13.5.2 [WIP] update to ssb-server@13.5.2 Jan 7, 2019
@arj03

arj03 commented Jan 7, 2019

Copy link
Copy Markdown
Member

Can you post your ~/.ssb/config?

@cryptix

cryptix commented Jan 7, 2019

Copy link
Copy Markdown
Member

Hrm.. the config.js might need a server:true on the unix socket to get this working but I wonder how it worked before.... I'll try this later on a clean install.

related:

@christianbundy

christianbundy commented Jan 7, 2019

Copy link
Copy Markdown
Contributor

I think the problem is happening in the config merging:

(diff)

And, config JSON diff (additions cause breakage):


41a42,47
>       ],
>       "unix": [
>         {
>           "scope": "local",
>           "transform": "noauth"
>         }
60c66,67
<   "_": []
---
>   "_": [],
>   "remote": "unix:/home/christianbundy/.ssb/socket:~noauth:+oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU="

I don't know why this works, but it does.

See: ssbc/multiserver#33
@christianbundy

Copy link
Copy Markdown
Contributor

Just pushed a commit adding server: true and it seems to be working now. Force-pushed because I'd accidentally pushed a merge commit as well.

@mixmix

mixmix commented Jan 8, 2019

Copy link
Copy Markdown
Member Author
mixmix  » cat ~/.ssb/config
{
  "plugins": {
    "ssb-npm-registry": false
  }
}

I knew it was possible for things in here to sneak in so went and gutted it some time ago!

@mixmix

mixmix commented Jan 8, 2019

Copy link
Copy Markdown
Member Author

Cool, yeah that get's me past the server.proto error (btw how did you figure that out @christianbundy ... did you read all the links @cryptix left?)


Now on to this error, which @arj03 says is in ssb-db : #295 (comment)

EncodingError: Unexpected token % in JSON at position 0
    at /home/mix/projects/SSBC/patchbay/node_modules/level-sublevel/node_modules/levelup/lib/read-stream.js:60:28
    at /home/mix/projects/SSBC/patchbay/node_modules/ssb-db/node_modules/abstract-leveldown/abstract-iterator.js:29:14
    at /home/mix/projects/SSBC/patchbay/node_modules/ssb-db/node_modules/encoding-down/index.js:126:5
    at /home/mix/projects/SSBC/patchbay/node_modules/ssb-db/node_modules/abstract-leveldown/abstract-iterator.js:29:14
    at /home/mix/projects/SSBC/patchbay/node_modules/ssb-db/node_modules/leveldown/iterator.js:45:7
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

@christianbundy

Copy link
Copy Markdown
Contributor

@mixmix

Yeah, I saw ssbc/ssb-server#577 describing a problem so I opened ssbc/multiserver#33 to request some documentation, and I think ssbc/multiserver#34 adds test coverage that shows that server: true is required now but nobody knows how to use it or why server must be truthy (I think it's meant to be an object (?)).

@mixmix mixmix merged commit 6bf62cd into master Jan 9, 2019
@mixmix mixmix deleted the ssb-server@13.5.2 branch January 9, 2019 03:21
@mixmix

mixmix commented Jan 9, 2019

Copy link
Copy Markdown
Member Author

This is working now. I'm going to merge it.

People pulling and installing will get the fresh ssb-db, but if you've been messing with this, check your ssb-db is at 18.6.4 !

(trashing your node_modules and lockfile is a fine way to fix it, or npm update ssb-db --depth 2 probably?)

@mixmix

mixmix commented Jan 9, 2019

Copy link
Copy Markdown
Member Author

Thanks for the help everyone, this was a surprisingly delightful experience, I felt really supported and totally unblocked cc @christianbundy @cryptix @arj03

❤️ ❤️ ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants