Wednesday, August 12, 2009

Need Pancakes

‹prev | My Chain | next›

Dang it! I thought I was done with my VirtualBox work, but I see now that searching is not working:



No pancakes?! That ain't right.

I still have to install couchdb-lucene. More specifically I need to install my fork of pre-version 0.3 couchdb-lucene (version 0.3 solved the problem that I tried to solve, but I have yet to go back to adapt to version 0.3).

So I clone my git repository:
cstrom@debian:~/repos$ git clone git://github.com/eee-c/couchdb-lucene.git
Initialized empty Git repository in /home/cstrom/repos/couchdb-lucene/.git/
remote: Counting objects: 2589, done.
remote: Compressing objects: 100% (924/924), done.
remote: Total 2589 (delta 841), reused 2460 (delta 752)
Receiving objects: 100% (2589/2589), 1.87 MiB | 152 KiB/s, done.
Resolving deltas: 100% (841/841), done.
To install couchdb-lucene, I need maven:
cstrom@debian:~/repos$ sudo apt-get install maven2
After waiting for a long time for all of the various packages to download and install, I run the maven build:
cstrom@debian:~/repos/couchdb-lucene$ mvn
...
[INFO] [compiler:compile]
[INFO] Compiling 15 source files to /home/cstrom/repos/couchdb-lucene/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Unable to locate the Javac Compiler in:
/usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.
It seems that I need openjdk installed:
cstrom@debian:~/repos/couchdb-lucene$ sudo apt-get install openjdk-6-jdk
With that in place, the mvn command runs just fine and I have my couchdb-lucene JAR file.

I edit /etc/couchdb/local.ini, appending the following couchdb-lucene configuration to use that JAR file:
[couchdb]
os_process_timeout=60000 ; increase the timeout from 5 seconds.

[external]
fti=/usr/bin/java -jar /home/cstrom/repos/couchdb-lucene/target/couchdb-lucene-0.3-SNAPSHOT-jar-with-dependencies.jar -search

[update_notification]
indexer=/usr/bin/java -Dcouchdb.lucene.commit.min=50 -Dcouchdb.lucene.commit.max=100 -jar /home/cstrom/repos/couchdb-lucene/target/couchdb-lucene-0.3-SNAPSHOT-jar-with-dependencies.jar -index

[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}
When I search again for pancakes, I get... no pancakes.

Upon further review, I happen across this in /var/log/couchdb/0.9.0/couch.log:
[Wed, 12 Aug 2009 22:03:15 GMT] [error] [<0.20.0>] {error_report,<0.7.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./httpd_util.beam. Function: get_file. Process: code_server."}}

[Wed, 12 Aug 2009 22:03:15 GMT] [error] [<0.20.0>] {error_report,<0.7.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./calendar.beam. Function: get_file. Process: code_server."}}

[Wed, 12 Aug 2009 22:03:15 GMT] [error] [<0.20.0>] {error_report,<0.7.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./timer.beam. Function: get_file. Process: code_server."}}

[Wed, 12 Aug 2009 22:03:15 GMT] [error] [<0.20.0>] {error_report,<0.7.0>,
{<0.20.0>,std_error,
"File operation error: eacces. Target: ./eval_bits.beam. Function: get_file. Process: code_server."}}

[Wed, 12 Aug 2009 22:03:15 GMT] [error] [<0.51.0>] OS Process died with status: 1

[Wed, 12 Aug 2009 22:03:15 GMT] [error] [<0.51.0>] ** Generic server <0.51.0> terminating
** Last message in was {#Port<0.748>,{exit_status,1}}
** When Server state == {os_proc,"/usr/bin/java -Dcouchdb.lucene.commit.min=50 -Dcouchdb.lucene.commit.max=100 -jar /home/cstrom/repos/couchdb-lucene/target/couchdb-lucene-0.3-SNAPSHOT-jar-with-dependencies.jar -index",
#Port<0.748>,
#Fun,
#Fun,60000}
** Reason for termination ==
** {exit_status,1}
Even an Erlang newb like myself recognizes a permission problem. At first I believe this to be a problem writing to the index directory, but using options like "-Dcouchdb.lucene.dir=/var/lib/couchdb/0.9.0/index" to force a write-able index directory does not resolve.

Happily, I eventually determine that the problem is my JAR file: /home/cstrom/repos/couchdb-lucene/target/couchdb-lucene-0.3-SNAPSHOT-jar-with-dependencies.jar. The CouchDB process is running as the couchdb user which cannot access my home directory. After granting all users read access to my home directory (chmod 755 /home/cstrom), I finally have pancakes:



I had not planned on this local dry-run install, but I am glad I did. I missed several things that I will need to address before deploying to a VPS.

By way of summary, when configuring Debian, I add testing repositories (for a recent version of CouchDB):
#...
deb http://http.us.debian.org/debian testing main contrib non-free
deb http://non-us.debian.org/debian-non-US testing/non-US main contrib non-free
deb http://security.debian.org testing/updates main contrib non-free
I then need to install these packages:
apt-get install sudo openssh-server \
couchdb \
ruby ruby-dev rubygems rake irb make curl git-core \
libopenssl-ruby \
libidn11 \
maven2 openjdk-6-jdk
The gems that are needed include: couch_docs, Sinatra, Haml, json (a dependency of couch_docs, but maybe not for long), Pony, and Redcloth.

No comments:

Post a Comment