0

I'm not familiar with python, maybe someone could explain what's going on here?

ec2-user@prod-opscenter-01:~ % java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

ec2-user@prod-opscenter-01:~ % python -V
Python 2.6.8

ec2-user@prod-opscenter-01:~ % openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013

And now the error


ec2-user@prod-opscenter-01:~ % sudo /etc/init.d/opscenterd start
Starting Cassandra cluster manager opscenterd
Starting opscenterdUnhandled Error
Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 652, in run
    runApp(config)
  File "/usr/lib64/python2.6/site-packages/twisted/scripts/twistd.py", line 23, in runApp
    _SomeApplicationRunner(config).run()
  File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 386, in run
    self.application = self.createOrGetApplication()
  File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 451, in createOrGetApplication
    application = getApplication(self.config, passphrase)
--- <exception caught here> ---
  File "/usr/lib64/python2.6/site-packages/twisted/application/app.py", line 462, in getApplication
    application = service.loadApplication(filename, style, passphrase)
  File "/usr/lib64/python2.6/site-packages/twisted/application/service.py", line 405, in loadApplication
    application = sob.loadValueFromFile(filename, 'application', passphrase)
  File "/usr/lib64/python2.6/site-packages/twisted/persisted/sob.py", line 210, in loadValueFromFile
    exec fileObj in d, d
  File "bin/start_opscenter.py", line 1, in <module>
    from opscenterd import opscenterd_tap
  File "/usr/lib/python2.6/site-packages/opscenterd/opscenterd_tap.py", line 37, in <module>

  File "/usr/lib/python2.6/site-packages/opscenterd/OpsCenterdService.py", line 13, in <module>

  File "/usr/lib/python2.6/site-packages/opscenterd/ClusterServices.py", line 22, in <module>

  File "/usr/lib/python2.6/site-packages/opscenterd/WebServer.py", line 40, in <module>

  File "/usr/lib/python2.6/site-packages/opscenterd/Agents.py", line 18, in <module>

exceptions.ImportError: cannot import name _parse

Failed to load application: cannot import name _parse

Maybe there are open source alternatives to monitoring cassandra I should look at?

Thanks a lot

gansbrest
  • 785
  • 1
  • 8
  • 17

1 Answers1

2

The line causing the error is from twisted.web.client import Agent, _parse. OpsCenter bundles a version of twisted with its distribution to ensure proper compatibility. It sounds like you have an incompatible version of twisted installed on the system that is being used instead.

Edit: There's a known issue with Amazon Linux AMIs. In /user/share/opscenter/bin/opscenter, add the following line just before export PYTHONPATH=...: PY_DISTRO="./lib/py-redhat/${PY_VER}/shared/${PY_ARCH}:./lib/py-redhat/${PY_VER‌​}/6/${PY_ARCH}"

We'll have to look into handling that better within OpsCenter itself, but in the meantime removing the third party install of twisted, while not elegant, should certainly get you up and running.

To determine if/where twisted is installed: python -c "import twisted; print twisted"

mbulman
  • 366
  • 1
  • 4
  • hm, removed third party twisted. No get this error: Starting Cassandra cluster manager opscenterd Starting opscenterdTraceback (most recent call last): File "./bin/twistd", line 25, in from twisted.scripts.twistd import run ImportError: No module named twisted.scripts.twistd – gansbrest Oct 25 '13 at 17:39
  • Looks like it's not picking up the bundled version of twisted at all. In /usr/share/opscenter/bin/twistd, add `print sys.path` above the line that reads `from twisted.scripts.twistd import run`, and restart opscenterd. You should see some paths in that list that start with `/usr/share/opscenter/lib/`, and one of them should contain the twisted module. – mbulman Oct 25 '13 at 17:51
  • That's how it looks like: http://pastebin.com/4uLF8HDd – gansbrest Oct 25 '13 at 18:00
  • Hm, it looks like twisted is located here /usr/share/opscenter/lib/py-redhat/2.6/shared/amd64 and here /usr/share/opscenter/lib/py-unpure , but both paths are not in the search list.. I wonder why. I'm on Amazon AMI by the way. – gansbrest Oct 25 '13 at 18:06
  • Ah, yeah. There's a known issue with Amazon Linux AMIs. In `/user/share/opscenter/bin/opscenter`, add the following line just before `export PYTHONPATH=...`: `PY_DISTRO="./lib/py-redhat/${PY_VER}/shared/${PY_ARCH}:./lib/py-redhat/${PY_VER}/6/${PY_ARCH}"` – mbulman Oct 25 '13 at 18:37
  • Yep thanks, seems like it did the trick. Would be nice if that could be fixed in the future versions maybe. – gansbrest Oct 25 '13 at 20:36