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

pants build fails: No module named contrib.node.register #25

Closed
kuroshhashemi opened this issue Nov 29, 2016 · 8 comments
Closed

pants build fails: No module named contrib.node.register #25

kuroshhashemi opened this issue Nov 29, 2016 · 8 comments

Comments

@kuroshhashemi
Copy link

Hi. When running:
./src/jvm/io/fsq/twofishes/scripts/parse.py -w /output/dir
I get error Exception message:
Failed to load the pants.contrib.node.register backend: No module named contrib.node.register

Same as issue #23 however when I run
rm -rf ~/.cache/fsqio
from fsqio directory and try again with above code, I get the same exception message

@mateor
Copy link
Contributor

mateor commented Nov 29, 2016

can you paste the output please?

@kuroshhashemi
Copy link
Author

Are you suuuuuure you want to drop your mongo data? Type "yes" to continue: yes
./pants run src/jvm/io/fsq/twofishes/indexer/importers/geonames:geonames-parser --jvm-run-jvm-options=-Dlogback.configurationFile=src/jvm/io/fsq/twofishes/indexer/data/logback.xml --jvm-run-jvm-program-args=--parse_world --jvm-run-jvm-program-args=true --jvm-run-jvm-program-args=--output_revgeo_index --jvm-run-jvm-program-args=false --jvm-run-jvm-program-args=--output_s2_covering_index --jvm-run-jvm-program-args=false --jvm-run-jvm-program-args=--output_s2_interior_index --jvm-run-jvm-program-args=false --jvm-run-jvm-program-args=--output_prefix_index --jvm-run-jvm-program-args=true --jvm-run-jvm-program-args=--reload_data --jvm-run-jvm-program-args=true --jvm-run-jvm-program-args=--hfile_basepath --jvm-run-jvm-program-args=output/dir
Traceback (most recent call last):
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/extension_loader.py", line 138, in load_backend
    module = importlib.import_module(backend_module)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named contrib.node.register
Exception caught: (<class 'pants.base.exceptions.BackendConfigurationError'>)
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/bin/pants", line 11, in <module>
    sys.exit(main())
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 44, in main
    PantsRunner(exiter).run()
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 53, in run
    options_bootstrapper=options_bootstrapper)
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 43, in _run
    return LocalPantsRunner(exiter, args, env, options_bootstrapper=options_bootstrapper).run()
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 49, in run
    self._maybe_profiled(self._run)
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 46, in _maybe_profiled
    runner()
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 55, in _run
    options, build_config = OptionsInitializer(options_bootstrapper, exiter=self._exiter).setup()
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 129, in setup
    return self._setup_options(self._options_bootstrapper, self._working_set)
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 103, in _setup_options
    build_configuration = load_plugins_and_backends(plugins, working_set, backend_packages)
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/extension_loader.py", line 36, in load_plugins_and_backends
    load_build_configuration_from_source(build_configuration, additional_backends=backends or [])
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/extension_loader.py", line 124, in load_build_configuration_from_source
    load_backend(build_configuration, backend_package)
  File "/Users/kuroshhashemi/.cache/pants/setup/bootstrap-Darwin-x86_64/1.0.1/lib/python2.7/site-packages/pants/bin/extension_loader.py", line 142, in load_backend
    .format(backend=backend_module, error=e))

Exception message: Failed to load the pants.contrib.node.register backend: No module named contrib.node.register```

@mateor
Copy link
Contributor

mateor commented Nov 29, 2016

Hmmm...so your output says it is running from the ~/.cache/pants directory. I suppose that these scripts could be bypassing some of our config by being run in this manner, they are pretty old.

Although I do not see that when I run the scripts locally, even after deleting the pants directory. Let's try the optimistic thing and delete them both.

rm -rf ~/.cache/pants/ && rm -rf ~/.cache/fsqio

One way or another, when you delete these Pant needs to rebootstrap. If it fails, paste the fullput and the results of:

git log -1
git diff HEAD~1

@kuroshhashemi
Copy link
Author

Output uploaded here:
log.txt

@mateor
Copy link
Contributor

mateor commented Nov 29, 2016

So - why did you change the pants script?

If you return it to the state of Fsq.io's master branch, you should get different results: https://github.com/foursquare/fsqio/blob/master/pants

That uses our config and builds a fsq.io virtualenv with Fsq.io dependencies. You are missing dependencies because you are not installing them.

@mateor
Copy link
Contributor

mateor commented Dec 5, 2016

closing since the issue appears clear. Feel free to reopen as needed.

@mateor mateor closed this as completed Dec 5, 2016
@kuroshhashemi
Copy link
Author

kuroshhashemi commented Dec 5, 2016 via email

@mateor
Copy link
Contributor

mateor commented Dec 5, 2016

It appeared to me that they tried to install Pants into the repo, which isn't needed. A fresh clone of fsqio, installing the deps listed in the README, and running the script appears to work.

Troubleshooting would be:

  • wipe your existing ~/.cache/pants and ~/.cache/fsqio directories
  • if on OSX also running the commands listed here
    • can be needed if upgraded to Sierra or new homebrew

Feel free to open a new issue if you have a new problem, and best of luck.

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

2 participants