You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Maarten Thibaut <mt...@cisco.com> on 2008/11/19 05:24:59 UTC

Solaris

Hi,

I'm trying to get couchdb working on Solaris. Attempts with release  
0.9.0a (svn head) and 0.8.1 fail, explanations follow:

* The scripts - such as bin/couchdb and bin/couchjs and etc/init.d/ 
couchdb seem to be written for the bash dialect, but mention /bin/sh  
at the top instead of /bin/bash. Could you fix that?

* After compiling & starting couchdb (SVN head 0.9.0a of 18 November)  
as per the troubleshooting guide, I am stuck at this point when trying  
to run the test suite. When clicking the test suite:

Apache CouchDB 0.9.0a-incubating (LogLevel=info) is starting.
Apache CouchDB has started. Time to relax.
[info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/couch_tests.html?script/ 
couch_tests.js 304
[info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/style/layout.css?0.8.0 304
[info] [<0.58.0>] 127.0.0.1 - - 'GET' /_utils/script/json2.js 304
[info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/script/jquery.js?1.2.6 304
[info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/script/pprint.js?0.8.0 304
[info] [<0.58.0>] 127.0.0.1 - - 'GET' /_utils/script/couch.js?0.8.0 304
[info] [<0.59.0>] 127.0.0.1 - - 'GET' /_utils/script/ 
couch_test_runner.js 404
[info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/image/run.gif 304
[info] [<0.58.0>] 127.0.0.1 - - 'GET' /_utils/image/load.gif 304
[info] [<0.59.0>] 127.0.0.1 - - 'GET' /_utils/image/thead.gif 304

Note that the left pane only has a header (Name, Status, Elapsed Time,  
Details), but no table data. The returned HTML source looks like the  
enclosed PDF.

I've also attached the output of the truss of couchdb (similar to  
strace), see out.gz.



I also tried 0.8.1, the latest downloadable release. It does show all  
the tests, but all of them fail:

truss -o /tmp/out2 -f /tmp/couchdb-0.8.1/bin/couchdb
Apache CouchDB 0.8.1-incubating (LogLevel=info)
Apache CouchDB is starting.

Apache CouchDB has started. Time to relax.
[info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/couch_tests.html" 304
[info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/style/layout.css" 304
[info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/script/json2.js" 304
[info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/script/jquery.js" 304
[info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/script/couch.js" 304
[info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/script/pprint.js" 304
[info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/script/couch_tests.js" 304
[info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/image/hgrad.gif" 304
[info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/image/run.gif" 304
[info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/image/path.gif" 304
[info] [<0.55.0>] 127.0.0.1 - - "GET /_utils/image/load.gif" 304
[info] [<0.56.0>] 127.0.0.1 - - "GET /_utils/image/thead.gif" 304
[info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/image/run-mini.gif" 304
[info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/image/running.gif" 304
[info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/image/test_failure.gif" 304

Basics:

Exception raised: {"message":"Invalid argument","fileName":"http://localhost:5981/_utils/script/couch_tests.js 
","lineNumber":1230,"stack":"patchTest((function (debug) {var db = new  
CouchDB(\"test_suite_db\");db.deleteDb();db.createDb();if (debug)  
{debugger;}T(db.info().doc_count == 0);var doc = {_id: \"0\", a: 1, b:  
1};var result = db.save(doc);T(result.ok ==  
true);T(result.id);T(result.rev);T(doc._id == result.id && doc._rev ==  
result.rev);var id = result.id;T(db.save({_id: \"1\", a: 2, b:  
4}).ok);T(db.save({_id: \"2\", a: 3, b: 9}).ok);T(db.save({_id: \"3\",  
a: 4, b: 16}).ok);T(db.info().doc_count == 4);var results =  
db.allDocs();var rows = results.rows;for (var i = 0; i < rows.length; i 
++) {T(rows[i].id >= \"0\" && rows[i].id <= \"4\");}var mapFunction =  
function (doc) {if (doc.a == 4) {emit(null, doc.b);}};results =  
db.query(mapFunction);T(results.total_rows == 1 &&  
results.rows[0].value == 16);existingDoc = db.open(id);T(existingDoc.a  
== 1);existingDoc.a = 4;db.save(existingDoc);results =  
db.query(mapFunction);T(results.total_rows == 2);T(db.save({a: 3, b:  
9}).ok);T(db.save({a: 4, b: 16}).ok);results =  
db.query(mapFunction);T(results.total_rows == 3);T(db.info().doc_count  
== 6);var reduceFunction = function (keys, values) {return  
sum(values);};results = db.query(mapFunction,  
reduceFunction);T(results.rows[0].value ==  
33);T(db.deleteDoc(existingDoc).ok);T(db.open(existingDoc._id) ==  
null);results = db.query(mapFunction);T(results.total_rows ==  
2);T(db.info().doc_count == 5);}))@http://localhost:5981/_utils/script/couch_tests.js:1230 
\u000arun(0)@http://localhost:5981/_utils/script/couch_tests.js: 
1274\u000a","name":"Error"}

Conflict:
Exception raised: {"message":"Invalid argument","fileName":"http://localhost:5981/_utils/script/couch_tests.js 
","lineNumber":1230,"stack":"patchTest((function (debug) {var db = new  
CouchDB(\"test_suite_db\");db.deleteDb();db.createDb();if (debug)  
{debugger;}var doc = {_id: \"foo\", a: 1, b: 1};T(db.save(doc).ok);var  
doc2 = db.open(doc._id);T(doc._id == doc2._id && doc._rev ==  
doc2._rev);doc.a = 2;doc2.a = 3;T(db.save(doc).ok);try  
{db.save(doc2);T(\"no save conflict 1\" && false);} catch (e)  
{T(e.error == \"conflict\");}doc2._rev = undefined;try  
{db.save(doc2);T(\"no save conflict 2\" && false);} catch (e)  
{T(e.error == \"conflict 
\");}T(db.deleteDoc(doc).ok);T(db.save(doc2).ok);}))@http://localhost:5981/_utils/script/couch_tests.js:1230 
\u000arun(0)@http://localhost:5981/_utils/script/couch_tests.js: 
1274\u000a","name":"Error"}

Truss output is out2.gz.



Any ideas?

Thanks!
maarten

Re: Solaris

Posted by Chris Anderson <jc...@apache.org>.
On Wed, Nov 19, 2008 at 6:21 AM, Adam Kocoloski
<ad...@gmail.com> wrote:
> Hi Maarten, the 404 on couch_test_runner.js means you're probably on
> r718409.  There was a bug in that revision that jchris fixed in r718650.
>  Your test suite should show up if you grab an updated trunk.  Best,
>
> Adam

Maarten,

Pardon my dust. I got so excited about making the Futon test runner
test loading path configurable that I left some stuff out of the
Makefile for a few hours. You must have snagged trunk during that
window. Thanks Adam for bringing the omission to my attention. I think
everything is fixed up these days.

BTW for those on couchdb-user and not couchdb-dev, the description of
my tweaks to the test runner is here:

http://mail-archives.apache.org/mod_mbox/incubator-couchdb-dev/200811.mbox/%3ce282921e0811171514i4882e397yf5bf6728c708c7a2@mail.gmail.com%3e

The basic idea is that you can now use Futon to unit test your design
documents / views.

I hope Solaris goes more smoothly for you now, Maarten.

Chris

-- 
Chris Anderson
http://jchris.mfdz.com

Re: Solaris

Posted by Adam Kocoloski <ad...@gmail.com>.
Hi Maarten, the 404 on couch_test_runner.js means you're probably on  
r718409.  There was a bug in that revision that jchris fixed in  
r718650.  Your test suite should show up if you grab an updated  
trunk.  Best,

Adam

On Nov 18, 2008, at 11:24 PM, Maarten Thibaut wrote:

> Hi,
>
> I'm trying to get couchdb working on Solaris. Attempts with release  
> 0.9.0a (svn head) and 0.8.1 fail, explanations follow:
>
> * The scripts - such as bin/couchdb and bin/couchjs and etc/init.d/ 
> couchdb seem to be written for the bash dialect, but mention /bin/sh  
> at the top instead of /bin/bash. Could you fix that?
>
> * After compiling & starting couchdb (SVN head 0.9.0a of 18  
> November) as per the troubleshooting guide, I am stuck at this point  
> when trying to run the test suite. When clicking the test suite:
>
> Apache CouchDB 0.9.0a-incubating (LogLevel=info) is starting.
> Apache CouchDB has started. Time to relax.
> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/couch_tests.html? 
> script/couch_tests.js 304
> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/style/layout.css?0.8.0  
> 304
> [info] [<0.58.0>] 127.0.0.1 - - 'GET' /_utils/script/json2.js 304
> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/script/jquery.js?1.2.6  
> 304
> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/script/pprint.js?0.8.0  
> 304
> [info] [<0.58.0>] 127.0.0.1 - - 'GET' /_utils/script/couch.js?0.8.0  
> 304
> [info] [<0.59.0>] 127.0.0.1 - - 'GET' /_utils/script/ 
> couch_test_runner.js 404
> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/image/run.gif 304
> [info] [<0.58.0>] 127.0.0.1 - - 'GET' /_utils/image/load.gif 304
> [info] [<0.59.0>] 127.0.0.1 - - 'GET' /_utils/image/thead.gif 304
>
> Note that the left pane only has a header (Name, Status, Elapsed  
> Time, Details), but no table data. The returned HTML source looks  
> like the enclosed PDF.
> <Test Suite.pdf>
>
> I've also attached the output of the truss of couchdb (similar to  
> strace), see out.gz.
>
> <out.gz>
>
> I also tried 0.8.1, the latest downloadable release. It does show  
> all the tests, but all of them fail:
>
> truss -o /tmp/out2 -f /tmp/couchdb-0.8.1/bin/couchdb
> Apache CouchDB 0.8.1-incubating (LogLevel=info)
> Apache CouchDB is starting.
>
> Apache CouchDB has started. Time to relax.
> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/couch_tests.html" 304
> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/style/layout.css" 304
> [info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/script/json2.js" 304
> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/script/jquery.js" 304
> [info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/script/couch.js" 304
> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/script/pprint.js" 304
> [info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/script/couch_tests.js"  
> 304
> [info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/image/hgrad.gif" 304
> [info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/image/run.gif" 304
> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/image/path.gif" 304
> [info] [<0.55.0>] 127.0.0.1 - - "GET /_utils/image/load.gif" 304
> [info] [<0.56.0>] 127.0.0.1 - - "GET /_utils/image/thead.gif" 304
> [info] [<0.53.0>] 127.0.0.1 - - "GET /_utils/image/run-mini.gif" 304
> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/image/running.gif" 304
> [info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/image/test_failure.gif"  
> 304
>
> Basics:
>
> • Exception raised: {"message":"Invalid argument","fileName":"http://localhost:5981/_utils/script/couch_tests.js 
> ","lineNumber":1230,"stack":"patchTest((function (debug) {var db =  
> new CouchDB(\"test_suite_db\");db.deleteDb();db.createDb();if  
> (debug) {debugger;}T(db.info().doc_count == 0);var doc = {_id:  
> \"0\", a: 1, b: 1};var result = db.save(doc);T(result.ok ==  
> true);T(result.id);T(result.rev);T(doc._id == result.id && doc._rev  
> == result.rev);var id = result.id;T(db.save({_id: \"1\", a: 2, b:  
> 4}).ok);T(db.save({_id: \"2\", a: 3, b: 9}).ok);T(db.save({_id:  
> \"3\", a: 4, b: 16}).ok);T(db.info().doc_count == 4);var results =  
> db.allDocs();var rows = results.rows;for (var i = 0; i <  
> rows.length; i++) {T(rows[i].id >= \"0\" && rows[i].id <=  
> \"4\");}var mapFunction = function (doc) {if (doc.a == 4)  
> {emit(null, doc.b);}};results =  
> db.query(mapFunction);T(results.total_rows == 1 &&  
> results.rows[0].value == 16);existingDoc =  
> db.open(id);T(existingDoc.a == 1);existingDoc.a =  
> 4;db.save(existingDoc);results =  
> db.query(mapFunction);T(results.total_rows == 2);T(db.save({a: 3, b:  
> 9}).ok);T(db.save({a: 4, b: 16}).ok);results =  
> db.query(mapFunction);T(results.total_rows ==  
> 3);T(db.info().doc_count == 6);var reduceFunction = function (keys,  
> values) {return sum(values);};results = db.query(mapFunction,  
> reduceFunction);T(results.rows[0].value ==  
> 33);T(db.deleteDoc(existingDoc).ok);T(db.open(existingDoc._id) ==  
> null);results = db.query(mapFunction);T(results.total_rows ==  
> 2);T(db.info().doc_count == 5);}))@http://localhost:5981/_utils/script/couch_tests.js:1230 
> \u000arun(0)@http://localhost:5981/_utils/script/couch_tests.js: 
> 1274\u000a","name":"Error"}
>
> Conflict:
> • Exception raised: {"message":"Invalid argument","fileName":"http://localhost:5981/_utils/script/couch_tests.js 
> ","lineNumber":1230,"stack":"patchTest((function (debug) {var db =  
> new CouchDB(\"test_suite_db\");db.deleteDb();db.createDb();if  
> (debug) {debugger;}var doc = {_id: \"foo\", a: 1, b:  
> 1};T(db.save(doc).ok);var doc2 = db.open(doc._id);T(doc._id ==  
> doc2._id && doc._rev == doc2._rev);doc.a = 2;doc2.a =  
> 3;T(db.save(doc).ok);try {db.save(doc2);T(\"no save conflict 1\" &&  
> false);} catch (e) {T(e.error == \"conflict\");}doc2._rev =  
> undefined;try {db.save(doc2);T(\"no save conflict 2\" && false);}  
> catch (e) {T(e.error == \"conflict 
> \");}T(db.deleteDoc(doc).ok);T(db.save(doc2).ok);}))@http://localhost:5981/_utils/script/couch_tests.js:1230 
> \u000arun(0)@http://localhost:5981/_utils/script/couch_tests.js: 
> 1274\u000a","name":"Error"}
>
> Truss output is out2.gz.
>
> <out2.gz>
>
> Any ideas?
>
> Thanks!
> maarten


Re: Solaris

Posted by Noah Slater <ns...@apache.org>.
Maarten,

I have created the following bug and should get to the fix pretty soon:

  https://issues.apache.org/jira/browse/COUCHDB-169

Please subscribe to this bug to stay updated.

Thanks,

-- 
Noah Slater, http://tumbolia.org/nslater

Re: Solaris

Posted by Maarten Thibaut <mt...@cisco.com>.
Hi,

> My local "checkbashisms" doesn't seem to complain at all. The  
> [ ... ] syntax is
> just a shortcut for "test" and I would prefer to avoid it if  
> possible. Could you
> check for me that using "test expr" wouldn't work in its place.

No, "test expr" doesn't work. After test you can only have arguments  
to test, not shell expressions. It is possible of course to do:

if test `echo 2> /dev/null >> $PID_FILE; echo $?` -gt 0; then

For proof, see the man page: http://docs.sun.com/app/docs/doc/816-5165/test-1?l=en&q=man&a=view

> This seems reasonable, though checkbashisms doesn't report anything.
>
> I am wondering if your Solaris shell is POSIXly correct. Could you  
> provide me
> with a pointer to its manual, please?

It doesn't get more POSIX than Solaris :).

$ /bin/sh
$ echo $(echo yes)
syntax error: `(' unexpected

Here is the man page. Note that the "Command substitution" section  
doesn't mention anything about $() syntax.

http://docs.sun.com/app/docs/doc/816-5165/sh-1?l=en&q=man&a=view

cheers,
maarten

Re: Solaris

Posted by Noah Slater <ns...@apache.org>.
On Thu, Nov 20, 2008 at 05:59:18AM +0100, Maarten Thibaut wrote:
> The bin.diff fixes 3 occurrences like this, where an "if ! something" is
> done. Sadly, that doesn't work on solaris /bin/sh:
>
> if ! echo 2> /dev/null >> $PID_FILE; then
>
> Replaced by:
>
> echo 2> /dev/null >> $PID_FILE
> if [ $? -gt 0 ]; then

My local "checkbashisms" doesn't seem to complain at all. The [ ... ] syntax is
just a shortcut for "test" and I would prefer to avoid it if possible. Could you
check for me that using "test expr" wouldn't work in its place.

if test ! echo 2> /dev/null >> $PID_FILE; then
   echo foo
fi

> The second is for etc/init/couchdb.tpl.in and is a one liner. $
> (executable) doesn't work in sh, so replaced it with `executable`.

This seems reasonable, though checkbashisms doesn't report anything.

I am wondering if your Solaris shell is POSIXly correct. Could you provide me
with a pointer to its manual, please?

Thanks,

-- 
Noah Slater, http://tumbolia.org/nslater

Re: Solaris

Posted by Maarten Thibaut <mt...@cisco.com>.
Hi there,

First thanks to all who replied. I have a few patches for the sh vs.  
bash.


The bin.diff fixes 3 occurrences like this, where an "if ! something"  
is done. Sadly, that doesn't work on solaris /bin/sh:

if ! echo 2> /dev/null >> $PID_FILE; then

Replaced by:

echo 2> /dev/null >> $PID_FILE
if [ $? -gt 0 ]; then

The second is for etc/init/couchdb.tpl.in and is a one liner. $ 
(executable) doesn't work in sh, so replaced it with `executable`.

Otherwise, no problems - it does seem as if care was taken to be shell  
agnostic. I've had to send along heavier fixes than this to  
maintainers :).

As for the tests: I was hit by the bug that Chris & Adam mentioned.  
After upgrading the Makefile the tests showed up and all of them run  
successfully.

Thanks for the swift replies!

--
maarten


On Nov 19, 2008, at 9:41 AM, Noah Slater wrote:

> On Wed, Nov 19, 2008 at 05:24:59AM +0100, Maarten Thibaut wrote:
>> * The scripts - such as bin/couchdb and bin/couchjs and etc/init.d/
>> couchdb seem to be written for the bash dialect, but mention /bin/ 
>> sh at
>> the top instead of /bin/bash. Could you fix that?
>
> If the do not work with a POSIX shell, that is a bug. Could you  
> mention
> specifically what the problem is though?
>
>> [info] [<0.59.0>] 127.0.0.1 - - 'GET' /_utils/script/ 
>> couch_test_runner.js 404
>
> 404 is bad. Is this on your file system?
>
> Can you check under PREFIX/usr/share/couchdb please?
>
>> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/image/run.gif 304
>
> 304 is not an error condition.
>
>> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/couch_tests.html" 304
> ...
>> [info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/image/ 
>> test_failure.gif" 304
>
> See above, 304 is a normal result.
>
>> Exception raised: {"message":"Invalid
>> argument","fileName":"http://localhost:5981/_utils/script/couch_tests.js
>> ","lineNumber":1230,"stack":"patchTest((function (debug) {var db =  
>> new
> ...
>
> Yeah, doesn't look good.
>
> I would be interested to know the contents of your PREFIX/usr/share/ 
> couchdb
> directory before trying to figure much else out.
>
> Thanks for the full and detailed bug report, by the way!
>
> Best,
>
> -- 
> Noah Slater, http://tumbolia.org/nslater


Re: Solaris

Posted by Noah Slater <ns...@apache.org>.
On Wed, Nov 19, 2008 at 05:24:59AM +0100, Maarten Thibaut wrote:
> * The scripts - such as bin/couchdb and bin/couchjs and etc/init.d/
> couchdb seem to be written for the bash dialect, but mention /bin/sh at
> the top instead of /bin/bash. Could you fix that?

If the do not work with a POSIX shell, that is a bug. Could you mention
specifically what the problem is though?

> [info] [<0.59.0>] 127.0.0.1 - - 'GET' /_utils/script/couch_test_runner.js 404

404 is bad. Is this on your file system?

Can you check under PREFIX/usr/share/couchdb please?

> [info] [<0.56.0>] 127.0.0.1 - - 'GET' /_utils/image/run.gif 304

304 is not an error condition.

> [info] [<0.52.0>] 127.0.0.1 - - "GET /_utils/couch_tests.html" 304
...
> [info] [<0.54.0>] 127.0.0.1 - - "GET /_utils/image/test_failure.gif" 304

See above, 304 is a normal result.

> Exception raised: {"message":"Invalid
> argument","fileName":"http://localhost:5981/_utils/script/couch_tests.js
> ","lineNumber":1230,"stack":"patchTest((function (debug) {var db = new
...

Yeah, doesn't look good.

I would be interested to know the contents of your PREFIX/usr/share/couchdb
directory before trying to figure much else out.

Thanks for the full and detailed bug report, by the way!

Best,

-- 
Noah Slater, http://tumbolia.org/nslater

Re: Solaris

Posted by Maarten Thibaut <mt...@cisco.com>.
Hi Thibaut,

Funny name you have :).

As I understand in this phase of the project it's more to use the  
latest svn head. And the 0.9.0a head is working fine. Thanks for the  
links though!

maarten

On Nov 20, 2008, at 10:15 PM, Thibaut Barrère wrote:

> Hi Maarten,
>
> I got 0.8.1 running on Solaris (didn't do extensive testing so far  
> though).
>
> You may want to have a our collaborative notes over there:
> - http://wiki.joyent.com/accelerators:setup-couchdb
> - http://discuss.joyent.com/viewtopic.php?id=24108
>
> hth,
>
> Thibaut Barrère
> --
> LoGeek
> [blog] http://evolvingworker.com - tools for a better day
> [blog] http://blog.logeek.fr - about writing software


Re: Solaris

Posted by Thibaut Barrère <th...@gmail.com>.
Hi Maarten,

I got 0.8.1 running on Solaris (didn't do extensive testing so far though).

You may want to have a our collaborative notes over there:
- http://wiki.joyent.com/accelerators:setup-couchdb
- http://discuss.joyent.com/viewtopic.php?id=24108

hth,

Thibaut Barrère
--
LoGeek
[blog] http://evolvingworker.com - tools for a better day
[blog] http://blog.logeek.fr - about writing software