Git Product home page Git Product logo

Comments (7)

creationix avatar creationix commented on June 4, 2024

Interesting. Any idea if the bug is in my code, node itself, or something cloudent it doing wrong?

Can you trace the data going back and forth using pcap or something?

from couch-client.

dethe avatar dethe commented on June 4, 2024

I've dug into it further. There are several things going on. The unexpected token is because the server is returning

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

when called by CouchClient.

CouchClient also assumes port 5984, and Cloudant is running on port 80, so I need to specify port 80 in my connection url, where curl assumes port 80.

Finally, CouchClient seems to throw away information about secure sockets, so it is not connecting over https.

I've gotten far enough to bring Node and CouchClient up, but it appears to be unresponsive now, will give you some more info when I get it.

from couch-client.

mhemesath avatar mhemesath commented on June 4, 2024

I think I am having a similar issue. I can connect to a CouchDB instance locally, but using Cloudant via heroku over https fails. If I curl my couchdb running on cloudant, I can connect to the database. However, attempting to do the same with CouchClient gives me this:

2011-06-07T14:45:12+00:00 app[web.1]: node.js:134
2011-06-07T14:45:12+00:00 app[web.1]: throw e; // process.nextTick error, or 'error' event on first tick
2011-06-07T14:45:12+00:00 app[web.1]: ^
2011-06-07T14:45:12+00:00 app[web.1]: TypeError: Cannot read property 'rows' of undefined
2011-06-07T14:45:12+00:00 app[web.1]: at /app/node_modules/couch-client/lib/couch-client.js:170:21
2011-06-07T14:45:12+00:00 app[web.1]: at ClientRequest.errorHandler (/app/node_modules/couch-client/lib/couch-client.js:47:23)
2011-06-07T14:45:12+00:00 app[web.1]: at ClientRequest.emit (events.js:64:17)
2011-06-07T14:45:12+00:00 app[web.1]: at CleartextStream. (http.js:1272:31)
2011-06-07T14:45:12+00:00 app[web.1]: at CleartextStream.emit (events.js:61:17)
2011-06-07T14:45:12+00:00 app[web.1]: at Array. (tls.js:617:22)
2011-06-07T14:45:12+00:00 app[web.1]: at EventEmitter._tickCallback (node.js:126:26)

from couch-client.

jhollingworth avatar jhollingworth commented on June 4, 2024

I'm seeing the same issue as @mhemesath

from couch-client.

mhemesath avatar mhemesath commented on June 4, 2024

I got around it by doing this:

 new CouchClient(process.env.CLOUDANT_URL + ":443/myDocument")

from couch-client.

jhollingworth avatar jhollingworth commented on June 4, 2024

awesome, that worked :) thanks!

from couch-client.

mhemesath avatar mhemesath commented on June 4, 2024

I logged an issue specific to this problem here: #29

from couch-client.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.