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

collins.sh issues #149

Closed
Kvetch opened this issue Apr 26, 2014 · 13 comments
Closed

collins.sh issues #149

Kvetch opened this issue Apr 26, 2014 · 13 comments
Assignees

Comments

@Kvetch
Copy link

Kvetch commented Apr 26, 2014

I am having issues getting collins.sh to explicitly see my JAVA_HOME and even if I adjust the collins.sh I get a DButil scala issue.

I run the following as root
sudo -u collins /usr/local/collins/scripts/collins.sh initdb collins_db_uname collins_db_password
mysql root password. Enter for none.
Enter password:
mysql root password. Enter for none.
Enter password:
FAIL
Didn't find /bin/java, check JAVA_HOME?

env
SHELL=/bin/bash
...
USER=root
...
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/usr/local/collins
JAVA_HOME=/usr/lib/jvm/j2sdk1.6-oracle
...

So I adjusted line 41 to read
for dir in /usr/lib/jvm/j2sdk1.6-oracle /opt/jdk /System/Library/Framework s/JavaVM.framework/Versions/CurrentJDK/Home /usr/java/default; do

After that I get the following
sudo -u collins /usr/local/collins/scripts/collins.sh initdb collins_db_uname collins_db_password
mysql root password. Enter for none.
Enter password:
mysql root password. Enter for none.
Enter password:
Running migrations
Exception in thread "main" java.lang.NoClassDefFoundError: DbUtil
Caused by: java.lang.ClassNotFoundException: DbUtil
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: DbUtil. Program will exit.

Thoughts on how I can get past this?

@william-richard
Copy link
Contributor

Hi @Kvetch,

I think we talked on IRC?

Since then, I've had some time to think and investigate.

First issue is that I released a bad build of v1.2.4 (doh 😞). So, please start by downloading a fresh zip from here: https://github.com/tumblr/collins/releases/download/v1.2.4/collins-1.2.4.zip - so sorry about that. I'm pretty sure that's causing your DbUtil import error. I have another theory as to what may be going on if using this fresh zip doesn't fix that problem.

Second, I don't think we've ever built/run collins on debian before, so I'm guessing that we'll have to add your modification to https://github.com/tumblr/collins/blob/master/scripts/collins.sh#L41. @dallasmarlow - can you confirm that seems like a good idea?

Let me know if that doesn't work, and we'll figure this out from there.

Thanks for your patience!

@Kvetch
Copy link
Author

Kvetch commented Apr 30, 2014

Hi @Primer42,
Yes, that was me on IRC.
So yes, the new build corrects the DBUtil problem but I still have to explicitly list my java_home in collins.sh.
It now runs the migrations and evolutions but I don't think it is creating my /usr/local/bin/daemon. I have tried a couple times to verify but no matter what it doesn't create the file.
...
...
sudo /usr/local/collins/scripts/collins.sh start
Starting collins... /usr/local/collins/scripts/collins.sh: line 34: /usr/local/bin/collins: No such file or directory
/usr/local/collins/scripts/collins.sh: line 99: /usr/local/bin/collins: No such file or directory
ls -l /usr/local/bin/collins
ls: cannot access /usr/local/bin/collins: No such file or directory

Also since technically to read environment variables you are suppose to use the source cmd to call a script. You might have the best luck pulling in vars with something similar to
!/bin/bash
JAVA_HOME=
echo $JAVA_HOME >> JAVA_HOME

Thoughts on getting the executable to be found?

@william-richard
Copy link
Contributor

Hi @Kvetch
I think I want to try to replicate your problem, so I can try to diagnose it myself. Can you give me this information:
OS flavor and version
Java version (and if you're using OpenJDK or Oracle's java - we've only tested with oracle afaik)
daemon version
Any other information you think is relevant

Thanks,

@Kvetch
Copy link
Author

Kvetch commented May 3, 2014

Hi @Primer42
It is a plain jane debian wheezy install.

uname -a
3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux

cat /etc/debian_version
7.4 --- wheezy

jdk-6u45-linux-x64.bin and jce_policy-6.zip

cd $JAVA_HOME
root@hostname:/usr/lib/jvm/j2sdk1.6-oracle

update-java-alternatives --list
j2sdk1.6-oracle 315 /usr/lib/jvm/j2sdk1.6-oracle
java-1.6.0-openjdk-amd64 1061 /usr/lib/jvm/java-1.6.0-openjdk-amd64

What distro are you guys running it on?

@solaris7
Copy link

I have the same problem running Ubuntu 12.04 LTS, Linux 3.13.0-24-generic #47~precise2-Ubuntu. Were you able to get this going?

@mikefaille
Copy link

I dont have Daemon too on fedora 20 :
Starting collins... /home/michael/Downloads/collins/scripts/collins.sh: ligne34: /usr/local/bin/daemon:

@byxorna
Copy link
Contributor

byxorna commented Jun 16, 2014

@mikefaille I agree. daemonize should be ripped out and replaced with something LSB compliant (start_daemon?): https://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html As a temp fix though, daemon should be available in the fedora repos.

@yl3w
Copy link
Contributor

yl3w commented Aug 11, 2014

Can you list the contents of /usr/local/collins/current/lib. The script makes the assumption that collins is installed the /usr/local/collins/current

@byxorna
Copy link
Contributor

byxorna commented Sep 4, 2014

@mikefaille @solaris7 @Kvetch #207 will clean up the init script and make it more portable.

@mikefaille
Copy link

With systemd, if we can just start colin without background process, it could be perfect !
I just need stdout logs and systemd could deamonize it easilly.

@william-richard
Copy link
Contributor

Now that the cleaner init script is out, can you try again using either the new release (1.3.0) or the current head?

@mikefaille
Copy link

I will try as soon I have this time. Maybe in one week. Thanks !

On Wed, Sep 24, 2014 at 2:20 PM, William Richard notifications@github.com
wrote:

Now that the cleaner init script is out, can you try again using either
the new release (1.3.0) or the current head?


Reply to this email directly or view it on GitHub
#149 (comment).

@byxorna
Copy link
Contributor

byxorna commented Nov 3, 2014

Closing. Fixed in the latest init script.

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

6 participants