Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Cassandra 2.1.0 is not launching #32488

Closed
schrepfler opened this issue Sep 21, 2014 · 17 comments
Closed

Cassandra 2.1.0 is not launching #32488

schrepfler opened this issue Sep 21, 2014 · 17 comments

Comments

@schrepfler
Copy link
Contributor

I'm getting a strange error if I launch cassandra

/usr/local/opt/cassandra/bin/cassandra -f
objc[10370]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Error opening zip file or JAR manifest missing : /usr/local/Cellar/cassandra/2.1.0/jamm-0.2.5.jar
Error occurred during initialization of VM
agent library failed to init: instrument

the jamm version in the distro is jamm-0.2.6 however so I'm not sure where is 0.2.5 coming from, perhaps from pervious launcher?

@hellysmile
Copy link

Search via google recommends to downgrade java to specific versions, but it doesn't helps. Here is really problem with " jamm"

i've found a commit about jamm version, but i have no idea how to fix it apache/cassandra@420c685

@schrepfler
Copy link
Contributor Author

I removed the folder mentioned in this ticket #26145 now it launches.
I guess the brew needs something to handle upgrades.

@hellysmile
Copy link

@schrepfler can you say which exactly directory?

PS: nvm, rm -rf /usr/local/etc/cassandra/ and reinstall via brew reinstall cassandra, now it's working

@dmitshur
Copy link

Ran into this too. That helped @hellysmile, thanks.

@majimboo
Copy link

Currently having the exact same problem.

Did:

$ rm -rf /usr/local/etc/cassandra/
$ brew reinstall cassandra
$ ln -sfv /usr/local/opt/cassandra/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist // this errors
nothing found to load

update

Again I had the problem on my home mac, (the previous is on my work mac), but the steps above fixed it on my home.

@jpemberthy
Copy link

confirmed rm -rf /usr/local/etc/cassandra/ and reinstall via brew reinstall cassandra fixed the issue. Thanks.

@MikeMcQuaid
Copy link
Member

So does the configuration file need changing on upgrade, then? Can someone create a pull request to do it?

@matope
Copy link
Contributor

matope commented Nov 10, 2014

I've hit the same issue in upgrading from 2.0.7 to 2.1.1.
I've found that /usr/local/etc/cassandra/cassandra-env.sh is not upgated and It requires old jamm-0.2.5.jar. But I don't know why it is not updated.

@igal-getrailo
Copy link

I just experienced this when trying to run Cassandra as a Windows service, as downloaded from
http://planetcassandra.org/cassandra/ (version 2.1.2 64bit)

Fixed it by downloading jamm-0.2.6.jar from http://mvnrepository.com/artifact/com.github.jbellis/jamm/0.2.6 and saving it to C:\Program Files\DataStax Community\apache-cassandra\lib

Looks like someone forgot to package it with the installer...

@cemmersb
Copy link

Can confirm that the issue still persists with cassandra-2.1.2
rm -rf /usr/local/etc/cassandra/ && brew reinstall cassandra resolved the issue. Would be nice, if we could get an upgrade routine in place that replaces the required files

@DomT4
Copy link
Member

DomT4 commented Dec 19, 2014

It looks like it's not the entire etc directory that's a problem, but rather one single line in cassandra-env.sh, which is JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/jamm-0.2.6.jar" or similar. Obviously, that shipped version of jamm changes every now and again, but brew doesn't override the file you already have in place and so cassandra expects to find a jamm that is no longer there.

If you change JVM_OPTS="$JVM_OPTS -javaagent:$CASSANDRA_HOME/jamm-0.2.6.jar" (or similar) to the correct jamm version, everything seems to launch and function fine again.

If I had the Ruby knowledge to do so, I'd propose fixing it with something like this:

jamm = shell.output("ls -1 #{prefix} | grep jamm")
inreplace etc/"cassandra/cassandra-env.sh", "jamm-", jamm

And that should work. But my Ruby isn't that great, and brew doesn't like taking shell arguments outside of test do.

But replacing that one line does seem to work. @jacknagel or @MikeMcQuaid will probably be able to say whether that kind of thing is possible/doable/acceptable in Ruby and brew, but I suspect it'd have to be Rubyified to go in the formula, ideally, and I'm still trying to wrap my head around Ruby classes 😁.

@schrepfler
Copy link
Contributor Author

what would happen if we make that a regular expression jamm-*.jar?

@darkaico
Copy link

thanks @hellysmile works your solution on my environment!

@cemmersb
Copy link

Since I came across the same issue with the latest update, I made a simple grep to find out which config files may be affected. The following list seems to be complete:

/usr/local/etc/cassandra/cassandra-env.ps1
/usr/local/etc/cassandra/cassandra-env.ps1.default
/usr/local/etc/cassandra/cassandra-env.sh

Could we filter the version number during the brew install and replace it with the great * regex solution which seems to be working just perfectly fine?
Or by setting the correct number to use?

@MikeMcQuaid
Copy link
Member

Someone needs to submit a pull request.

@DomT4
Copy link
Member

DomT4 commented Dec 7, 2015

We'll take a PR here if this is still relevant, Thanks!

@DomT4 DomT4 closed this as completed Dec 7, 2015
@sankalpanand
Copy link

That worked for my Mac as well. Thanks.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests