iriscouch / couchjs Goto Github PK
View Code? Open in Web Editor NEWDrop-in replacement JavaScript engine for Apache CouchDB
License: Apache License 2.0
Drop-in replacement JavaScript engine for Apache CouchDB
License: Apache License 2.0
While trying couchjs with a replica of the npm database, I get consistent crashes due to parsing an incomplete json buffer:
Error 19988: SyntaxError: Unexpected end of input at Object.parse (native)
at Loop (eval at <anonymous> (/usr/local/lib/node_modules/couchjs/cli.js:67:21))
at eval (eval at <anonymous> (/usr/local/lib/node_modules/couchjs/cli.js:67:21))
/tmp/couchjs.log shows the rest of the json coming in as separate lines on stdin (actually 25 of them).
I haven't wrapped my head around fibers yet, so I can't really offer a fix (for what I suspect to be couchjs.readline). Happy to supply more input though.
I can't seem to get this working.
I'm on SmartOS. Keep getting this all over my couch log:
[Thu, 20 Jun 2013 18:21:21 GMT] [error] [<0.867.0>] OS Process Error <0.891.0> :: {os_process_error,
"OS process timed out."}
[Thu, 20 Jun 2013 18:21:25 GMT] [error] [<0.842.0>] OS Process Error <0.897.0> :: {os_process_error,
"OS process timed out."}
master and release are pretty out of sync.
typing ['reset'] into the CLI gets the following error:
["fatal","unknown_error","SyntaxError: Unexpected token '\n at Object.parse (native)\n at Loop (eval at <anonymous> (/node_modules/couchjs/cli.js:77:21), <anonymous>:1559:16)\n at eval (eval at <anonymous> (node_modules/couchjs/cli.js:77:21), <anonymous>:1576:1)\n at node_modules/couchjs/cli.js:80:24"]
I'm not sure if couch's main is expected to clean up the \n or if the CLI should... seems like the main.js api actually requires the \n, but it certainly isn't working.
With both node v.0.10.13 and v0.12.0 I get the following error when entering anything from the cli:
couchjs/0.3.2 23920: /usr/share/couchdb/server/main.js
Call main
Uncaught error:
TypeError: Unknown encoding: buffer
at Buffer.toString (buffer.js:274:17)
at LineStream2._transform (node_modules/couchjs/stream.js:36:21)
at LineStream2.Transform._read (_stream_transform.js:179:10)
at LineStream2.Transform._write (_stream_transform.js:167:12)
at doWrite (_stream_writable.js:301:12)
at writeOrBuffer (_stream_writable.js:288:5)
at LineStream2.Writable.write (_stream_writable.js:217:11)
at ReadStream.ondata (_stream_readable.js:540:20)
at ReadStream.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
From what I can tell, although the CLI sets the encoding (on line 70), _stream_writable.js:writeOrBuffer sets the encoding to 'buffer', despite successfully "decoding" the chunk. My current guess is that _stream_writable.js:decodeChunk is /supposed/ to return a string.
...
Later: I actually fixed this particular bug not by changing decodeChunk (that caused other problems), but instead by not overriding the encoding. If it is already set, we don't change it to 'buffer' in writeOrBuffer.
My pull request for node.js with a bug fix is here:
nodejs/node-v0.x-archive#9372
I found this because I'm currently watching many couchjs.exe instances run and I wanted to know more about how they work.
It seems like this project is a replacement for these query servers (couchjs.exe)? Could you add a couple lines to the documentation on why you wanted a replacement for the bundled queries servers? I think, from my limited experience, that CouchDB javascript is not run using V8 - so potentially I can see that there might be performance gains from using a query service that did?
When I run commands to fetch query server info, as suggested in Readme for couchjs.
curl http://myadminuser:mypassword@localhost:5984/_config/query_servers/javascript
get following error :
{"error":"not_found","reason":"Database does not exist."}
I am using following system:
Couchdb : 3.0
OS: Lubuntu
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.