ssbc / ssb-server

The gossip and replication server for Secure Scuttlebutt - a distributed social network
1.69k stars 164 forks source link

Error: plugin at:ssb-foo expected name:ssb-foo but had:foo #675

Open christianbundy opened 5 years ago

christianbundy commented 5 years ago

Currently happening with all plugins installed with ssb-server plugins.install.

ssb-server 15.0.1 /home/christianbundy/.ssb logging.level:notice
my key ID: +oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU=.ed25519
/home/christianbundy/.config/yarn/global/node_modules/ssb-plugins/load-user-plugins.js:54
        throw new Error('plugin at:'+module_name+' expected name:'+name+' but had:'+(plugin||{}).name)
        ^

Error: plugin at:ssb-identities expected name:ssb-identities but had:identities
    at module.exports (/home/christianbundy/.config/yarn/global/node_modules/ssb-plugins/load-user-plugins.js:54:15)
    at Object.module.exports.loadUserPlugins (/home/christianbundy/.config/yarn/global/node_modules/ssb-plugins/index.js:240:55)
    at Object.<anonymous> (/home/christianbundy/.config/yarn/global/node_modules/ssb-server/bin.js:65:26)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
christianbundy commented 5 years ago

Workaround is editing ~/.ssb/config to hardcode { name: 'foo' } manually.

christianbundy commented 5 years ago

cc: @dominictarr am I doing something wrong here? For example, ssb-server plugins.install ssb-identities sets the config as:

{
  "plugins": {
    "ssb-identities": {
      "name": "ssb-identities"
    }
  }
}

which throws the above error. The fix is to manually change this to:

{
  "plugins": {
    "ssb-identities": {
      "name": "identities"
    }
  }
}
christianbundy commented 5 years ago

Looks like this regression may have been made in https://github.com/ssbc/ssb-plugins/commit/7ee651a5fc48fe588ab24b5abe45dd013591e102, maybe we should be require()ing the plugin to get the real plugin.name? Or maybe we could circumvent the problem by just using true unless it came from the filesystem.

kode54 commented 4 years ago

Oh, I see, I have to specify the plugin name on the command line.

stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?