Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document router invocation error #257

Closed
yogeshVU opened this issue Jun 26, 2020 · 4 comments
Closed

document router invocation error #257

yogeshVU opened this issue Jun 26, 2020 · 4 comments

Comments

@yogeshVU
Copy link

Environment:
ubuntu 18.04
webgme-cli version (webgme -v):
v2.8.3
Operating system and kernel: (cat /etc/os-release, uname -r preferred)

4.15.0-101-generic

NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

NodeJS version (node -v):
v8.9.0
npm version (npm -v):
5.5.1
Description:
In the Getting started readme:
Error when invoking documentation router for python-plugin
Steps to Reproduce:

webgme import router BindingsDocs webgme-bindings

Results:

In the Getting started readme:

When trying to execute the

webgme import router BindingsDocs webgme-bindings

One get's following error

vagrant@linux:~/webgme-tut/MyNewProject$ webgme import router BindingDocs webgme-bindings
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN mynewproject@1.0.0 No repository field.
npm WARN mynewproject@1.0.0 No license field.

+ webgme-bindings@1.2.0
updated 1 package in 3.857s
/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/ComponentManager.js:255
        componentPath = utils.getPathContaining(otherConfig[this._webgmeName].basePaths.map(
                                                                              ^

TypeError: Cannot read property 'basePaths' of undefined
    at RouterManager.ComponentManager._getPathFromGME (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/ComponentManager.js:255:79)
    at RouterManager.ComponentManager._getPathFromDependency (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/ComponentManager.js:222:73)
    at RouterManager.ComponentManager._getJsonForConfig (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/ComponentManager.js:184:10)
    at RouterManager._getJsonForConfig (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/RouterManager.js:111:50)
    at RouterManager.ComponentManager._addComponentFromProject (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/ComponentManager.js:164:17)
    at utils.installProject (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/ComponentManager.js:153:18)
    at ChildProcess.job.on.code (/home/vagrant/.nvm/versions/node/v8.9.0/lib/node_modules/webgme-cli/src/utils.js:443:20)
    at emitTwo (events.js:131:20)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)

@yogeshVU
Copy link
Author

Also referenced here: webgme/bindings#7

@brollb
Copy link
Contributor

brollb commented Jun 27, 2020

Thanks, @yogeshVU. After looking into this a bit more, it looks like there are two things going on here:

  • The bindings repo renamed the router without updating the config (BindingsDocs -> BindingDocs)
  • webgme-cli can't find the router info in the CLI config (webgme-setup.json) so it tries to find it in the webgme config and fails.
    The first point should be fixed in the bindings repo. The second issue should be fixed here (either more intelligent search for routers or better error handling).

@kecso
Copy link
Member

kecso commented Jun 27, 2020

Does that fix hints the source of the error? (no such component or something)
Probably it would be even better if the error could print out the available ones (as in this particular case, the repository was found just no such component exists)

@brollb
Copy link
Contributor

brollb commented Jun 28, 2020

When the CLI searches for a component, it first looks in webgme-setup.json then tries to search in the GME config if it fails. The error was a result of the CLI searching incorrectly in the GME config for the router. There are a few fixes that could happen here:

  • fix the error in the generic method which searches for a given component from the GME config
  • improve the detection of routers from the GME config

The first approach is the bare minimum (and the approach I took :) ). Essentially, if the error is fixed, then the CLI will still not find the router (as no router with the given name exists) and it will automatically print out the "component not found" error (I forget what the exact wording is).

Printing out the available routers - or a sort of "did you mean X?" - message would be a good idea but can be viewed as a separate feature imo. (Not to take away from its usefulness as a feature as it does seem like it would be useful!)

@brollb brollb closed this as completed in e50e150 Jun 28, 2020
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

No branches or pull requests

3 participants