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

Problems with collins 1.3.0 collins.sh script #250

Open
kgoedert opened this issue Jan 13, 2015 · 8 comments
Open

Problems with collins 1.3.0 collins.sh script #250

kgoedert opened this issue Jan 13, 2015 · 8 comments
Assignees

Comments

@kgoedert
Copy link

Hi

When I execute sudo -u ubuntu /home/ubuntu/collins/scripts/collins.sh initdb username passwd I get the following error:

Initializing collins database on localhost...
Please enter mysql root password. Press for none.
Enter password:
Granting privs to collins user on localhost...
Please enter mysql root password. Press for none.
Enter password:
Running migrationsError: Could not find or load main class DbUtil

I am using a ubuntu 14.04 installed on a VirtualBox.

Thanks for any help

@byxorna
Copy link
Contributor

byxorna commented Jan 13, 2015

Hey @kgoedert . We have seen people have issues with this before on debian based systems. Usually this has stemmed from an incorrect classpath. Whats your $JAVA_HOME look like? Also, is collins.sh start able to find play.core.server.NettyServer?

${JAVA_HOME}/bin/java ${APP_OPTS} -cp "$APP_HOME/lib/*" DbUtil $APP_HOME/conf/evolutions/

cc @maddalab

@byxorna
Copy link
Contributor

byxorna commented Jan 13, 2015

Possibly related: #217 #173 #149
Also, just to humor me, can you try with the latest collins.sh in master? Thanks!

@kgoedert
Copy link
Author

my JAVA_HOME is set to /usr/bin/java

If I run sh collins/scripts/collins.sh start I get collins/scripts/collins.sh: 43: collins/scripts/collins.sh: Syntax error: "(" unexpected

@kgoedert
Copy link
Author

Tried the version of collins.sh on master, and got the same results

@byxorna
Copy link
Contributor

byxorna commented Jan 13, 2015

@kgoedert thats interesting. Is ubuntu not using bash? or is bash a symlink to another shell? https://github.com/tumblr/collins/blob/v1.3.0/scripts/collins.sh#L43 @roymarantz suspects that we are using a newer function syntax that should instead be function running {...}

Typically the DbUtil class not found errors are because the APP_HOME is incorrect, so the classpath is not set appropriately (see https://github.com/tumblr/collins/blob/v1.3.0/scripts/collins.sh#L14 and https://github.com/tumblr/collins/blob/v1.3.0/scripts/collins.sh#L133 ). Have you overridden variables like APP_HOME to the root of your app's installation directory with /etc/sysconfig/collins? https://github.com/tumblr/collins/blob/v1.3.0/scripts/collins.sh#L35 sets the default which i suspect is not where your app is installed...

@kgoedert
Copy link
Author

Hi,

my APP_HOME was wrong, I echoed it and it had no value, but the file in /etc/sysconfig/collins was correct. I set the APP_HOME home manually on the script and now I get:

Running evolutions...
Exception in thread "main" java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:274)
at scala.None$.get(Option.scala:272)
at play.api.db.evolutions.OfflineEvolutions$.applyScript(Evolutions.scala:513)
at DbUtil$delayedInit$body.apply(DbUtil.scala:10)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:60)
at scala.App$$anonfun$main$1.apply(App.scala:60)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:45)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
at scala.App$class.main(App.scala:60)
at DbUtil$.main(DbUtil.scala:4)
at DbUtil.main(DbUtil.scala)

@byxorna
Copy link
Contributor

byxorna commented Jan 27, 2015

@kgoedert that is a very interesting error; I have never seen this before. Sounds like your classpath is still screwed up, because it appears the DbUtil is unable to get the class loader. Can you add -x to the shebang line of collins.sh so we can see exactly what is happening?

@windowsrefund
Copy link

Seeing this on a freshly installed 1.3.0 ontop of CentOS 6.4

Could not find the main class: collins.DbUtil. Program will exit

Worth noting perhaps is that I followed the install steps from http://tumblr.github.io/collins/recipes.html#centos

I'd be willing to go to CentOS 6.5 though if that's what's needed.

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