dijs / OpenCyc

Node.js OpenCyc API
9 stars 3 forks source link

Uncaught Error: Unexpected close tag #1

Open OR13 opened 7 years ago

OR13 commented 7 years ago
mocha test.js

(node:11615) DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.

  OpenCyc
    1) should find concepts
    ✓ should obtain concept (193ms)
    ✓ should list instances of concept (391ms)

  2 passing (754ms)
  1 failing

  1) OpenCyc should find concepts:
     Uncaught TypeError: Cannot read property 'length' of undefined
      at /Users/OpenCyc/test.js:11:12
      at /Users/OpenCyc/index.js:33:6
      at Parser.<anonymous> (/Users/OpenCyc/node_modules/xml2js/lib/xml2js.js:493:18)
      at emitOne (events.js:96:13)
      at Parser.emit (events.js:188:7)
      at Object.onerror (/Users/OpenCyc/node_modules/xml2js/lib/xml2js.js:311:26)
      at emit (/Users/OpenCyc/node_modules/sax/lib/sax.js:640:35)
      at error (/Users/OpenCyc/node_modules/sax/lib/sax.js:669:5)
      at strictFail (/Users/OpenCyc/node_modules/sax/lib/sax.js:693:7)
      at closeTag (/Users/OpenCyc/node_modules/sax/lib/sax.js:887:9)
      at Object.write (/Users/OpenCyc/node_modules/sax/lib/sax.js:1449:13)
      at Parser.exports.Parser.Parser.parseString (/Users/OpenCyc/node_modules/xml2js/lib/xml2js.js:508:31)
      at Parser.parseString (/Users/OpenCyc/node_modules/xml2js/lib/xml2js.js:7:59)
      at exports.parseString (/Users/OpenCyc/node_modules/xml2js/lib/xml2js.js:540:19)
      at Request._callback (/Users/OpenCyc/index.js:31:4)
      at Request.self.callback (/Users/OpenCyc/node_modules/request/request.js:123:22)
      at emitTwo (events.js:106:13)
      at Request.emit (events.js:191:7)
      at Request.<anonymous> (/Users/OpenCyc/node_modules/request/request.js:1047:14)
      at emitOne (events.js:101:20)
      at Request.emit (events.js:188:7)
      at IncomingMessage.<anonymous> (/Users/OpenCyc/node_modules/request/request.js:998:12)
      at emitNone (events.js:91:20)
      at IncomingMessage.emit (events.js:185:7)
      at endReadableNT (_stream_readable.js:974:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)

npm ERR! Test failed.  See above for more details.

Digging a bit deeper:

  Uncaught Error: Unexpected close tag
Line: 8
Column: 7
Char: >
      at error (node_modules/sax/lib/sax.js:667:10)
      at strictFail (node_modules/sax/lib/sax.js:693:7)
      at closeTag (node_modules/sax/lib/sax.js:887:9)
      at Object.write (node_modules/sax/lib/sax.js:1449:13)
      at Parser.exports.Parser.Parser.parseString (node_modules/xml2js/lib/xml2js.js:508:31)
      at Parser.parseString (node_modules/xml2js/lib/xml2js.js:7:59)
      at exports.parseString (node_modules/xml2js/lib/xml2js.js:540:19)
      at Request._callback (node_modules/opencyc/index.js:31:4)
      at Request.self.callback (node_modules/opencyc/node_modules/request/request.js:123:22)
      at Request.<anonymous> (node_modules/opencyc/node_modules/request/request.js:1047:14)
      at IncomingMessage.<anonymous> (node_modules/opencyc/node_modules/request/request.js:998:12)
      at endReadableNT (_stream_readable.js:974:12)
      at _combinedTickCallback (internal/process/next_tick.js:74:11)
      at process._tickCallback (internal/process/next_tick.js:98:9)

Seems like the response now contains malformed xml...

I usually do this when I want people to stop using a webservice ; )

Not sure if this is the case.

dijs commented 7 years ago

Sadly, this is not a bug, but an external issue. The webservice this library uses is down right now... It is throwing 404's and service unavailable errors.

I believe this service can be run independently. If you would like to do so, I can make the API URL customizable so you can point it to your own web service. Check it out: http://sw.opencyc.org/

Let me know.

OR13 commented 7 years ago

thanks!

I'm gonna give containerizing this service a shot, If that succeeds I'd appreciate the ability to use a custom opencyc web service endpoint.

wish me luck :)

in case I forget and this actually works: https://github.com/cycorp/issues/issues/11